Cordova中带有条纹的Apple支付付款未完成

问题描述 投票:0回答:1

这是我的代码,我收到的错误付款未完成。我在Condova中使用带条纹的Apple Pay。

我已经使用了两个插件,但给了我错误。还请说明如何获得条纹令牌。

[ApplePay.makePaymentRequest($ scope.order).then((paymentResponse)传递$ scope没获得paymentResponse

      ApplePay.canMakePayments({
    // supportedNetworks should not be an empty array. The supported networks currently are: amex, discover, masterCard, visa
    supportedNetworks: ['visa', 'amex', 'masterCard', 'discover'],
    // when merchantCapabilities is passed in, supportedNetworks must also be provided. Valid values: 3ds, debit, credit, emv
    merchantCapabilities: ['3DS', 'debit', 'credit', 'emv']
    }).then((message) => {
    alert(message);
    $scope.order = {};
    $scope.order.items = [{
    label: 'Subscription Charge',
    amount: 1.00
    }];
    $scope.order.shippingMethods = [
    {
    "label": "Free Shipping",
    "detail": "Subscription plan",
    "amount": "0.00",
    "identifier": "FreeShip"
    }
    ];
    $scope.order.supportedNetworks = ['visa', 'masterCard','discover'];
    $scope.order.merchantCapabilities = ['3DS', 'debit', 'credit'];
    $scope.order.merchantIdentifier = "merchant.com.appguys.foodroamer";
    $scope.order.currencyCode = 'USD';
    $scope.order.countryCode = 'US';
    $scope.order.billingAddressRequirement = 'none';
    $scope.order.shippingAddressRequirement = 'none';
    $scope.order.shippingType = 'service';
    ApplePay.makePaymentRequest($scope.order).then((paymentResponse) => {
    alert(JSON.stringify(paymentResponse));
    alert("Token Here",paymentResponse.paymentData);
    httpService.userPost($scope.base_url+'domakeTestPayment',{'token':paymentResponse.paymentData}).then(function(paymentResponse){
    alert(JSON.stringify(paymentResponse));
    });
    }).catch((e) => {
    alert(4);
    alert(e);
    // Failed to open the Apple Pay sheet, or the user cancelled the payment.
    })
    }).catch((message) => {
    alert(2);
    alert(message);
    console.log(message);
    // There is an issue, examine the message to see the details, will be:
    // 'This device cannot make payments.''
    // 'This device can make payments but has no supported cards'
    }); 

    <plugin name="cordova-plugin-stripe-apple-pay" spec="https://github.com/asangadev/cordova-plugin-stripe-apple-pay">
    <variable name="STRIPE_LIVE_PUBLISHABLE_KEY" value="xxxxxxxxxxx" />
    <variable name="STRIPE_TEST_PUBLISHABLE_KEY" value="xxxxxxxx" />
    <variable name="APPLE_MERCHANT_IDENTIFIER" value="xxxxxxxxxxx" />
    </plugin>
cordova stripe-payments phonegap-plugins phonegap applepay
1个回答
0
投票

我用Braintree代替了条纹。并记住,我也将Apple ID和沙箱中的国家/地区也更改为美国]

© www.soinside.com 2019 - 2024. All rights reserved.