3
我得到PK付款认证视图控制器实例返回为零。这段代码有什么问题?苹果支付PKPaymentauthorizationViewController总是返回零时加载付款请求
if([PKPaymentAuthorizationViewController canMakePayments])
{
if ([PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:@[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa]])
{
PKPaymentRequest *request = [[PKPaymentRequest alloc] init];
request.currencyCode = @"USD";
request.countryCode = @"US";
request.merchantCapabilities = 0;
request.requiredBillingAddressFields=PKAddressFieldAll;
request.merchantIdentifier = @"merchant.com.domain.mine";
PKPaymentSummaryItem *item = [[PKPaymentSummaryItem alloc] init];
[email protected]"Merchant";
item.amount=[NSDecimalNumber decimalNumberWithString:@"10"];
[email protected][item];
PKPaymentAuthorizationViewController *viewController = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:request];
viewController.delegate = self;
[self presentViewController:viewController animated:YES completion:nil];
}
}
谢谢pradeep。现在该设备配置得很好,我们在日常生活中使用它。 canMakePayment返回True。 – Itzdsp
谢谢,这很有帮助。 –
我尝试使用Sanbox测试仪,详细信息请参阅https://developer.apple.com/support/apple-pay-sandbox/,但这不适用于我的情况。它始终给我没有价值 –