#shahzaib-haider_docs

1 messages ¡ Page 1 of 1 (latest)

spice tinselBOT
#

👋 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.

oak aspen
#

Can we somehow create connection token on client side?
No you can't, you need a backend/server

zinc spade
#

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

oak aspen
#

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

zinc spade
#

And terminal you mean card reader right as it need connection token ?

oak aspen
#

Yes

zinc spade
#

And can you tell me when these token expire, like if I want to cache a batch them on my device, will that work?

oak aspen
#

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

zinc spade
#

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

oak aspen
#

yes

#

It depends on the exact flow you have, but yeah that's the idea for internet readers

zinc spade
#

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?

oak aspen
#

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

zinc spade
#

Sure, device will be same

oak aspen
zinc spade
#

we will connect it through bluethooth

oak aspen
#

For example, both are connected to the same wifi, but the wifi doesn't have internet temporarly

oak aspen
#

but if your POS app doesn't have internet, that's not required, you can still connect to the reader and accept offline payment

spice tinselBOT
zinc spade
#

No, as explained I will diconnect from reader A on purpose, then connect to reader B using stored readerId of reader B,

oak aspen
#

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.

zinc spade
#

Ok, Thank you so much

oak aspen
#

Happy to help!

zinc spade
#

One more question

#

I think expiration for connection token is 1 hr? right

#

can we somehow increase that expiration duration or not?

oak aspen
#

But you should use the connection token as soon as it's get generated

#

You shouldn't store it for later reuse

zinc spade
#

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

oak aspen
#

No you can't increase the expiration date of the terminal connection token

#

The connection token is designed to be used instantly after generation

zinc spade
#

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

zinc spade
#

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

oak aspen
#

Yes sure happy to help! What is it ?

zinc spade
#

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

oak aspen
#

And check it's uniqueness in your platform

zinc spade
#

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

oak aspen
#

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

zinc spade
#

Oh, Ok Thanks you