#demodian_api
1 messages Β· Page 1 of 1 (latest)
π Welcome to your new thread!
β²οΈ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
β±οΈ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
π This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1395105646130761839
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, I'm getting help from a teammate who has more expertise with Stripe Terminal + React Native
ok
Hi there
hi
Both actions should be quite quick assuming there isn't a networking issue.
it just seems to take forever though
and once I start discoverReaders(), it sometimes repeats on its own without me triggering it
Can you share your relevant code?
Are you doing something within onDidReportUnexpectedReaderDisconnect?
Can I see your code please? And can you answer my previous questions?
moment as i'm trying to package stuff up
Sure, just include the relevant pieces though please.
there's really only 3 files that are relevant so far for using the Terminal SDK
for the terminal provider
the second layer, to get certain events caught
the screen I am dealing with discovery and connecting initially
the last one is kinda disorganized as I am still actively working on that screen trying to test
yes, to the M2
the phone is tethered to my laptop for debugging, so I have to use bluetooth for now
as far as the connection, it doesn't connect, but it doesn't timeout either
What about discoverReaders() -- that seems like it runs per your logs
it sometimes doesn't register the reader and sits there, so i might have to try waking up the reader (i think), but if I do nothing, i keep getting discovery information even after the list is returned
Okay let's start by just commenting out your onDidDiscoverFinish(readers); within onUpdateDiscoveredReaders() and just calling:
const { reader, error } = await connectReader(
{
reader: readers[0],
locationId: '{{LOCATION_ID}}',
},
'bluetoothScan'
);
if (error) {
console.log('connectReader error', error);
return;
}
console.log('Reader connected successfully', reader);
There with your necessary location ID
Also let's comment out your onFinishDiscoveringReaders() code for now too
StripeTerminal has been initialized properly
LOG calling
LOG calling get_all_readers
LOG prior to call
LOG [Stripe terminal]: didUpdateDiscoveredReaders [{"availableUpdate": null, "baseUrl": null, "batteryLevel": null, "bootloaderVersion": null, "configVersion": null, "deviceSoftwareVersion": "unknown", "deviceType": "stripeM2", "emvKeyProfileId": null, "firmwareVersion": null, "hardwareVersion": "unknown", "id": null, "ipAddress": null, "label": null, "location": {"address": [Object], "displayName": "POS1", "id": "tml_E6lpbwVXIHvD0n", "livemode": false}, "locationId": "tml_E6lpbwVXIHvD0n", "locationStatus": "set", "macKeyProfileId": null, "pinKeyProfileId": null, "pinKeysetId": null, "serialNumber": "STRM26214062291", "settingsVersion": null, "simulated": false, "status": "unknown", "trackKeyProfileId": null}]
LOG Discover Readers update
LOG results [undefined, undefined]
LOG [Stripe terminal]: didFinishDiscoveringReaders {}
LOG Discover readers finished
LOG called callback []
LOG connectReader error {"code": "READER_ERROR.BLUETOOTH_DISCONNECTED", "message": "Bluetooth unexpectedly disconnected during operation."}
Okay cool so at least there is an error
Now why would that happen π€
Hrmmm https://github.com/stripe/stripe-terminal-react-native/issues/888 is similar
you got me. the m2 is like 6 inches from the phone, and battery is showing like 3 lit LEDs
The answer was oddly that I needed to connect my M2 terminal to my device via bluetooth first, then the stripe terminal sdk will connect. This isn't what the docs say, but at least it works now.
Are you doing that?
pre-pairing the m2 with the phone?
Yeah, I assume you are but worth the check.
the documentation says not to... -_-
moment. testing... and waiting...
LOG [Stripe terminal]: didChangeOfflineStatus {"reader": {}, "sdk": {"networkStatus": "unknown", "offlinePaymentAmountsByCurrency": {}, "offlinePaymentsCount": 0}}
LOG StripeTerminal has been initialized properly
LOG [Stripe terminal]: didChangeOfflineStatus {"reader": {}, "sdk": {"networkStatus": "online", "offlinePaymentAmountsByCurrency": {}, "offlinePaymentsCount": 0}}
LOG calling
LOG calling get_all_readers
LOG prior to call
LOG [Stripe terminal]: didChangeConnectionStatus discovering
LOG connection status discovering
LOG [Stripe terminal]: didUpdateDiscoveredReaders [{"availableUpdate": null, "baseUrl": null, "batteryLevel": null, "bootloaderVersion": null, "configVersion": null, "deviceSoftwareVersion": "unknown", "deviceType": "stripeM2", "emvKeyProfileId": null, "firmwareVersion": null, "hardwareVersion": "unknown", "id": null, "ipAddress": null, "label": null, "location": {"address": [Object], "displayName": "POS1", "id": "tml_E6lpbwVXIHvD0n", "livemode": false}, "locationId": "tml_E6lpbwVXIHvD0n", "locationStatus": "set", "macKeyProfileId": null, "pinKeyProfileId": null, "pinKeysetId": null, "serialNumber": "STRM26214062291", "settingsVersion": null, "simulated": false, "status": "unknown", "trackKeyProfileId": null}]
LOG Discover Readers update
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG results [undefined, undefined]
LOG [Stripe terminal]: didFinishDiscoveringReaders {}
LOG Discover readers finished
LOG called callback []
LOG [Stripe terminal]: didChangeConnectionStatus connecting
LOG connection status connecting
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG connectReader error {"code": "READER_ERROR.BLUETOOTH_DISCONNECTED", "message": "Bluetooth unexpectedly disconnected during operation."}
okay, i had to power off the reader and turn it back on before discovery would even work (was just sitting there)
and that was pre-paired with the phone
Hmm why is your results log undefined for the readers array....
which one?
In your code after you call discoverReaders():
const { readers, error } = await discoverReaders({
discoveryMethod: getAppdata('methodid'),
simulated: false,
//timeout: 15000,
});
console.log('results', [ readers, error ]);
Ah because I don't think this returns Readers
you got me? i was just dumping what i got back
That promise only returns an error
Yeah just looking for clues
(btw, please make sure the example application is in parity with the SDK itself, because in the DiscoverReadersScreen.tsx, it is trying to call various connect<method>Reader() functions that do not get exposed by useStripeTerminal()
there's a connectBluetoothReader() that doesn't exist
Happy to pass on that feedback.
same for Internet, Handoff, etc)
This SDK is still in beta so there are certainly still some rough edges
because technically the example app will not work. all that is available is connectReader()
i know the M2 has a sleep feature, so i make sure to press the side button before I try any discovery or manual connection attempts
Okay let's do one more test to ensure we get the same error... don't connect the Reader Bluetooth Settings on your mobile device and let's comment out the onFinishDiscoveringReaders() code to avoid some of the verbosity here.
so unpair first?
Yes
done and restarting everything. force quit the app, and restarted expo
Also when you get a moment, what version of the SDK are you using here?
[Stripe terminal]: didChangeOfflineStatus {"reader": {}, "sdk": {"networkStatus": "unknown", "offlinePaymentAmountsByCurrency": {}, "offlinePaymentsCount": 0}}
LOG StripeTerminal has been initialized properly
LOG [Stripe terminal]: didChangeOfflineStatus {"reader": {}, "sdk": {"networkStatus": "online", "offlinePaymentAmountsByCurrency": {}, "offlinePaymentsCount": 0}}
LOG calling
LOG calling get_all_readers
LOG prior to call
LOG [Stripe terminal]: didChangeConnectionStatus discovering
LOG connection status discovering
LOG [Stripe terminal]: didUpdateDiscoveredReaders [{"availableUpdate": null, "baseUrl": null, "batteryLevel": null, "bootloaderVersion": null, "configVersion": null, "deviceSoftwareVersion": "unknown", "deviceType": "stripeM2", "emvKeyProfileId": null, "firmwareVersion": null, "hardwareVersion": "unknown", "id": null, "ipAddress": null, "label": null, "location": {"address": [Object], "displayName": "POS1", "id": "tml_E6lpbwVXIHvD0n", "livemode": false}, "locationId": "tml_E6lpbwVXIHvD0n", "locationStatus": "set", "macKeyProfileId": null, "pinKeyProfileId": null, "pinKeysetId": null, "serialNumber": "STRM26214062291", "settingsVersion": null, "simulated": false, "status": "unknown", "trackKeyProfileId": null}]
LOG Discover Readers update
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG results undefined
LOG [Stripe terminal]: didFinishDiscoveringReaders {}
LOG [Stripe terminal]: didChangeConnectionStatus connecting
LOG connection status connecting
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG connectReader error {"code": "READER_ERROR.BLUETOOTH_DISCONNECTED", "message": "Bluetooth unexpectedly disconnected during operation."}
"version": "0.0.1-beta.25"?
is that latest?
Okay thanks for testing again. I need to step away for a bit so I'm grabbing a colleague who will continue to help debug here.
sure
π Give me a few to take a look π
Hmm based on the SDK logs the reason for disconnection is unknown, huhh π
Let me see if there's a way to pull any other logs
sure. and I'm trying to get packaged the whole project source if need be
Is this happening on Android/iOS or both
only testing android right now. don't have access to an iOS dev environment yet
do you have another reader you could test with?
Just trying to narrow down on what could be causing this
a wisepos e
Hmm that won't be super helpful but sure, try connecting to that and see if that works?
moment. have to connect it to wifi
Is your Android Device on Android 14?
It might be related to - https://github.com/stripe/stripe-terminal-android/issues/552
It reports a similar issue
But it does say
Update: We were able to fix the issue by rebooting the M2 (long press the power button).
which isn't working for you
Yup
If you have a paperclip, you could try factory resetting the device
There is a hole on the side that should let you reset it completely
there's one on the top edge by the usb-c connector. still trying to find a paperclip
apparently factory resetting the m2 allows the app to ask to pair with it
i sure would hate to tape a paperclip on the back of each m2...
Yup that's not ideal.
Did that work though? Did the reader connect?
i think so, but i got an error on the phone screen, which is other code... moment
ahh, it was because the attempted reader wasn't set, to the handler in App failed
quick question, on the wisepos e, how do i get it past the colorful startup screen that just says Stripe. none of the buttons work except power...
That's the default screen the Reader would stay on until it receives commands from the SDK like collect payment method, show a form/input, etc
how would i pair it?
WisePOS E is a Smart Reader that connects to the Internet directly (as opposed to Bluetooth Reader like M2)
sorry. register
If you have a BBPOS WisePOS E or Stripe Reader S700, go to the reader settings and tap Generate pairing code. - yeah, how do i get to here?
You can swipe left on that home screen
ah ha. thanks
It's not intuitive π
Intentional to a certain degree
LOG [Stripe terminal]: didUpdateDiscoveredReaders [{"availableUpdate": null, "baseUrl": null, "batteryLevel": null, "bootloaderVersion": null, "configVersion": null, "deviceSoftwareVersion": "unknown", "deviceType": "stripeM2", "emvKeyProfileId": null, "firmwareVersion": null, "hardwareVersion": "unknown", "id": null, "ipAddress": null, "label": null, "location": {"address": [Object], "displayName": "POS1", "id": "tml_E6lpbwVXIHvD0n", "livemode": false}, "locationId": "tml_E6lpbwVXIHvD0n", "locationStatus": "set", "macKeyProfileId": null, "pinKeyProfileId": null, "pinKeysetId": null, "serialNumber": "STRM26214062291", "settingsVersion": null, "simulated": false, "status": "unknown", "trackKeyProfileId": null}]
LOG Discover Readers update
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG results undefined
LOG [Stripe terminal]: didFinishDiscoveringReaders {}
LOG [Stripe terminal]: didChangeConnectionStatus connecting
LOG connection status connecting
LOG [Stripe terminal]: didChangeOfflineStatus {"reader": {}, "sdk": {"networkStatus": "unknown", "offlinePaymentAmountsByCurrency": {}, "offlinePaymentsCount": 0}}
LOG [Stripe terminal]: didChangeOfflineStatus {"reader": {}, "sdk": {"networkStatus": "online", "offlinePaymentAmountsByCurrency": {}, "offlinePaymentsCount": 0}}
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG connectReader error {"code": "READER_ERROR.BLUETOOTH_DISCONNECTED", "message": "Bluetooth unexpectedly disconnected during operation."}
that was after i said yes to pair the m2
Quick question, In your bluetooth settings - how many devices do you have?
and after another factory reset
connected devices: usb (charging and debugging) and that's it
I think you're looking at something else there.
Basically, if your device is hitting a bluetooth pairing limit then you'd see the SDK fail the connection as well
weird. it only connected if i checked the allow access to contacts and something else...
call history sharing
That's odd. The SDK requires Location and Bluetooth access.
It shouldn't need contacts & call history access.
but it worked with that on. moment. resetting everything and trying again to reproduce
π
It seems like contact & call history sharing is just something the system bluetooth prompt always asks for when you connect to a BT device for the first time, it shouldn't matter if you check that box or not
(it also always shows up and we can't do anything about it)
I believe it's something like this
that time it worked without that option turned on
Android always shows that checkbox even if the bluetooth device isn't capable of actually requesting that data
But yeah okay so it seems like something else is going on with device firmware
Once you restart, how soon are you seeing the issue crop up again?
btw, on the wisepos e, when shutting down, it prompts for "Your phone will shut down." Phone? lol
trying again
The device hardware likely uses a phone's board :p
looks like it may be based on an android model
like the keyboard style
okay, it reproduced working after a factory reset
Great. Can you disconnect and try to connect again without factory resetting it?
will have to reset the app ... moment
calling get_all_readers
LOG prior to call
LOG [Stripe terminal]: didChangeConnectionStatus discovering
LOG connection status discovering
LOG [Stripe terminal]: didUpdateDiscoveredReaders [{"availableUpdate": null, "baseUrl": null, "batteryLevel": null, "bootloaderVersion": null, "configVersion": null, "deviceSoftwareVersion": "unknown", "deviceType": "stripeM2", "emvKeyProfileId": null, "firmwareVersion": null, "hardwareVersion": "unknown", "id": null, "ipAddress": null, "label": null, "location": {"address": [Object], "displayName": "POS1", "id": "tml_E6lpbwVXIHvD0n", "livemode": false}, "locationId": "tml_E6lpbwVXIHvD0n", "locationStatus": "set", "macKeyProfileId": null, "pinKeyProfileId": null, "pinKeysetId": null, "serialNumber": "STRM26214062291", "settingsVersion": null, "simulated": false, "status": "unknown", "trackKeyProfileId": null}]
LOG Discover Readers update
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG results undefined
LOG [Stripe terminal]: didFinishDiscoveringReaders {}
LOG [Stripe terminal]: didChangeConnectionStatus connecting
LOG connection status connecting
LOG [Stripe terminal]: didChangeOfflineStatus {"reader": {}, "sdk": {"networkStatus": "unknown", "offlinePaymentAmountsByCurrency": {}, "offlinePaymentsCount": 0}}
LOG [Stripe terminal]: didChangeOfflineStatus {"reader": {}, "sdk": {"networkStatus": "online", "offlinePaymentAmountsByCurrency": {}, "offlinePaymentsCount": 0}}
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG connectReader error {"code": "READER_ERROR.BLUETOOTH_DISCONNECTED", "message": "Bluetooth unexpectedly disconnected during operation."}
without a factory reset on the m2
Okay so you're able to connect to it once after the reboot and then it doesn't work?
looks it so far
Gotcha. I'm relaying this to our Terminal Product team.
We might need to convert this into a Support ticket as the fix for this may depend on some internal investigation.
I'll let you know in a bit
i let the app sit there, and then factory reset the m2 and then try reconnecting, and it works
looks like i have to make some tweaks for the secret being fetched. thought it was good for the session.. drats
now it's not wanting to work after even a factory reset
Okay looks like this is something our terminal team would need to investigate and see what's going on here.
Hello @past relic, we have sent you a direct message, please check it at https://discord.com/channels/@me/1395146970284298272
- πThe message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
Can you submit a support ticket using the above? Lmk once you've done that
@past relic ^^ want to make sure you saw my message
π Once you've submitted the ticket I'll make sure it gets to the right place, so let us know once you've submitted it. π
Got it - thanks! The team will follow up with you through that conversation, and you're of course welcome to send any further questions in reply.
can i add that you can also reach me via demodian@gmail.com? i can at least access that email address wherever
and i've got the source for the project down to 3-4MB zipped as I'm not sure how much under the android directory can be safely trimmed
I presume you got a response indicating a case was created, ya? If so, you can reply to that, and cc your other email, and that should mean emails will go to both.
will responses from Stripe use all recipients?
I believe so.
great. i was saving integrating with Stripe toward the end of this project, since I knew I'd be spending the most time on it. I at least got the rest of the app workflow hammered out. just need to figure out how to get this done semi-quickly as it would be nice for us to get some live testing before publishing it for our clients' use
π π
LOG [Stripe terminal]: didUpdateDiscoveredReaders [{"availableUpdate": null, "baseUrl": null, "batteryLevel": null, "bootloaderVersion": null, "configVersion": null, "deviceSoftwareVersion": "unknown", "deviceType": "stripeM2", "emvKeyProfileId": null, "firmwareVersion": null, "hardwareVersion": "unknown", "id": null, "ipAddress": null, "label": null, "location": {"address": [Object], "displayName": "POS1", "id": "tml_E6lpbwVXIHvD0n", "livemode": false}, "locationId": "tml_E6lpbwVXIHvD0n", "locationStatus": "set", "macKeyProfileId": null, "pinKeyProfileId": null, "pinKeysetId": null, "serialNumber": "STRM26214062291", "settingsVersion": null, "simulated": false, "status": "unknown", "trackKeyProfileId": null}]
LOG reader null
LOG Discover Readers update
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG reader null
LOG results undefined
LOG reader null
LOG [Stripe terminal]: didFinishDiscoveringReaders {}
LOG [Stripe terminal]: didChangeConnectionStatus connecting
LOG connection status connecting
LOG [Stripe terminal]: didChangeConnectionStatus notConnected
LOG connection status notConnected
LOG connectReader error {"code": "READER_ERROR.BLUETOOTH_DISCONNECTED", "message": "Bluetooth unexpectedly disconnected during operation."}
it's still failing after the M2 is factory reset. not sure what to think about it now. π¦
I'll add this to the internal ticket, but if you can please use the support thread going forward, that will make sure the team has access to these details too.
(and disregard the reader null logs, as I was testing something else in the code)
will do. i'll hop out of here and take a mental break. Have a good evening
You too! π