eventOneHQ / capacitor-stripe-terminal

💳 Capacitor plugin for Stripe Terminal (credit card readers)
https://oss.eventone.page/capacitor-stripe-terminal/
MIT License
30 stars 20 forks source link

Can not discover the reader Wisepad 3 BT #84

Closed iborschca closed 2 years ago

iborschca commented 2 years ago

I am using iOS to discover devices. BT permissions are allowed. Simulator works perfect but not a real terminal. The terminal is turned on in the discovery mode (BT icon is blinking). Log from the App: ⚡️ To Native -> App addListener 100936921 ⚡️ To Native -> StripeTerminal addListener 100936922 ⚡️ To Native -> StripeTerminal addListener 100936923 ⚡️ To Native -> StripeTerminal initialize 100936924 ⚡️ TO JS {} ⚡️ TO JS undefined ⚡️ To Native -> StripeTerminal setConnectionToken 100936925 ⚡️ TO JS undefined ⚡️ [log] - Debug: Start discovering readers ⚡️ To Native -> StripeTerminal addListener 100936926 ⚡️ To Native -> StripeTerminal discoverReaders 100936927

iborschca commented 2 years ago

Can provide you with all logs, details, help that I can to help you to solve the problem.

nprail commented 2 years ago

@iborschca Unfortunately, I don't have a Wisepad so I can't debug this myself.

A few questions:

  1. What capacitor-stripe-terminal version are you using?
  2. Are you holding the Wisepad fairly close to the device you are trying to connect with?
  3. What does your discovery code look like?
  4. Have you successfully connected to any other Bluetooth readers?
iborschca commented 2 years ago

Hi.

  1. capacitor-stripe-terminal v2
  2. yes it is 10 cm far from the iPad
  3. https://github.com/iborschca/i-borsch-new/blob/master/src/components/Menu.tsx#L90
  4. No. This reader is the only one I have. And the SDK version is 2.4.0 shown on the screenshot Screen Shot 2022-01-24 at 1 23 11 PM Console Output: image
iborschca commented 2 years ago

I found a fix! I replaced discoveryMethod value in the config for Terminal.shared.discoverReaders() with .bluetoothScan value and I managed to connect to the reader. Was before: image Now: image as per documentation image

nprail commented 2 years ago

@iborschca Ah yes, I believe only the Chipper 2x supports Bluetooth proximity.

Are you changing that in the native Swift code?

You can use this in JS instead:

terminal
  .discoverReaders({
    simulated: false,
    discoveryMethod: DiscoveryMethod.BluetoothScan
  })
iborschca commented 2 years ago
DiscoveryMethod.BluetoothScan

yes this works like a charm as well. Thanks a lot!

nprail commented 2 years ago

@iborschca no problem!