stripe icon indicating copy to clipboard operation
stripe copied to clipboard

StripeTerminal.discoverReaders is returning -1 on Android

Open kyleabens opened this issue 1 month ago • 2 comments

Platform

  • [ ] Web
  • [ ] iOS
  • [x] Android

Describe the bug I upgraded capacitor from 6 to 7 and then upgraded @capacitor-community/stripe-terminal to 7.2.1 and also added:

stripeterminalCoreVersion = '4.5.0' stripeterminalTapToPayVersion = '4.5.0'

to variables.gradle. I have followed all the steps and everything works great on the browser, and iOS but Android always returns -1 when using StripeTerminal.discoverReaders. I have no idea why this is happening and I'm at a loss.

Expected behavior It should discover readers and not simply return -1

Using Function:

  • [ ] Payment Sheet / Payment Flow
  • [ ] Apple Pay
  • [ ] Google Pay
  • [ ] Identity (@capacitor-community/stripe-identity)
  • [x] Terminal(@capacitor-community/stripe-terminal)

kyleabens avatar Dec 02 '25 15:12 kyleabens

To add some more context here the issue is that this

const res = await StripeTerminal.discoverReaders({
      type: TerminalConnectTypes.Bluetooth,
      locationId: this.account.integrations.stripe.locationId
})

returns a res.readers on iOS and browser but on Android res returns -1 instantly every time. The only way I can get the readers array returned on Android is with

await StripeTerminal.addListener(
     TerminalEventsEnum.DiscoveredReaders,
     async ({ readers }) => console.log(readers)

But even then it's hit or miss on Android.

kyleabens avatar Dec 02 '25 20:12 kyleabens

@kyleabens Thanks for checking — from what I can see, it works correctly in the demo environment 👍

Have you checked Android Logcat? There might be some hints there that could help identify what’s going wrong. If you find any clear cause or suspicious logs, please share them here and we can try to solve it together.

rdlabo avatar Dec 15 '25 03:12 rdlabo