#gobojosh_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/1357085371577667832
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Yes, this is a connect transaction
Latest Payment Intent is pi_3R9XaoR3BmgLrAbZ2pQeaV3W
I am passing 'pi_3R9XaoR3BmgLrAbZ2pQeaV3W_secret_p47upIy3wa3I9MhQVBZOijSke'
to retrievePaymentIntent()
Is that right? Or should I only pass the Payment Intent ID?
This PaymentIntent exists on the Connected Account so you need to initialize as the Connected Account, see: https://stripe.com/docs/connect/authentication
Ah. I am adding the account when I create the PaymentIntent server side, so it exists there, I need to also initialize the TerminalProvider with that accountId?
Yep
So, I add stripeAccountId here:
<StripeTerminalProvider
logLevel="verbose"
tokenProvider={fetchTokenProvider}
>
?
Yep, I believe it should be stripeAccount as a prop there
You should be able to check the prop definitions to make sure... not sure we have an actual example anywhere unfortauntely.
Hmm. It says ' Property 'stripeAccount' does not exist on type 'IntrinsicAttributes & Props'.ts(2322)'
Yeah can you look at the props? It might be stripeAccountId
Let me see if I can find anything as well
Hmmmm actually this might not be the case
I wonder if this hasn't been added yet since this is still in beta...
This open issue seems to indicate that: https://github.com/stripe/stripe-terminal-react-native/issues/819
You might need to call your server here instead
Not sure this is supported yet to retrieve the PaymentIntent client-side in a Connect context...
Ok, I was wondering about that. I am creating the PaymentIntent client side, can I just skip calling getPaymentIntent()?
And go straight to collectPaymentMethod() ?
Yep you shouldn't need to retrieve it.
Cool, I don't suppose their is any example code to take the JSON object and convert it to the TypeScript PaymentIntent.Type that collectPaymentMethod() expects?
The way I read the docs I was calling retrievePaymentIntent(): Retrieves an existing PaymentIntent using its ID.
To get that object.
You should have the PaymentIntent object from the createPaymentIntent response, no?
Like when you call const {error, paymentIntent} = await createPaymentIntent()
I'm submitting a request to my server, and creating the payment request there. Should I just do it in the app? How do I set the StripeAccountId to the connected account if I do that?
*payment Intent, not request
Oh you said above you were creating it client-side.
And yes right right... you can't create it client-side because you can't pass the Stripe Account header ๐คฆโโ๏ธ
What a mess
Oh sorry. No, it is getting created on the server currently.
Oh I wonder. Hold on.
Yes, I think I see it now.
I think the problem is when I set the connectionToken, it is using a different connected account ID. I bet that's it.
Ah... didn't think of that.
Oh, and that's not a Test ID. Shoot, sorry, I think I see the issue here.
Hi there! Stepping in for bismarck here, who needs to step away
Thanks, I think I might have this figured out.
Our docs literally state this
Lol glad you caught that.
I was taking you down the absolute wrong path
So, I have the stripe accounts (user and order) set to acct_1MLtmlR8EvBMqb53
I'm still getting the error.
Does the location need to registered to the connected account?
And you're talking about when you're calling getPaymentIntent()?
what's the specific PaymentIntent id? just so I can check what Stripe account it belongs to and rule that out
pi_3R9YXxR3BmgLrAbZ1OCL7jt5
Okay so that exists on acct_1QlwieR3BmgLrAbZ
Ok, good. So, I pass in 'pi_3R9YXxR3BmgLrAbZ1OCL7jt5_secret_lNTZkEXUpa7EjpVbZu6I1eCmQ' to retrievePaymentIntent()
should I just pass in the pi ID without the secret?
If you're retrieving from the client, you would use the client secret, if you're retrieving on the server, just the ID
I am calling retrievePaymentIntent() from the React Native SDK on the client side
and are you passing the connected account's id to the Stripe Provider like we document here? https://docs.stripe.com/connect/authentication?create-client=react-native#adding-the-connected-account-id-to-a-client-side-application
Is that for Terminal?
I am using:
<StripeTerminalProvider
logLevel="verbose"
tokenProvider={fetchTokenProvider}
>
<Stack>
<Stack.Screen options={{ headerShown: false }} name="index" />
<Stack.Screen name="home" options={{ header: () => <Header /> }} />
<Stack.Screen name="performance" options={{ header: () => <Header /> }} />
<Stack.Screen name="readers" options={{ header: () => <Header />, headerTitle: 'Discovery' }} />
</Stack>
</StripeTerminalProvider>
From:
import { StripeTerminalProvider, useStripeTerminal } from '@stripe/stripe-terminal-react-native';
The account is set on the connectionToken I create server side
And the error you're getting is that the PaymentIntent doesn't exist, correct? That typically happens when you try to access an object on another account.
still looking here
I can give you the connection token secret if that is helpful
Okay here's what I see that is confusing me:
To take the most recent PaymentIntent, which is pi_3R9Yt6R3BmgLrAbZ2gv2vH1F. You're creating that PaymentIntent on acct_1QlwieR3BmgLrAbZ, but then you're trying to retrieve it from the client as acct_1MLtmlR8EvBMqb53
So the Stripe-Account header that you're using on the serverside call to Create the PaymentIntent isn't the same as the one you're using to create the connection token
Awesome, at least that's an easy fix ๐