adyen-react-native icon indicating copy to clipboard operation
adyen-react-native copied to clipboard

Fire a callback when payment canceled by shopper

Open iszhuravlev opened this issue 3 years ago • 11 comments

Is your feature request related to a problem? Please describe. We'd like to use Klarna as one of the payment methods in the dropIn. The steps leading to the problem are:

  1. I open the dropIn
  2. I press klarna option -> The in-app browser is opened
  3. I press "Cancel" on the top-left corner -> the browser is closed

So my question is: is it possible to react somehow on this last event? We'd like to perform certain actions when user manually closes the browser.

I tried to subscribe to focus/blur event of react-navigation, but surprisingly it didn't work as well.

Describe the solution you'd like Maybe having a callback passed to AdyenCheckout to handle browser being closed.

Describe alternatives you've considered Or having onFail called. Or maybe I'm missing something. If that's so, please tell me, I'd appreciate any feedback.

SS screenshot

iszhuravlev avatar Dec 30 '22 13:12 iszhuravlev

Hey @iszhuravlev

Thank you for a feedback! This is possible on iOS DropIn but not on Android DropIn

We will check with Android Team and will keep you posted!

As a temporary workaround you can use standalone klarna, in this case when shopper cancel the payment - you will receive didFail with "canceledByShopper"

descorp avatar Dec 30 '22 16:12 descorp

@descorp I patched the library and it worked, thank you! Looking forward for the news about Android :)

iszhuravlev avatar Jan 05 '23 10:01 iszhuravlev

@descorp Do you have any updates for this?

iszhuravlev avatar Jan 11 '23 16:01 iszhuravlev

Hey @iszhuravlev

Thanks for checking! Callbacks for Android are on our backlog but there is no expected timeline. As a suggestion, your backend can implement Notification webhooks to control the payment state. Use merchantReference as a unique ID. If you have issues with this - please reach out to the support team

descorp avatar Jan 12 '23 23:01 descorp

In the latest v2 redirects we introduced "gatekeeper" dialog to verify shopper canceling the transaction.

rn_image_picker_lib_temp_7c6bdc9b-f361-4cac-8003-2ce9863d650d

descorp avatar May 03 '24 16:05 descorp

@iszhuravlev How did you fix this issue?

anthlasserre avatar Aug 30 '24 16:08 anthlasserre

Hey @anthlasserre

the callback mentioned above is not yet part of React Native SKD. What issue are you facing?

descorp avatar Sep 02 '24 09:09 descorp

@descorp It would be useful to know when payment process is canceled by the user so editing of order products quantities or any other order info could be enabled again in the form...

fdobre avatar Oct 17 '24 12:10 fdobre

@iszhuravlev How does the android patch look like? Can you help with sharing it or opening a PR?

fdobre avatar Oct 17 '24 12:10 fdobre