I am trying to use Apple Pay in my app. It works fine to present PKPaymentAuthorizationViewController. However, after I filled up with credit card and billing information, it just shows a spinning wheel and 'processing' as shown in the picture.
The code for presenting Apple Pay view controller is as follows:
let request = Stripe.paymentRequestWithMerchantIdentifier(DH_APPLEPAY_ID)
request.paymentSummaryItems = [PKPaymentSummaryItem(label: label, amount: amountDecimal)]
request.requiredBillingAddressFields = PKAddressField.All
request.requiredShippingAddressFields = PKAddressField.PostalAddress | PKAddressField.Email
request.countryCode = "US"
request.currencyCode = "USD"
request.merchantCapabilities = PKMerchantCapability.CapabilityEMV | PKMerchantCapability.Capability3DS
request.supportedNetworks = [PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa]
if Stripe.canSubmitPaymentRequest(request) {
let paymentController = PKPaymentAuthorizationViewController(paymentRequest: request)
paymentController.delegate = self
self.navigationController?.presentViewController(paymentController, animated: true, completion: nil)
} else {
//popup
DHUtils.alert("Apple Pay", message: "Please add your credit card to Passbook.", inViewController: self)
}
The func paymentAuthorizationViewController(controller: PKPaymentAuthorizationViewController!, didAuthorizePayment payment: PKPayment!, completion: ((PKPaymentAuthorizationStatus) -> Void)!)
delegate never get called.
The certificate status looks all right. What do I miss here to make it work?
PKPaymentAuthorizationViewController
, such asdidSelectShippingAddress
? – lxt