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
104 stars 50 forks source link

Reader not discovered in handoff mode on S700 Devkit #788

Open rlfrahm opened 4 weeks ago

rlfrahm commented 4 weeks ago

Describe the bug

The following versions cause discoverReaders to never return a reader to connect to:

implementation("com.stripe:stripeterminal-core:3.8.0")
implementation("com.stripe:stripeterminal-handoffclient:3.8.0")

While 3.7.0 seems to work fine:

implementation("com.stripe:stripeterminal-core:3.7.0")
implementation("com.stripe:stripeterminal-handoffclient:3.7.0")

I also have this problem while using 0.0.1-beta.20 of this package:

...
"@stripe/stripe-terminal-react-native": "0.0.1-beta.20"
...

While 0.0.1-beta.19 works fine.

I'm using this issue as reference for how to setup handoff mode.

To Reproduce Steps to reproduce the behavior:

  1. Install 0.0.1-beta.20 and build example-app
  2. Deploy example-app through Stripe on physical S700 Devkit
  3. Try to discover readers in handoff discovery mode
  4. No readers discovered

Expected behavior It should discover readers in the latest version.

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

Stripe Terminal React Native SDK version

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

rlfrahm commented 4 weeks ago

Updated my original description to change the Android package versions to 3.7.0 as that is the latest version that I can get to work.

thelight413 commented 4 weeks ago

I having this issue even using a bluetooth reader.

rlfrahm commented 4 weeks ago

@thelight413 are you using an S700 device or something else?

thelight413 commented 4 weeks ago

I'm using my android phone and an android tablet. I was also having issues connecting to the reader even if it was discovered. But only on a fresh install, not when I restart the app.

rlfrahm commented 4 weeks ago

Make sure that your connection token is not cached from your api. The provider makes several calls for a connection token and they all have to be new tokens. I was having a similar issue and that was the cause.I also cannot use beta20 of this package as the reader will not be discovered when on a physical device and not in simulated mode.

thelight413 commented 3 weeks ago

@rlfrahm I even recreated the issue on the example app. I am using render as a backend.

rlfrahm commented 3 weeks ago

I had the same intermittent troubles when getting started. It wasn't until I reached out to Stripe on their Discord that it finally started working at least partially. I'd recommend opening a ticket there: https://discord.com/invite/stripe

thelight413 commented 3 weeks ago

@rlfrahm for your issue, did you wait till the sdk initialized?

sunday-bernard-notarianni commented 1 week ago

Hello, I have a similar issue using the Java/Kotlin SDK.

I get the following error message with the android sample app:

discoveryCallback onFailure
com.stripe.stripeterminal.external.models.TerminalException: RPC application error INVALID_REQUEST with message Invalid device_type: must be one of bbpos_wisepad3, stripe_m2, stripe_s700, bbpos_chipper2x, bbpos_wisepos_e, verifone_P400, simulated_wisepos_e, or mobile_phone_reader
    at com.stripe.stripeterminal.handoffclient.HandoffAidlRpcListener.onComplete(HandoffAidlRpcListener.kt:48)
    at com.stripe.core.aidlrpc.AidlRpcListener$Stub.onTransact(AidlRpcListener.java:74)
    at android.os.Binder.execTransactInternal(Binder.java:1021)
    at android.os.Binder.execTransact(Binder.java:994)

The error message seems to suggest that stripe_s700 are accepted for Handoff dicovery, but maybe not stripe_s700_devkit ?

rlfrahm commented 1 week ago

@rlfrahm for your issue, did you wait till the sdk initialized?

Yes

rlfrahm commented 1 week ago

Hello, I have a similar issue using the Java/Kotlin SDK.

I get the following error message with the android sample app:

discoveryCallback onFailure
com.stripe.stripeterminal.external.models.TerminalException: RPC application error INVALID_REQUEST with message Invalid device_type: must be one of bbpos_wisepad3, stripe_m2, stripe_s700, bbpos_chipper2x, bbpos_wisepos_e, verifone_P400, simulated_wisepos_e, or mobile_phone_reader
    at com.stripe.stripeterminal.handoffclient.HandoffAidlRpcListener.onComplete(HandoffAidlRpcListener.kt:48)
    at com.stripe.core.aidlrpc.AidlRpcListener$Stub.onTransact(AidlRpcListener.java:74)
    at android.os.Binder.execTransactInternal(Binder.java:1021)
    at android.os.Binder.execTransact(Binder.java:994)

The error message seems to suggest that stripe_s700 are accepted for Handoff dicovery, but maybe not stripe_s700_devkit ?

I've confirmed that with Stripe staff that the S700 devices should be in handoff mode and it's working for me now after downgrading versions. Are you by chance using production api keys or something? DevKit's only work in test mode.