#Joel Pellaud
1 messages ยท Page 1 of 1 (latest)
What do you mean by "using a connect account for a checkout"?
Ah okie. In this guide you use your Platform's api key, with the Stripe Account header points to your Connected Account Id
Whenever I add the StripeAccount, I end up in the "Something went wrong" page instead of the usual Stripe checkout.
The console shows two errors related to the payment page, and related search results leads to api keys errors
Let's zoom in the errored request. Do you have the request id? req_xxx
I have it
But I don't have access to the stripe account, so I don't know what I should ask for
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
req_tLHBvR3oKgXFQn ?
let me take a look
I'm terribly sorry for the delay
when you create the front-end stripe instance you need to pass in the stripeAccount header as described here https://stripe.com/docs/js/initializing#init_stripe_js-options-stripeAccount
So in
<script>
var stripe = Stripe('@Model.StripePublicKey');
stripe.redirectToCheckout({
// Make the id field from the Checkout Session creation API response
// available to this file, so you can provide it as parameter here
// instead of the {{CHECKOUT_SESSION_ID}} placeholder.
sessionId: '@Model.StripeSessionId'
}).then(function (result) {
// If `redirectToCheckout` fails due to a browser or network
// error, display the localized error message to your customer
// using `result.error.message`.
});
</script>
I must update to something like var stripe = Stripe('@Model.StripePublicKey', new { stripeAccount: "acct_xxx"}); ?
Can't find its replacement?
It looks like the server directly redirects to the checkout page now?
you can send the url to the front end and do a redirection on the front-end if you prefer
I will check that, thank you for your time! ๐
I might not be able to do the migration asap, in the meantime what is the exact syntax for the option part for the stripeAccount?
var stripe = Stripe('@Model.StripePublicKey', { stripeAccount: "acct_xxx"})
you don't need the new
thank you, I'll try and come back if I get new issue
sorry wrong thread
my bad