stripe / stripe-terminal-react-native

React Native SDK for Stripe Terminal
https://stripe.com/docs/terminal/payments/setup-integration?terminal-sdk-platform=react-native
MIT License
110 stars 50 forks source link

collectPaymentMethod hangs forever and future calls to it fail with time out error - calling `disconnectReader` after this also hangs forever #664

Open Noitidart opened 6 months ago

Noitidart commented 6 months ago

Describe the bug I'm on Android using M2 reader.

Rarely, maybe once a day or two days, I notice that when I call collectPaymentMethod it hangs indeterminately, I have tried up to 5min. If I then call cancelCollectPaymentMethod, collectPaymentMethod resolves with this response:

{
  error: {
    code: USER_ERROR.CARD_READ_TIMED_OUT,
    message: Transaction timed out.
  }
}

Sometimes the onDidRequestReaderInput fires with {"input": ["swipeCard", "insertCard", "tapCard"]} but putting card or phone to reader is not taking tap, and neither does insert card work.

If I try to call disconnect to disconnect the current reader, the disconnectReader call also hangs indefinitely.

Does anyone have any hints on what can be happening?

To Reproduce

I'm not sure how to reproduce, I just leave my app and terminal on forever and eventually this happens.

Expected behavior collectPaymentMethod should not hang. And if it does return USER_ERROR.CARD_READER_TIMED_OUT, future calls to collectPaymentMethod should work.

Screenshots If applicable, add screenshots to help explain your problem.

Stripe Terminal React Native SDK version

"@stripe/stripe-terminal-react-native": "^0.0.1-beta.14",
"react-native": "0.72.4",
"expo": "~49.0.11",

Smartphone (please complete the following information):

Additional context I'm using M2 readers.

I have spent 4 days on this, I'm sorry I don't have additional context. It's very odd. I have tried extensive logging but can't find any hints.

Noitidart commented 6 months ago

I added a test, where instead of server side, I createPaymentIntent on client, and this also hangs.

nazli-stripe commented 4 months ago

hey @Noitidart are you still running into this issue on the latest SDK?

Noitidart commented 4 months ago

Thanks Nazli, I haven't upgraded yet, I'm not yet sure if it is due to the Stripe library. I'm on version beta.14 do you think I should try updating? Was there changes that could affect this?

Noitidart commented 4 months ago

@lemaire31 do you think this problem is fixed in v0.0.1-beta.19?

nazli-stripe commented 2 months ago

@Noitidart in general we recommend testing things with the latest SDK version to pick up the latest native SDK upgrades. If you are still running into this issue and if you can provide device serial numbers I can check our logs.

Is this issue happening on a specific device, or across all devices?

Noitidart commented 2 months ago

Thanks @nazli-stripe - it's happening across all devices. All MPOS and also BBPOS. I will do a native upgrade and test and let you know please. Will need some time please, maybe 2 months.

lemaire31 commented 2 months ago

@lemaire31 do you think this problem is fixed in v0.0.1-beta.19?

I am no longer experiencing this

Noitidart commented 2 months ago

Thanks @lemaire31 - were you experiencing this in beta14? Did you stop experiencing this after upgrading to a certain version?