Adyen / adyen-react-native

Adyen React Native
https://docs.adyen.com/checkout
MIT License
42 stars 32 forks source link

AdyenAction: Cancel button on the loading bottom sheet after closing PayPal is not working #452

Open RyanLinXiang opened 1 month ago

RyanLinXiang commented 1 month ago

Describe the bug Related to #295 : When I use AdyenAction.handle to handle PayPal payments, everything works well so far, except when I want to close the in-app browser. When I close, the "A payment process is still active" with a loading spinner is still opened. When I click on "cancel", it has no effect.

Instead when I tap on "cancel", I got this error:

Possible Unhandled Promise Rejection (id: 2):
Error: Payment canceled by shopper
Error: Payment canceled by shopper

Any solutions?

descorp commented 1 month ago

Hey @RyanLinXiang

Do you wrap AdyenAction.handle in try/catch?

try {
    const data = await AdyenAction.handle(action, configuration);
    result = await ApiClient.paymentDetails(data);
    AdyenAction.hide(true);
    // continue flow
} catch (e) {
  AdyenAction.hide(false);
  // show error
}
descorp commented 2 weeks ago

Hey @RyanLinXiang

Any luck?