Как интегрировать мобильное приложение PhoneGap с ApplePay и Stripe [закрыто]


Можно ли добавить ApplePay в приложение iOS PhoneGap с помощью Stripe?

1 2

1 ответ:

Вот фрагмент кода для него. Вызов этого метода вызовет controllersheet apple pay

-(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] initWithObjects:PKPaymentNetworkAmex, 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) {

    }


}