Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Payment not completed" with Apple Pay - can't get token

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:

enter image description here

like image 618
ccwasden Avatar asked Oct 24 '14 17:10

ccwasden


People also ask

Why does my Apple Pay says payment not complete?

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.

How do you fix Apple Pay not completed on iPhone?

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.

How do I decrypt Apple Pay token?

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.


1 Answers

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.

like image 183
ccwasden Avatar answered Oct 01 '22 05:10

ccwasden