I have two problems, 1) first of all when I've started application and tap on ApplePay button I have an exception without additional information, what did I do wrong?
2) Second, in a delegate method
paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didAuthorizePayment:(PKPayment *)payment
completion:(void (^)(PKPaymentAuthorizationStatus))completion
for some reason payment.token.paymentData == nil and I don't understand why. What I did: activate ApplePay in a target, added certificate in Apple Developer Account, and create object like this:
- (PKPaymentRequest *)paymentRequest
{
PKPaymentRequest *paymentRequest = [[PKPaymentRequest alloc] init];
paymentRequest.merchantIdentifier = @"xxx.xxx.xxx.xxx";
paymentRequest.supportedNetworks = @[PKPaymentNetworkVisa, PKPaymentNetworkMasterCard];
paymentRequest.merchantCapabilities = PKMerchantCapability3DS;
paymentRequest.countryCode = @"RU";
paymentRequest.currencyCode = @"RUB";
paymentRequest.paymentSummaryItems =
@[
[PKPaymentSummaryItem summaryItemWithLabel:@"Ticket" amount:[NSDecimalNumber decimalNumberWithString:@"2000"]]
];
return paymentRequest;
}