#bennett_code

1 messages ¡ Page 1 of 1 (latest)

willow sedgeBOT
#

👋 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/1235288779581816832

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

barren rover
lucid pier
#

That worked, just needed to pass the stripe connect account id along with the other two parameters from paymentIntents.create

#

And use that in Client Side loadStripe

#

Actually now not working in React Native because I cannot init the payment sheet with a stripe account id?

barren rover
#

Can you elaborate a bit?

lucid pier
#

Following this example, for React Native

#

const ephemeralKey = await stripe.ephemeralKeys.create(
{ customer: user.stripe.customerId },
{ apiVersion: "2023-10-16", stripeAccount: user.OrganizationID.stripe.accountId },
);
const paymentIntent = await stripe.paymentIntents.create(
{
amount: inputAmount,
currency: "usd",
customer: user.stripe.customerId,
automatic_payment_methods: {
enabled: true,
},
},
{
stripeAccount: user.OrganizationID.stripe.accountId,
}
);

return {
paymentIntent: paymentIntent.client_secret,
ephemeralKey: ephemeralKey.secret,
customer: user.stripe.customerId,
};

This is what the backend is returning to React Native, none of it uses stripeAccount, which is what makes me think that is what's failing the payment sheet

#

And giving me an invalid_request_error

#

I see, it's used in StripeProvider

barren rover
#

What's the full error message you're getting? Please also include a Request ID if it's include (it will look like this --> req_abc123)

lucid pier
#

I just need to provide stripe account id to StripeProvider that wraps the elements

barren rover
#

Right, but what's the invalid_request_error you're getting?

#

Also, if you're passing the Account ID into both these lines, I would expect an error to occur. I believe you have to choose one or the other:

{ apiVersion: "2023-10-16", stripeAccount: user.OrganizationID.stripe.accountId },

stripeAccount: user.OrganizationID.stripe.accountId,