#ash_code
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/1387122725855952938
đ 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.
- ash_code, 23 minutes ago, 36 messages
hello! just want to acknowledge your question - i'm working in another thread but i'll get back to you asap
sure no issues thankyou
still wrapping up the other thread, but can you share the exact error message you're receiving?
wait
pls
ill give u that
": Publishable key should not be used for connection token . We should use secret key"
this is what i get
sometimes i get this
sometimes it fetches 0 locations
hmm i can't find that exact error string anywhere. can you share the code where you're generating the connection token?
so we get a connection token from the api
which we use to init terminal
and the next step is fetching locations
fetch locations is not finding any locations
for eg:
pk_test_51L0BIlKAgPwcn0onUKOo4fj6D2Y5wo7faOQL70pLyiVaXjFxeOJvz21QucchJ3ntDopoAlFkxoQXyV4lwTjZ4zfT00VAnVtUI6
this is what i get
can you explain what you mean by "this is what i get"? that looks like a public key, not a connection token. is that what you're getting back from your connection token function?
yes
so my api gives me a connection token
which looks like this
this is what we implemented with 3.3.0
is there any chance you can share a request ID from when your backend creates a connection token?
yep! i'm still here
i need to ask my backend team for that info
which can take time
will u still be online?
if you want to ask them i can see if i can find anything on my end real quick
are you getting anything back that looks like this when your frontend gets a connection token?
pst_test_************************
the key you shared earlier looks like a public key, so i'm wondering if your backend team just configured the API in a weird way where it's returning the public key instead of the connection token
i think this might be an example request: req_JuKCizvHePr2kc. this was created about 30 minutes ago, 2025-06-24 17:57:37 UTC
yes thats what is happening
in our older application the api is returning a connection token that looks like the format i showed u above
transcation request id : 280248
token: pk_test_51L0BIlKAgPwcn0onUKOo4fj6D2Y5wo7faOQL70pLyiVaXjFxeOJvz21QucchJ3ntDopoAlFkxoQXyV4lwTjZ4zfT00VAnVtUI6
can u check based off of this information
again, that is a public token and not a connection token, so i think your backend is doing something strange here
it should be calling this API and returning the secret:
https://docs.stripe.com/api/terminal/connection_tokens
that also lines up with the error you're reporting - it's asking you to not use the public key
i agree, cus for our other application we are getting secret which perfectly works, but our older application did support the strange thing - it was during terminal 3.3.0. I just want to know how it worked eariler now its not
i dont see any breaking change in changelog
we are now at 4.2.0
Hello
Taking over here
Do you have a backend that you use to retrieve Connection Tokens OR are you hard coding Public/Secret key on your client-side code and make a raw HTTP request directly to Stripe?
not client side
we get it from backend
no hardocing cus we dont want to expose our keys
Gotcha. Can you share the code snippet from your backend?
its a legacy application, which i dont have access to
we only the implementation part
but not the code
I'm not sure what you mean by "implementation but not the code"
i dont have access to code snippets
is what i mean
for backend code
sorry fot the confusion
It'll be near impossible to figure out what's going on without looking at the exact code
i just wanted to know if it was ever possible to get locations based off of our old implementation
In order to fetch locations, you need to call the API server-side
See: https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#create-locations-and-zones
if i can find that breaking change in ur changelog it would be great
yes this we are aware of
this is what we have also in our new app
but with our connection token -> which looks like the above format i have shared
doesnt return any locatoins
pk_test_123 is not a connection token. It's your publishable key
I don't believe publishable keys can be used to retrieve locations
Connection Token format is pst_test_123
yes i agree but this is how it worked earlier for us
for our old app
we used terminal 3.3.0
i just want to know will this ever work ?
according to u
Android or the iOS SDK?
android
The only change I recall was - https://github.com/stripe/stripe-terminal-android/blob/master/CHANGELOG.md
When connecting to a reader, you may want to display a list of Locations in your app. To enable this, the SDK provides the Terminal.listLocations method that takes the same parameters as the List all Locations API endpoint.
As far as I know, that also expected a Connection Token (not the publishable key)
Anyhow, no it won't work with the new SDK versions.
okay thank you so much
NP! Happy to help
The function is still supported in the SDK https://stripe.dev/stripe-terminal-android/core/com.stripe.stripeterminal/-terminal/list-locations.html
Are you saying you're not seeing any locations when you get the response?
I'd highly recommend working with your team to figure out what your backend is responding with so that you can integrate the SDK in the correct way