I am implementing Apple Pay using PassKit, I am showing the dialog the proper way and handling the delegate methods, but every time I use touch Id to verify a purchase it says "Payment not completed" and never reaches my delegate method paymentAuthorizationViewController:didAuthorizePayment:completion:
. I did all of these things fully to set up apple pay, but I cant seem to get a token back to send to my payment gateway.
PKPaymentRequest *request = [[PKPaymentRequest alloc] init];
self.paymentRequest = request;
request.countryCode = @"US";
request.currencyCode = @"USD";
request.supportedNetworks = @[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa];
request.merchantCapabilities = PKMerchantCapabilityEMV;
request.merchantIdentifier = @"merchant.com.*******";
request.requiredShippingAddressFields = PKAddressFieldPostalAddress;
request.requiredBillingAddressFields = PKAddressFieldPostalAddress;
request.paymentSummaryItems = [self paymentSummaryItems];
self.paymentPane = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:request];
self.paymentPane.delegate = self;
if (self.paymentPane) {
[self presentViewController:self.paymentPane animated:TRUE completion:nil];
}
Here is what I am seeing, and the screen just stays there and says "Try Again" over and over:
If the error message “Payment not completed” is displayed when attempting to download the iOS Phyn App from the App Store, that is an indication that you need to update the payment method associated with your Apple ID.
Fixing payment issues with Apple Pay can be achieved by simply restarting the phone, re-adding the card, signing out of your accounts, and then signing back in as well as making a test transfer to ensure you're up to date with any terms of service changes.
To decrypt the token, import the . pem files and create a new PaymentToken with the token from Apple Pay. Then decrypt using the keys. You can then use those decrypted values with your payment processor of choice (Stripe, Braintree, et al) to process payments from Apple Pay.
Finally got a token. I needed to enable 3DS as a payment processing capability:
request.merchantCapabilities = PKMerchantCapabilityEMV | PKMerchantCapability3DS;
That's what I get for copypasting someone else's code (http://goo.gl/uvkl8F). Strange because 3DS is 'required' according to the docs:
You must support 3DS; support of EMV is optional.
Why I have to explicitly state 3DS is supported by the merchant when it's required is beyond me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With