#melarts
1 messages · Page 1 of 1 (latest)
Hello! Can you confirm you set up the connection token fetching as outlined here? https://stripe.com/docs/terminal/payments/setup-integration?terminal-sdk-platform=js
Yup!
we are using AWS lambda as our back-end to call stripe API
and it is working fine!
That looks correct to me. It's probably the other errors then, the network issues. It looks like the POS device is unable to find the reader on the local network because the reader's hostname could not be resolved. Have you tried the troubleshooting steps here? https://support.stripe.com/questions/the-stripe-terminal-sdk-is-encountering-dns-errors-when-connecting-to-an-internet-reader
Yes but this happens when de connection is lost.. I would like to understand the first error before, like in which situation de connection token expiration error is thrown?
Connection Tokens expire, it's expected. Usually the Terminal SDK will fetch a new one using the fetch handler you provide, so your backend can generate a new one before the old one expires.
You're supplying the fetch handler, and it looks like it's generating a new one, so that part should be good.
so it is normal that this erreur happen and right after fetchConnectionToken is supposed to be called, right ?
I think usually the SDK will fetch before the connection token expires, but I think there are some scenarios where the error happens first.
ok.. I don't have any hint on how to fix issue then 😦 i don't understand
I don't think it's an issue on your end, I think the network issue is actually the problem.
I don't think the connection token has anything to do with the actual issue. The main problem seems to be the DNS issue.
yes but the DNS is correct since the reader was previously successfully connected
The console errors you shared indicate something changed though, and it's no longer able to resolve that hostname and connect to the reader.
this error happen when you lose the internet connection
i mean i can have this error if i turn off the wifi
That's one possible cause, sure, but there are many others.
The DNS server could be down, for example.
Or the network connection could be degraded.
How do they fix this issue when it happens?
We tell them to reload their page. Some reboot fully their computer
but because of this our solution in not fully trusted
Can you confirm you're handling disconnects as documented here? https://stripe.com/docs/terminal/payments/connect-reader?terminal-sdk-platform=js&reader-type=internet#handling-disconnects
yup ! you can see it in my second screenshot
I only see a dispatch there, not what that code actually does.
basically user see a toast informing that the reader is disconnected and we reset all of store related to the reader so it is like no reader is connected visually. in order to match what is happening with the terminal
Does that happen when this problem occurs?
And do you then call discoverReaders or show the UI to reconnect?
I guess but I'm not sure since we don't manage to fully reproduce the error on our side :/ That's why I'm trying to understand the process
But when the reader is disconnected they can try with a UI to reconnect it. And this is where they tell us that it is impossible to reconnect it
Can you add more logging to your code to determine exactly what happens when this issue occurs? Does the disconnect handler get called? Does it discoverReaders? Does it hit an error?
I mean i could but as I was saying this is not an error we manage to reproduce on dev side so it won't be instant. Are we the only persons using stripe terminal to face such issues ?
Hi there. Rubeus had to step away. Give me a bit to catch up on the issue here
Yeah really we need more info here, so recommend implementing what Rubeus suggested here:
Can you add more logging to your code to determine exactly what happens when this issue occurs? Does the disconnect handler get called? Does it discoverReaders? Does it hit an error?
Network issues are common, but they manifest in many different ways. We'd need some more insight into the above first.
Alright. I'll try to come again with hopefully more informations , thanks