Skip to content

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

@Noitidart

Description

@Noitidart

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):

  • Device: Rockchip Android Touchscreen
  • OS: Android 12
  • androidPlatformApiLevel is 32

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions