#kuvana
1 messages · Page 1 of 1 (latest)
What do you mean, exactly, can you share an example scenario?
We are running into an issue where if User 1 connects to a terminal, then User 2 connects to the same terminal, User 1 will not be notified the Terminal is in use by User 2 until they begin trying to process a payment. It seems like a state issue, but I can't find the best way to check if the Terminal was connected by another User before User 1 attempts to initiate a payment.
We have this initializer when a User connects to a terminal
const newTerminal = stripeTerminal.create({
onFetchConnectionToken: fetchConnectionToken,
onUnexpectedReaderDisconnect,
onConnectionStatusChange,
onPaymentStatusChange,
});
But I would expect onUnexpectedReaderDisconnect or onConnectionStatusChange to trigger for User 1 when User 2 connects to the same Terminal, but it seems to not trigger until we attempt
stripeTerminal.processPayment
RIght, yea, because it doesn't know about that yet, unless perhaps it polls
So you cna manage that using fail_if_in_use=true when you connect
https://stripe.com/docs/terminal/payments/connect-reader?terminal-sdk-platform=js&reader-type=internet#multiple-connections
Doing this, the second client to try to connect would instead fail, because the reader is already connected to another client
Okay, we have that set to true but it doesn't seem to be working. Must be an issue with our own state management then. Thank you