#lichtamberg

1 messages · Page 1 of 1 (latest)

gaunt sableBOT
proper merlin
#

So set a value that's appropriate for your integration/tolerance

proper merlin
tall pendant
#

I see, but in general we are disconnecting and reconnecting the reader for each payment... and if the USB reader is not connected, thenTTPA starts.. but you can imagine, that I wouldnt want to set the timeout too long, otherwise the guest has to wait too long to pay... So I'm looking for the minimal amount of time, which is necessary to find the reader... Thought maybe you could tell me the minimum time.. I mean I could try it, but I'm not sure if its really the same for multiple phyiscal devices (maybe one is older and takes more time to get recognized,..)?

proper merlin
#

I think the recommendation would be to not disconnect/reconnect after every payment but instead attempt to persist a constant connection

#

I don't really know what the minimum time to establish a connection would be I'm afraid. Could vary massively

tall pendant
#

yeah I guess.. problem is that we dont know how to make persistent connection, since we start our android activity and start the payment process on there - and call finish at the end, so also the reader disconnects.. is there an example somehow on how to do this with persistance connection?

wild mulch
#

Hey! Taking over for my colleague.

so also the reader disconnects.. is there an example somehow on how to do this with persistance connection?
Unexpected disconnects can sometimes occur between your app and the reader.
There is two way of handling these cases:
1- implement the UnexpectedReaderDisconnect in order to notify the user and start redisocvering the reader
2- Automatically attempt reconnection
You can find more details here:
https://stripe.com/docs/terminal/payments/connect-reader?terminal-sdk-platform=android&reader-type=bluetooth#handling-disconnects

tall pendant
#

yeah but I'm not asking about unexpected disconnects.. we are just having seperate activities (like activity to look up a user via NFC wristband), then another activity to select a package (VIP, Business, Normal Ticket) -> and then another activity which processes the payment (connects the readers, start payment,...)... so I dont know how to make the reader keep persisted when cycling through these 3 activites all the time?

wild mulch
#

That depends on the architecture Pattern you are using in your Android Activity. (MVVM, MVP, MVC...) but in general for the a same user journey, you should be using a single Activity and multiple Fragment for each layout (what you are referring to as Activities)

#

You can use a ViewModel in order to share the Reader connections beween these Fragement

#

or using the SharedPreferences APi in order to store the reader serial number

tall pendant
#

ah ok thank you, I will look this up.. we are not really good in android to be honest 🙂 but this is a great tip

#

*hint

wild mulch
#

Happy to help!