#intelagent_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1248608744997130251
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
hi there!
hi!
I'm not sure I understand. can you describe step by step the issue? like
step 1: terminal is waiting for user to enter their card
step 2: ...
step 3: ...
step 1: operator 1 send payment intent to reader1 and is waiting for customer to enter their card
step 2: operator 2 sends a payment intent to that reader1 by accident (instead of reader2)
step 3: customer taps card on reader1 and the wrong payment intent (meant for a different customer)
In short I guess the question is how can I acquire some sort of lock on a reader to avoid 2 users attempting to use the reader at the same time
got it! the flow described above is how it currently works? and you would like that at step 2 the operator get back an error?
to my understanding and from what I've seen testing yes. I would like it if the operator that tried to handoff a payment intent to the reader while there was already one on it - got a reader budy error
But clearly I'm just misunderstanding something here... .
and can you clarify which Terminal integration you are currently using? Javascript SDK, server driven, iOS/Android, ...
server driven with s700
Maybe it's enough to just fetch status before sending a payment intent? and any race conditions may be taken care of by terminal_busy_errors as stated here:
A reader can only process one request at a time. If you make two API requests to the same reader in parallel, one of them fails with a terminal_reader_busy error:
Maybe it's enough to just fetch status before sending a payment intent?
yes that's what I was going to suggest
it's unclear if that is a proper solution though from reading the docs imo
let met check with a colleague.
Ok great! Thank you very much
this is actually covered here: https://docs.stripe.com/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&lang=node#verify-reader
To make sure the reader completed an action, your application must verify the reader state before initiating a new reader action or continuing to capture the payment
How exactly does that cover the case where 2 users might send a payment intent to the reader and one overwrites the other? Are you thinking that before sending a payment intent, we must check the reader state, confirming what we're thinking above?
Are you thinking that before sending a payment intent, we must check the reader state, confirming what we're thinking above?
yes exactly
Ok great, thanks for the help just tested this a bit and things seem like they are working pretty well. Have a good one!
happy to help ๐