#shahzaib-haider_docs
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/1422200762036916258
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Can we somehow create connection token on client side?
No you can't, you need a backend/server
So, that means we can't implement offline payment on terminal? As we need connection token to connect to reader and in our case user can choose which connected account he wants to pay to, so we need to disconnect from previous connected account and connect to newly selected connected account if different connected account is selected and for that we need connection token for that connected account.
And to get connection tokken, we need to communicate with server and for that we need internet?
Is there any other way we can achieve our intented functionality
No you can implement offline payment, but the terminal must be previously connected
Offline mode, is just for temporarly connection lost and not full offline flow
And terminal you mean card reader right as it need connection token ?
Yes
And can you tell me when these token expire, like if I want to cache a batch them on my device, will that work?
the connection token is needed just for the first time
then you can store the locationId and the reader Id and try to connect to the reader I think
Oh, you mean if connect to reader and get it's readerId then I can use to locationId and readerId to conected again after disconnecting
yes
It depends on the exact flow you have, but yeah that's the idea for internet readers
Just clearing one thing, I will not need a new tokken just need readerId and locationId
Not there is no expiration on readerId right
And one more silly question, if there is not internet, can these operation can be perform with sdk?
Not there is no expiration on readerId right
The device connected previsouly to the reader
You can't reuse the reader Id with multiple applications/devices
Sure, device will be same
yes, but keep in mind the reader and the POS device must still be connected to the same network
we will connect it through bluethooth
For example, both are connected to the same wifi, but the wifi doesn't have internet temporarly
For bluetooth, you can set autoReconnectOnUnexpectedDisconnect: true and the SDK will handle reconnection
https://docs.stripe.com/terminal/payments/connect-reader?terminal-sdk-platform=android&reader-type=bluetooth#connect-reader
but if your POS app doesn't have internet, that's not required, you can still connect to the reader and accept offline payment
No, as explained I will diconnect from reader A on purpose, then connect to reader B using stored readerId of reader B,
If you previously connect to both readers using a connectionToken
I think you can do the switch while offline
But I recommend doing a test to confirm this.
Ok, Thank you so much
Happy to help!
One more question
I think expiration for connection token is 1 hr? right
can we somehow increase that expiration duration or not?
I'm not sure about that one honestly
But you should use the connection token as soon as it's get generated
You shouldn't store it for later reuse
but if I know the expiration duration and if we can increase it or not that will be very help. If you could somehow guide me on that, if not no problem
No you can't increase the expiration date of the terminal connection token
The connection token is designed to be used instantly after generation
ok. My last question to this topic is I am using Reader M2 for stripe, can you confirm we can do offline payment flow with that
Ok, Thanks you
I have one more question but it;s not related to above topic, can I ask or should I open a new thread
Yes sure happy to help! What is it ?
I want to check using card if it's has been used already in my platform, if so i want to fetch that customer details
My platform is using connected accounts
You can check that using the fingerprint of the card:
https://docs.stripe.com/api/payment_methods/object#payment_method_object-card-fingerprint
And check it's uniqueness in your platform
So, How
like when I create a payment method I will get card fingerprint from it and search which api to get the data of matched fingerprint
Ah no actually, you should store each card fingerprint in your integration/database
and for each new created card, you make a check on your database and see if you have that fingerprint
Oh, Ok Thanks you