Open murrple-1 opened 4 years ago
That's Weird.Let me check...
Hi @murrple-1 , It works as expected,
(async () => {
try{
let response = await AdyenPayment.startPaymentPromise(AdyenPayment.SCHEME,componentData,paymentDetails)
console.log(response);
}catch(err){
console.log("Error Code : ",err.code);
console.log("Error Message ",err.message);
}
})();
The only difference is you get the error object as
{code : "ERROR_CANCELLED", "message": "Transaction Cancelled"}
A Quick check - Did you remove the listener when switched testing to Promise way of catching the error ?
Further testing incoming
During testing around the behaviour noted in #8, I noted unexpected behaviour on iOS.
When calling
startPayment()
withonError
set, cancelling the payment by pressingCancel
calls the listener withcode = "ERROR_CANCELLED"
anderror = "Transaction Cancelled"
.However, calling
startPaymentPromise()
in this way:does not cause the catch block to be run. This is unexpected, as I would expect
console.log('Error', e)
to output something like: