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, self.braintree
and tried BT's both ways of integration.
BTPaymentProvider - Our abstraction on payment method creation.
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"]]]; } [self.provider createPaymentMethod:BTPaymentProviderTypeApplePay]; }
but its not pushing "
PKPaymentAuthorizationViewController
". No exception too to track it down.PassKit - Apple's ApplePay APIs.
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]; } }
This gives "vc" is
nil
.
Correct me, if it's wrong. How do I test it on a real device?