Skip to content

Instantly share code, notes, and snippets.

@farhan-syed
Created October 4, 2017 22:34
Show Gist options
  • Save farhan-syed/28cc3e71f9a62296302b3e315bf9ad44 to your computer and use it in GitHub Desktop.
Save farhan-syed/28cc3e71f9a62296302b3e315bf9ad44 to your computer and use it in GitHub Desktop.
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