react-native-payments
react-native-payments copied to clipboard
iOS: undefined paymentToken on real device.
Hi! May be I am doing something wrong, but I am really confused. I am trying to test Apple Pay on real device in release iOS build (through XCode Run), but got undefined paymentToken.
We set up ApplePay as it described in the Apple docs, got merchantId.
Here is the code:
const METHOD_DATA = [{
supportedMethods: ['apple-pay'],
data: {
merchantIdentifier: MERCHANT_ID, // (not .test, real),
supportedNetworks: ['visa', 'mastercard'],
countryCode: 'RU',
currencyCode: 'RUB',
},
}];
request ({ amount }) {
const paymentRequest = new PaymentRequest(METHOD_DATA, {
total: {
label: 'Магазинчик',
amount: {
currency: 'RUB',
value: String(amount),
},
},
});
return paymentRequest.show()
.then((paymentResponse) => {
setTimeout(() => {
paymentResponse.complete('success');
});
return paymentResponse.details.paymentToken;
})
.catch(() => {});
},
Everything works fine: appears ApplePay confirmation dialog, but after confirming by touchId, paymentToken is undefined. Thanks!
Facing the same problem. I will devote some time to trying to trace the ~~Swift~~ Obj-C code in the library.
same issue here did you solve this problem ?