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
95 stars 47 forks source link

[Tap To Pay] Reader has been disconnected unexpectedly on Android devices #693

Open ThanJack opened 2 months ago

ThanJack commented 2 months ago

Describe the bug After putting the Android app in the background for some time, then reopening the app to do the first Tap to Pay transaction causes the following issue happens:

[Stripe terminal]: didReportUnexpectedReaderDisconnect { message: 'Reader has been disconnected unexpectedly',
  code: 'UNEXPECTED_ERROR.UNEXPECTED_SDK_ERROR' }

It happened after after creating the Payment Intent by the createPaymentIntent function and before the collectingPaymentMethod function executes. Then the collectingPaymentMethod function throws this error, which causes the transaction to fail:

{ code: 'INTEGRATION_ERROR.NOT_CONNECTED_TO_READER',
  message: 'LocalMobile reader is not connected' }

To Reproduce Steps to reproduce the behavior:

  1. Put app to the background for a while (eg. more than 2 hours).
  2. Reopen the app, start the first transaction.
  3. Tap To Pay screen appears, try to tap a card.
  4. The issue above happens.

Expected behavior

The Reader should not be disconnected unexpectedly when doing the transaction.

Stripe Terminal React Native SDK version

Smartphone (please complete the following information):

tzecheng commented 2 months ago

Hi, It also happens on a Pixel 4, running Android 13. Note that the error is random. We left the app in the background over multiple periods, sometimes the payment works on re-opening the app, sometimes the above error happens.

nazli-stripe commented 2 months ago

@tzecheng and @ThanJack can you share account and serial numbers so we can investigate?

tzecheng commented 2 months ago

Hi @nazli-stripe , I can't find the account and serial numbers when the payment is cancelled.

The latest has id: pi_3PF7CwEcr8OExvfT1zxs98vO

Attached bugfender screen shot android cancelled 4.pdf

Hope that helps. Thanks.

KillianLarcher commented 1 month ago

It also happens on a Pixel 4, running Android 13. Note that the error is random. We left the app in the background over multiple periods, sometimes the payment works on re-opening the app, sometimes the above error happens.

Same problem here on Samsung Tab Active 3, running Android 13.

nazli-stripe commented 1 month ago

This appears to be a potential issue with our native Android SDK, we are investigating internally. Will update this ticket with new information

tzecheng commented 1 month ago

Hi @nazli-stripe ,

This is one of the latest instances where there is a serial number it it helps: serialNumber: '7808ed1a-4ea0-4f73-9c83-5a7bc28a04f4'

tzecheng commented 1 month ago

Here's another serial number: serialNumber: 'b7c812c4-0237-4b3b-9366-cc9318004df0'

KillianLarcher commented 1 month ago

Any news? @nazli-stripe

tzecheng commented 1 week ago

Hello, @nazli-stripe , Any progress on this?

tzecheng commented 6 days ago

Hi there, Here's is a screenshot of latest failure, Serial number: 6b16a116-d082-4568-af55-34e1104bdf3a

Android bg failure