I am developing an app using Apple Pay for a US Client from outside the US. I am using Braintree + Apple Pay. We support real credit cards to Passbook, but we can't verify them.
I successfully generated a client token,
if(self.braintree && ![self.braintree isKindOfClass:[NSNull class]])
self.provider = [braintree paymentProviderWithDelegate:self];
if ([self.provider canCreatePaymentMethodWithProviderType:BTPaymentProviderTypeApplePay])
self.provider.paymentSummaryItems = @[[PKPaymentSummaryItem summaryItemWithLabel:@"XXXX" amount:[NSDecimalNumber decimalNumberWithString:@"1"]]];
if([PKPaymentAuthorizationViewController canMakePayments]) // It returns TRUE
PKPaymentRequest *paymentRequest = [[PKPaymentRequest alloc] init];
paymentRequest.countryCode = @"US";
paymentRequest.currencyCode = @"USD";
paymentRequest.merchantCapabilities = PKMerchantCapabilityEMV | PKMerchantCapability3DS;
paymentRequest.merchantIdentifier = MERCHANTID;
paymentRequest.supportedNetworks = @[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa];
paymentRequest.paymentSummaryItems = @[ [PKPaymentSummaryItem summaryItemWithLabel:@"TEST" amount:[NSDecimalNumber decimalNumberWithString:@"1"]] ];
if([PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:@[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa]]) // Returns FALSE
PKPaymentAuthorizationViewController *vc = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:paymentRequest];
vc.delegate = self;
[self presentViewController:vc animated:YES completion:nil];
It's likely that your app's Apple Pay entitlement is not set up correctly.
NO when the entitlement is not set.
(I've also noticed that they can both return
YES when the merchant ID you set on your
PKPaymentRequest does not match the merchant ID of your Apple Pay entitlement. In this case, your
PKPaymentAuthorizationViewController will be non-nil, but presenting it logs a cryptic error in the console).
So to verify that Apple Pay is configured for your app, ensure that "Apple Pay" is "On" in the Capabilities section of your target settings, and that it has a merchant identifier (which you'll need to set up if you haven't already).
BTPaymentProviderintegration method, ensure that the certificate and merchant identifier are correctly set up in the Braintree control panel.
PassKitintegration method, ensure that you are setting
merchantIdentifierproperty to the matching merchant identifier in the entitlement.