Skip to content

Instantly share code, notes, and snippets.

@johnnyb
Created July 15, 2016 20:56
Show Gist options
  • Select an option

  • Save johnnyb/72ed125863e933225f47417eae974d5b to your computer and use it in GitHub Desktop.

Select an option

Save johnnyb/72ed125863e933225f47417eae974d5b to your computer and use it in GitHub Desktop.
let req = Stripe.paymentRequestWithMerchantIdentifier("HIDDEN")
req?.requiredBillingAddressFields = PKAddressField.PostalAddress
req?.requiredShippingAddressFields = PKAddressField.None
let summary = PKPaymentSummaryItem(label: "Total", amount: currentOrder!.total())
req?.paymentSummaryItems = [summary]
req?.supportedNetworks = [PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa, PKPaymentNetworkDiscover]
let auth = PKPaymentAuthorizationViewController(paymentRequest: req!)
auth.delegate = self
self.presentViewController(auth, animated: true, completion: {
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment