苹果在科尔多瓦的条纹支付没有完成



这是我的代码,我收到了未完成的错误付款。我在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>

我用了Braintree而不是stripe。请记住,我还在Apple id中将国家更改为美国,在沙箱中也更改为美国

最新更新