#josh-c_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/1298827009304039457
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
What's the location ID that you use in this code?
Oh wait, hold on, I think I see the issue.
Nope, that wasn't it. Location ID is tml_FTs7Lw8JMfYEch
Can you put some logs and confirm tml_FTs7Lw8JMfYEch is the location ID that your app uses?
yeah, hold on
Also, tml_FTs7Lw8JMfYEch is created in live mode, is your application also running in live mode?
I was running this in live mode, I will switch to test.
This is a React Native app built with Expo/EAS, I was going with a TestFlight build. I've queued a new one but can switch to USB.
Building now, stand by
Build complete, signing into app to test
Ope, that's it, location ID is blank
Ok, still getting an error
The test location ID is tml_FxUvewa9VlhBoz
Oh wait, no that's a connection token error.
I think that is related to the wrong userId
Maybe not? UserID acct_1MLtmlR8EvBMqb53
or stripe account ID
stripeConnectionToken pst_test_YWNjdF8xSVNWcXRKVW0yTTVSanJvLDZsMW5Xa2RVMDhXdnJORHpVUTVobUdlQ1lhRWxCZHQ_008XXu8w0M
Interesting that I didn't have that issue in prod, is this a configuration error with the test account?
What's the new error now?
ConnectionTokeProvider- CompletedWithError
Connecting to the reader failed because the app completed fetchConnectionToken with an error
Connected account ID and connection token posted above
Ok, the connection token was created on the platform, not the connected account (i.e., acct_1MLtmlR8EvBMqb53).
You should specify a stripe_account in the request when creating the connection token. By specifying a stripe_account, you are telling Stripe that you want to make an API call on behalf of a connected account. You can refer to this doc to learn more about making API request for connected account (https://stripe.com/docs/connect/authentication)
here's the code I am using:
const connectionToken = await stripe.terminal.connectionTokens.create({stripeAccount: user.stripeAccount});
the stripe account is the connected account Id for the user in question
In this case, acct_1MLtmlR8EvBMqb53
That code is run server side and the token is returned to the client per the docs
https://dashboard.stripe.com/test/logs/req_Hv01dNTkbFaddR this is the token creation request, and I don't see stripe_account in the request header
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Ah, I think it is an aysnc/await issue. Hold on, I am going to push a fix.
Urgh, I fixed that and still see the error
Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
That's optional, a connection token without location ID is usable to all readers.
I thought so, I had pulled it because I was providing it when I connect to the reader
I verified that the account ID is present, what is going on?
What's the location ID that you use in the iOS app now?
tml_FxUvewa9VlhBoz
This location was created on platform, not connected account.
You should also use a location that's created on the connected account.
How do I do that?
I don't see an option for that either in Dashboard under terminal locations or under the connected account
Is this what I need to do? https://docs.stripe.com/terminal/features/connect
Yes you can create a location in your connected account's Dashboard, or create one programmatically through API
As in I would need to log into the connected account as them or in my Dashboard I can go to their connected account and create it somehow?
๐ Taking over this thread, catching up now
In your platform, you can go the https://dashboard.stripe.com/test/connect/accounts/overview > Choose the connected account > Click "View Dashboard as this account" > Create the terminal location in connected account's Dashboard
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
We recommend creating the terminal location programmatically through API instead of using Dashboard
Awesome, thank you for that. I'm gonna dig into this in the morning. I'll create an API terminal location creator and go from there. Thank you both for your support. I appreciate it.