已结束。此问题不符合
Stack Overflow guidelines .它目前不接受答案。
Best Answer-推荐答案 strong>
这是它的代码片段。调用这个方法会调用apple pay的controllersheet
-(void)handlesApplePay
{
@try {
PKPaymentSummaryItem *paymentSummary = [PKPaymentSummaryItem summaryItemWithLabel"Credit Card" amount:[NSDecimalNumber decimalNumberWithString"20.00"]];
NSArray *summaryItem = [[NSArray alloc] initWithObjects:paymentSummary, nil];
//Creates the type of credit card it wil support
NSArray *supportPaymentType = [[NSArray alloc] initWithObjectsKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa, nil];
PKPaymentRequest *paymentRequest = [[PKPaymentRequest alloc]init];
//This is the merchant id you create from the provisioing profile page
//developer.apple.com
paymentRequest.merchantIdentifier = @"merchant.com.ApplePay";
paymentRequest.paymentSummaryItems = summaryItem;
paymentRequest.countryCode = @"EN";
paymentRequest.currencyCode = @"USD";
paymentRequest.supportedNetworks = supportPaymentType;
paymentRequest.merchantCapabilities = PKMerchantCapabilityEMV;
PKPaymentAuthorizationViewController *paymentAuthController = [[PKPaymentAuthorizationViewController alloc]initWithPaymentRequest:paymentRequest];
paymentAuthController.delegate = self;
[self presentViewController:paymentAuthController animated:YES completion:nil];
}
@catch (NSException *exception) {
}
}
关于ios - 如何将 PhoneGap 移动应用与 ApplePay 和 Stripe 集成,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/26200683/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) |
Powered by Discuz! X3.4 |