#khoa-h-trn_unexpected
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/1222214362627051570
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi 👋
What are you actually trying to do? What is the command/API request you are making?
- From the server side: I call Update Reader API (https://docs.stripe.com/api/terminal/readers/update) to update the reader's label
- I call Retrieve Reader API (https://docs.stripe.com/api/terminal/readers/retrieve) to check if the reader is updated successfully
- In the client side (React native app, using @stripe/stripe-terminal-react-native): I use useStripeTerminal hook to discover and connect the reader
I expect that the returned Reader.Type object includes label with right value, it's always null
When I get discoveredReaders and connectedReader by useStripeTerminal, it returns Reader.Type objects with all null label fields
Can you share the request ID for an Update Reader request where you set the custom label?
You mean the id in the request? /v1/terminal/readers/:id
No the request ID. It will start with req_. You can find it in your Stripe dashboard in the Developer section
Here is the latest request
req_UykDNu10PlnCuR
Okay great! Taking a look
Okay I see that label being returned in the API repsonse. So my first question is, why are you making a second request when the response to the first has the label you are looking for?
I can also see the label value saved to our internal system.
I updated by API from server side, and expected that I can get the updated label in our client app by using useStripeTerminal hook in @stripe/stripe-tẻminal-react-native lib
And are you doing this during your DiscoverReaders action?
yup. discoverReaders and connectBluetoothReader
Okay and where specifically are you looking to see the reader.label show up?
discoveredReaders contains array of Reader.Type objects and connectedReader contains a Reader.Type object
Okay but that doesn't answer my question. Where are you attempting to access the reader.label?
I debugged and logged it
In what part of your code?
Here is the sample code, I use React Native:
const { connectedReader } = useStripeTerminal();
useEffect(() => {
console.log(JSON.stringify(connectedReader));
}, [connectedReader]);
Let me run and capture the log for you
Hello! I'm taking over and catching up...
What's the ID of the reader you're tyring to get the label for?
Okay, and what's the output of that console.log you mentioned above?
Here is the output
Hm, that's very strange. I'm not sure why label is null there. Still looking around though, hang on...
What version of the React Native Terminal SDK are you using?
It's @stripe/stripe-terminal-react-native 0.0.1-beta.15
So everything else works, you can connect and use the Reader successfully, it's just that label is always null in React Native?
That's right
I'm not sure why that would be the case. Can you try v0.0.1-beta.16 and see if there's any difference?
If that version also doesn't work I recommend you create an issue here so the people who maintain that SDK can investigate: https://github.com/stripe/stripe-terminal-react-native/issues
I tried to install the version beta 16, but got this issue