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/,但這不適用於我的情況。它始終給我沒有價值 –