#mja123_code

1 messages ¡ Page 1 of 1 (latest)

left shellBOT
#

👋 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/1268190887670972540

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

pine kayakBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

blissful ether
#

Yeah our api always does amounts in the smallest unit of currency, so this is expected

onyx tendon
#

so for 500 i have to send 50000?

blissful ether
#

yep

onyx tendon
#

okay, also i have 2 more questions regarding the stripe terminal reader

#

the first is, when the reader is disconnected or shut down, the same is not reflected in the connectedReader value returned from the useStripeTerminal hook.

#

is there any way to update this value?

blissful ether
#

That seems unexpected to me. If you disconnect, it should be reflected there

onyx tendon
#

yes, but it stays connected in the app. Could it be an issue with the SDK?

blissful ether
#

Hm what version of the sdk are you using?

#

And what reader type?

onyx tendon
#

version 0.0.1-beta.20 and reader is WisePad 3

blissful ether
#

Hm that's the latest version, so not likely the cause

onyx tendon
#

the issue is being faced by the client, i dont have a reader, is there any way i can simulate a shutdown of the simulated reader?

blissful ether
#

Ah you don't have the reader on hand to troubleshoot

#

Did you implement the onDidDisconnect callback?

onyx tendon
#

yes, but on simulated devices, it dosent seems to be firing. not sure with a real reader

blissful ether
#

Yeah idk. I'm not the most familiar with these things. Let me ask a colleague

onyx tendon
#

ok

cursive sail
#

To be clear, is this one user the only time this has been reported? And this is a consistent issue for them, not a one-off thing?

#

And can you tell me more about the behavior that the user is seeing? For example is the reader showing up as online until another reader action is taken at which point the SDK realizes it is online? Does it have issues reconnecting when the reader is back on?

onyx tendon
#

to reconnect to the device, it needs to be disconnected using the app even though the reader is already disconnected

cursive sail
#

Can you send me your snippet of code for that as well as what you use to keep track of whether the reader is connected?
Still looking for whether it is possible to disconnect or shut down a simulated reader

onyx tendon
#

const {
discoverReaders,
connectBluetoothReader,
disconnectReader,
connectedReader,
isInitialized,
discoveredReaders,
cancelDiscovering,
} = useStripeTerminal({
onUpdateDiscoveredReaders: (_devices) => {
setDevices(_devices);
setIsDiscovering(false);
},
onDidDisconnect(reason) {
console.log('Disconnected', reason);
},
onDidChangeConnectionStatus(status) {
console.log('Connection status', status);
},
onDidReportReaderSoftwareUpdateProgress: (progress) => {
setUpdateProgress((Number(progress) * 100).toFixed(0).toString());
},
onDidFinishInstallingUpdate: ({ error }) => {
if (error) {
Alert.alert('Update failed', 'Please try again');
} else {
setIsUpdating(false);
Alert.alert('Update completed', 'Reader has been updated');
}
},
onDidStartInstallingUpdate: (update) => {
// Alert.alert('Update started', 'Please do not disconnect the reader');
setIsUpdating(true);
},
});

#

{connectedReader ? (
<CardReaderComponent
name={connectedReader.deviceType as string}
description="Card reader"
onPress={() => goToPage('deviceDetails')}
/>
)

left shellBOT
cursive sail
#

That looks like it should get triggered properly. Also unfortunately it looks like there isn't a way to simulate a shutdown or disconnect at the moment for simulated readers

cursive sail
#

Unfortunately I am still not finding much here. That property should be set to null when the reader disconnects and I am not finding other known issues around disconnects being completely missed like this. Trying to think of what to do next