#mja123_code
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/1268190887670972540
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- mja123_code, 5 days ago, 37 messages
Yeah our api always does amounts in the smallest unit of currency, so this is expected
so for 500 i have to send 50000?
yep
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?
That seems unexpected to me. If you disconnect, it should be reflected there
yes, but it stays connected in the app. Could it be an issue with the SDK?
version 0.0.1-beta.20 and reader is WisePad 3
Hm that's the latest version, so not likely the cause
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?
Ah you don't have the reader on hand to troubleshoot
Did you implement the onDidDisconnect callback?
yes, but on simulated devices, it dosent seems to be firing. not sure with a real reader
Yeah idk. I'm not the most familiar with these things. Let me ask a colleague
ok
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?
to reconnect to the device, it needs to be disconnected using the app even though the reader is already disconnected
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
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')}
/>
)
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
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