#udaytechnosouls_76536

1 messages · Page 1 of 1 (latest)

kind meteorBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

grim niche
#

The error seems pretty verbose, right? You can only use a token one-time. If you disconnect and need to reconnect, you need a new token

tight folio
#

Yes i am use fetchConnectionToken while init terminal

#

val tokenProvider = TokenProvider(STRIPE_TOKEN)

Terminal.initTerminal(
context = it,
logLevel = logLevel,
tokenProvider = tokenProvider,
listener = object : TerminalListener {

grim niche
#

I suspect your code is not working as you intend it to. Like the TokenProvider is persisted in state between disconnects

tight folio
#

Yes i log on fetchConnectionToken it come with sucess

grim niche
#

Ok, but is the fetchConnectionToken method/function running again after the disconnect to generate a new token?

#

I suspect not, and you're reusing the same token again hence the error

tight folio
#

no, I do not use token directly, First i call
Terminal.getInstance().discoverReaders

And after it I call Terminal.getInstance().connectBluetoothReader

and token error comes

#

The updated token is taken by fetchConnectionToken self

grim niche
#

But are you sure it's running again after the disconnect for the first reader? Can you add logs to verify that it's generating a new token?

tight folio
#

Yes I do but in Andorid i got unit no string of token

I have try like this
val tokenTemp = callback.onSuccess(token)
Log.d("log", "fetchConnectionToken callback.onSuccess${tokenTemp} ")

#

Can tou suggest how I can log token?

#

I got this on log : "fetchConnectionToken callback.onSuccesskotlin.Unit "

austere vortex
#

hmm strange. I'd suggest collecting all the code and the exact error message and writing a support ticket into https://support.stripe.com/?contact=true so we can dig into what's happening. Share also the exact version of the stripe-terminal-android library that you're using and the serial number of M2 device.

tight folio
#

Hello I got this is token issue below

class=RestClient message="url=https://api.stripe.com/v1/terminal/connection_tokens/activate
request={"connectionType":"bluetooth","deviceSerialNumber":"STRM26146007039","deviceType":"stripe_m2","posDeviceId":"fa00ceeb-3e50-4640-9cfa-7fd2b59d3cc8","posDeviceInfo":{"appModel":{"appId":"com.membershiptoolkit.mobileapp","appVersion":"2.2.4"},"deviceClass":"POS","deviceUuid":"fa00ceeb-3e50-4640-9cfa-7fd2b59d3cc8","hardwareModel":{"posInfo":{"description":"SM-A226B"}},"hostHwVersion":"SM-A226B","hostOsVersion":"13"},"posVersionInfo":{"clientType":"ANDROID_SDK","clientVersion":"2.21.0"},"reader":{"appModel":{"appId":"firmware-config-key","appVersion":"2.01.00.20-SZZZ_Prod_US_v5-480001"},"bbposBaseConfig":"SZZZ_Prod_US_v5","bbposFirmware":"2.01.00.20","bbposKeyProfile":"480001","deviceClass":"READER","deviceUuid":"STRM26146007039","hardwareModel":{"bbposHardware":"STRIPEM2"},"hostHwVersion":"STRM2-01
(0803)"},"registerToLocation":"tml_FHwmfgXKcv8DZY","reportedReaderConfig":{"keyId":"480001"}}"
15:58:29.309 RestResponse I REST response with code 400 received

#

before this = fetchConnectionToken is call onSuccess :-
StripeTerminal D class=ConnectionTokenRepository message=refreshToken
15:58:28.625 StripeTerminal D class=ApiClient message=activateReader
15:58:28.626 StripeTerminal D class=ConnectionTokenRepository message=fetchConnectionToken.onSuccess

#

M2 Device "serialNumbers":["STRM26146007039"]

austere vortex
#

all I see in our logs really is what it says, you had already connected to one reader when you tried to use the same token to connect to another

#

I'm not familiar enough with how our Android SDK works to say how you should do this instead or if 'switching to another reader in the same session' is even possible(probably not)

#

that should help!

tight folio
#

Yes I do it already Please check below code

Terminal.getInstance().disconnectReader(object : Callback {
override fun onFailure(e: TerminalException) {
isConnectedReader = false
Log.d("disconnect reader", "onFailure() called with: e = $e")

                Terminal.getInstance().clearCachedCredentials()
            
            }

            override fun onSuccess() {
                println("disconnectReader succeeded")
                Terminal.getInstance().clearCachedCredentials()

               
            }

        })
#

I call this before call to new one

austere vortex
#

then I'm not sure what else to suggest really. I suppose make sure your backend function always creates and return a new ConnectionToken and never does any caching or returning existing tokens.

#

if you're still having trouble with this I'd suggest collecting all the frontend and backend code and the exact error message and writing a support ticket into https://support.stripe.com/?contact=true so we can dig into what's happening. Share also the exact version of the stripe-terminal-android library that you're using and the serial number of M2 device.

tight folio
#

I am using implementation "com.stripe:stripeterminal:2.21.0"