Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine "Apple Pay capable" based on available card types from the project #805

Merged
merged 18 commits into from
Sep 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ final class PledgePaymentMethodsViewController: UIViewController {

// MARK: - Configuration

func configureWith(_ value: (User, Project)) {
func configure(with value: (user: User, project: Project)) {
let pledgePaymentMethodsValue = PledgePaymentMethodsValue(
user: value.0,
project: value.1,
applePayCapable: PKPaymentAuthorizationViewController.applePayCapable(for: value.1)
user: value.user,
project: value.project,
applePayCapable: PKPaymentAuthorizationViewController.applePayCapable(for: value.project)
)

self.viewModel.inputs.configureWith(pledgePaymentMethodsValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ final class PledgeViewController: UIViewController, MessageBannerViewControllerP
self.viewModel.outputs.configurePaymentMethodsViewControllerWithValue
.observeForUI()
.observeValues { [weak self] value in
self?.paymentMethodsViewController.configureWith(value)
self?.paymentMethodsViewController.configure(with: value)
}

self.sessionStartedObserver = NotificationCenter.default
Expand Down
6 changes: 4 additions & 2 deletions Library/PKPaymentAuthorizationViewController+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ extension PKPaymentAuthorizationViewController {
return PKPaymentNetwork.chinaUnionPay
case .visa:
return PKPaymentNetwork.visa
default:
return nil // case .diners and case .generic
case .diners:
ifbarrera marked this conversation as resolved.
Show resolved Hide resolved
return nil
case .generic:
return nil
}
}
}