Open dentep opened 1 year ago
I wish I could get this far. Even using your code I am stuck at null is not an object (evaluating 'ReactNativePayments.createPaymentRequest')
. I know this is a week later, but if you see this do you have anything that you remember that would have caused this issue.
[Error: AbortError] on simulator iphone 14 for merchantIdentifier: 'merchant.apple.test',
ApplepayAPi() { const METHOD_DATA = [ { supportedMethods: ['apple-pay'], data: { merchantIdentifier: 'merchant.apple.test', supportedNetworks: ['visa'], countryCode: 'US', currencyCode: 'USD', }, }, ]; const DETAILS = { id: 'example', displayItems: [ { label: 'Movie Ticket', amount: {currency: 'USD', value: '15.00'}, }, ], total: { label: 'Merchant Name', amount: {currency: 'USD', value: '15.00'}, }, }; const OPTIONS = { requestPayerName: false, requestPayerPhone: false, requestPayerEmail: false, requestShipping: false, }; let paymentRequest = new PaymentRequest(METHOD_DATA, DETAILS, OPTIONS);
paymentRequest.addEventListener('shippingaddresschange', e => {
const updatedDetails = getUpdatedDetailsForShippingAddress(
paymentRequest.shippingAddress,
);
e.updateWith(updatedDetails);
});
paymentRequest.addEventListener('shippingoptionchange', e => {
const updatedDetails = getUpdatedDetailsForShippingOption(
paymentRequest.shippingOption,
);
e.updateWith(updatedDetails);
});
paymentRequest
.canMakePayments()
.then(canMakePayment => {
if (canMakePayment) {
console.log('Can Make Payment');
paymentRequest
.show()
.then(paymentResponse => {
// Your payment processing code goes here
paymentResponse.complete('success');
Alert.alert('Payment Complete');
})
.catch(error => {
console.log('Show Error', error);
});
} else {
console.log('Cant Make Payment');
}
})
.catch(error => {
console.log('Can Make Payments Error', error);
});
}
I am facing the same error i- e [Error: AbortError]
Did anyone find any solution?
Hi! Our team is also getting a similar issue where the app crashes when using apple pay. Does anyone have any idea of why this might be happening? Did something change lately with this package that might be causing problems interacting with ApplePay?
Hello everyone. I am trying to follow a demo and setup Apple Pay on ios. I have configured merchantID and the library works well with a simulator. Unfortunately when I launch the app on a real device I get following error:
Code for running the function: