#elnuribrahimzade-checkout
1 messages ยท Page 1 of 1 (latest)
usually this means you called redirectToCheckout with the wrong publishable (pk_test_xxx) key(not the key for the same Stripe account whose secret key (sk_test_xxx) you used to create the CheckoutSession
ok let's stick with the Checkout error first and then we can look at that other one
can you give me a link to your site that does the redirect to Checkout?
if you can't, can you share the code you're using?
also the ID of the CheckoutSession (cs_test_xxx ) would be really useful
cs_test_a1JBvwnS6R3pOtDdThsb1AOfzxLFvHwvKdJmNncLhE99fy7gGz7lo2PS9M
thanks
yeah you are definitely using the wrong key
like your Express account acct_1KTilqRDH1iVREr9 is trying to access that Session, which is wrong โ this is not a Direct Charge where you need to use the Stripe-Account option, it's Destination so you just use your platform's API key directly.
Could you please clarify "Stripe-Account option" part?
I am trying to js library to redirect
can you share the code you use? It would make this a lot easier to explain.
I'm assuming you maybe have code in your frontend like var stripe = Stripe(key, {stripeAccount:"acct_1KTilqRDH1iVREr9"}) , which is wrong, you don't need stripeAccount here because the CheckoutSession is not a Direct Charge.
cool, so you need to remove that.
also note you don't even need any of that code or redirectToCheckout at all. When you create the Session in PHP, it has a url field and you can just directly redirect the user to that URL yourself without using stripe.js if that's easier
What about login link ?
so can you share more context on that?
what's the code you use to create and redirect to the link?
\Stripe\Account::createLoginLink('acct_xxx')
can you share a lot more than that?
like the full code of how you then assign that API call to a variable, access the URL, redirect to it, etc.
I do not assign I dump data from \Stripe\Account::createLoginLink('acct_xxx') and take url and put it to browser ๐
any code for how you do that?
my guess is you do something that mangles the URL or doesn't do the redirect correctly, but it's hard to help without you sharing the exact relevant code.
Here I dump \Stripe\Account::createLoginLink('acct_xxx') and copy paster url to my browser