Adyen / adyen-react-native

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

onSubmit not called after an error (Android only) #365

Closed gunnartorfis closed 3 months ago

gunnartorfis commented 8 months ago

Describe the bug When attempting to pay using the Card Component and payments fails, when the user tries to pay for the second time with a different card details, the native spinner shows up and is infinite. None of onSubmit, onError, onAdditionalDetails is called.

This is only happening on Android, not iOS or the web for us.

To Reproduce Steps to reproduce the behavior:

  1. Pay with a card that leads to a payment failure
  2. Try to pay again with a different card
  3. Observe the infinite spinning state

Expected behavior We should also get an error or a success after the second attempt.

Smartphone (please complete the following information): Device: Pixel Emulator OS: Android Version 32.1.14.0

gunnartorfis commented 8 months ago

This only seems to be an issue on a Debug build. I just built a Release variant and I'm unable to reproduce it there 🤔

descorp commented 7 months ago

Hey @gunnartorfis

Sometimes I see that breakpoints are interfering RN UI thread on Android. Could this be the case?

MisterMaroki commented 7 months ago

following.

Experiencing this on Android and iOS, after payment fail, calling component.hide(false,{message}). Observing infinite spinner after 2nd submit. onSubmit only called once for the first try but never called on second try.

Expo 49 "expo": "~49.0.6",

Adyen/react-native 2.0.0-beta-2 "@adyen/react-native": "^2.0.0-beta.2",

descorp commented 7 months ago

Hey @MisterMaroki

Are you using Sessions or Advanced flow ?

I see what could be a problem .. Could you try to recreate AdyenCheckout(ex. navigate back to cart page)?

MisterMaroki commented 7 months ago

Hey @MisterMaroki

Are you using Sessions or Advanced flow ?

I see what could be a problem .. Could you try to recreate AdyenCheckout(ex. navigate back to cart page)?

I am using advanced flow, event based. Using the start(‘drop-in’) method

MisterMaroki commented 7 months ago

I solved it by using expo router to dismount and remount the screen as luckily the payment is made on a simple standalone screen.

it’s a hack solution but if anyone else faces this you’ll have to remount to screen and call the start(‘drop in’) func in a setTimeout with 200ms wait.

Waiting on a real solution

descorp commented 3 months ago

I'll close this ticket for now. Feel free to leave feedback and continue the discussion here.