【发布时间】:2020-11-04 17:54:54
【问题描述】:
希望有人可以帮助使用 react-native-payments-alive。
我有以下代码
import {PaymentRequest} from 'react-native-payments-alive';
const METHOD_DATA = [{
supportedMethods: ['apple-pay'],
data: {
merchantIdentifier: 'merchant.uat.com',
supportedNetworks: ['visa', 'mastercard'],
countryCode: 'USA',
currencyCode: 'USD'
}
}];
const DETAILS = {
id: 'simple-basket',
displayItems: [
{amount: "369.00", label: "Product 1 "},
{amount: "10.00", label: "Shipping"}
],
total: {
label: 'Grand Total',
amount: {currency: 'USD', value: '379.00'}
}
};
const paymentRequest = new PaymentRequest(METHOD_DATA, DETAILS);
paymentRequest.show()
.then(paymentResponse => {
console.log('paymentResponse ', paymentResponse)
paymentResponse.complete('success');
}).catch((error) => console.log(error));
我不断收到此错误
未能构造“PaymentRequest”:所需的成员值未定义。
任何帮助表示赞赏?
【问题讨论】:
标签: react-native applepay