#gobojosh_code

1 messages ยท Page 1 of 1 (latest)

teal roverBOT
#

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

pliant moat
#

Hello there

#

Are you using Connect here?

thorny walrus
#

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?

pliant moat
thorny walrus
#

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?

pliant moat
#

Yep

thorny walrus
#

So, I add stripeAccountId here:
<StripeTerminalProvider
logLevel="verbose"
tokenProvider={fetchTokenProvider}
>
?

pliant moat
#

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.

thorny walrus
#

Hmm. It says ' Property 'stripeAccount' does not exist on type 'IntrinsicAttributes & Props'.ts(2322)'

pliant moat
#

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...

#

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...

thorny walrus
#

Ok, I was wondering about that. I am creating the PaymentIntent client side, can I just skip calling getPaymentIntent()?

#

And go straight to collectPaymentMethod() ?

pliant moat
#

Yep you shouldn't need to retrieve it.

teal roverBOT
thorny walrus
#

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.

pliant moat
#

You should have the PaymentIntent object from the createPaymentIntent response, no?

#

Like when you call const {error, paymentIntent} = await createPaymentIntent()

thorny walrus
#

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

pliant moat
#

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

thorny walrus
#

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.

pliant moat
#

Ah... didn't think of that.

thorny walrus
#

Oh, and that's not a Test ID. Shoot, sorry, I think I see the issue here.

half terrace
#

Hi there! Stepping in for bismarck here, who needs to step away

thorny walrus
#

Thanks, I think I might have this figured out.

pliant moat
#

Our docs literally state this

#

Lol glad you caught that.

#

I was taking you down the absolute wrong path

thorny walrus
#

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?

half terrace
#

And you're talking about when you're calling getPaymentIntent()?

thorny walrus
#

Yeah

#

retrievePaymentIntent()

half terrace
#

what's the specific PaymentIntent id? just so I can check what Stripe account it belongs to and rule that out

thorny walrus
#

pi_3R9YXxR3BmgLrAbZ1OCL7jt5

half terrace
#

Okay so that exists on acct_1QlwieR3BmgLrAbZ

thorny walrus
#

Ok, good. So, I pass in 'pi_3R9YXxR3BmgLrAbZ1OCL7jt5_secret_lNTZkEXUpa7EjpVbZu6I1eCmQ' to retrievePaymentIntent()

#

should I just pass in the pi ID without the secret?

half terrace
#

If you're retrieving from the client, you would use the client secret, if you're retrieving on the server, just the ID

thorny walrus
#

I am calling retrievePaymentIntent() from the React Native SDK on the client side

half terrace
thorny walrus
#

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

half terrace
#

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.

thorny walrus
#

Corrent

#

*Correct

half terrace
#

still looking here

thorny walrus
#

I can give you the connection token secret if that is helpful

half terrace
#

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

thorny walrus
#

Got it. I thought I set them to the same. Hold on.

#

That's it! Thank you!

half terrace
#

Awesome, at least that's an easy fix ๐Ÿ˜