#mediocremop_error

1 messages ยท Page 1 of 1 (latest)

pliant berryBOT
#

๐Ÿ‘‹ 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/1346593254375952444

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

zinc wigeon
#

Hi, I'm grabbing a teammate who has more expertise with Terminal.

covert fog
#

Hi there ๐Ÿ‘‹ can you tell me more about how you're integrating? Are you using one of our SDKs or one provided by a third-party?

gentle hare
#

Android SDK

covert fog
#

Can you be more specific about which library you're using? As well as share what your code is attempting to do when this error is encountered?

gentle hare
#

Sure, I'm using the Android stripeterminal library, version 4.1.0 (com.stripe:stripeterminal:4.1.0)

This happens very infrequently, but occasionally payment intent confirmation will fail with a 401 because apparently no API key was provided. It's unclear to me where the terminal gets this API key. Does it happen during connection with the fetched connection token?

covert fog
#

I'm not sure offhand why this could be happening, which is why I'm trying to get a deeper understanding of what is happening in your flow.

M2 readers should connect to your application either via bluetooth or USB, so they don't need their own API keys (I don't think) because they don't actually make the requests, your application does.

But I'm going to double check this with a teammate who is more familiar with this flow.

pliant berryBOT
covert fog
#

Alright, I was able to confirm that the Connection Token is what is used to make these requests, so if you're seeing intermittent issues here I would recommend double checking your logic for creating and parsing those tokens.

One thing to note, is that you shouldn't be hard coding Connection Tokens. You should be creating a function that is retrieving those Connection Tokens from your backend, and then provide that function when initializing our SDK.

That flow is shown in this step and the next step:
https://docs.stripe.com/terminal/payments/setup-integration?terminal-sdk-platform=android#connection-token
Is that how your code is set up?

gentle hare
#

yes, i provide a fetchConnectionToken callback which requests a connection token from our backend.

Would an errant Terminal.getInstance().clearCachedCredentials() call cause this?

#

But anyway, the fact that it's some issue with the connection token/credentials is very helpful to know, thank you.

covert fog
#

Offhand I was thinking that maybe there is some sort of intermittent issue communicating with your backend that generates those tokens, so maybe the SDK is trying to grab a new one but can't and then everything after that fails. But let me take a closer look at what the function you referenced does. Is that something you're calling in your code?

gentle hare
#

Yes

#

We call it every time we reconnect to the terminal.

#

it's probably not a connectivity issue; if that were the case the connection token retrieval would probably fail

covert fog
#

Do you call clearCachedCredentials in your flow before confirming an intent? Since it sounds like this error happens during intent confirmation.

gentle hare
#

I don't believe so, but I'll look into it; they're probably related. Thanks for your help.