Created
October 4, 2017 22:34
-
-
Save farhan-syed/28cc3e71f9a62296302b3e315bf9ad44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func handleApplePayButtonTapped(){ | |
let merchIdentifier = "merchant.com.yourApp" | |
let paymentRequest = Stripe.paymentRequest(withMerchantIdentifier: merchIdentifier, country: "US", currency: "USD") | |
paymentRequest.paymentSummaryItems = [ | |
PKPaymentSummaryItem(label: "Something", amount: 50.00), | |
PKPaymentSummaryItem(label: "Your Company", amount: 50.00)] | |
if Stripe.canSubmitPaymentRequest(paymentRequest) { | |
let paymentAuthorizationViewController = PKPaymentAuthorizationViewController(paymentRequest: paymentRequest) | |
paymentAuthorizationViewController.delegate = self | |
present(paymentAuthorizationViewController, animated: true, completion: nil) | |
} else { | |
print("Config incorrect") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment