#elnuribrahimzade-checkout

1 messages ยท Page 1 of 1 (latest)

plain pelican
#

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

winter lava
#

I doubled checked them several times. Also I createLoginLink does not work.

plain pelican
#

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

winter lava
#

cs_test_a1JBvwnS6R3pOtDdThsb1AOfzxLFvHwvKdJmNncLhE99fy7gGz7lo2PS9M

plain pelican
#

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.

winter lava
#

Could you please clarify "Stripe-Account option" part?

#

I am trying to js library to redirect

plain pelican
#

can you share the code you use? It would make this a lot easier to explain.

plain pelican
winter lava
#

Thanks a lot

plain pelican
#

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

winter lava
#

What about login link ?

plain pelican
#

so can you share more context on that?

#

what's the code you use to create and redirect to the link?

winter lava
#

\Stripe\Account::createLoginLink('acct_xxx')

plain pelican
#

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.

winter lava
#

I do not assign I dump data from \Stripe\Account::createLoginLink('acct_xxx') and take url and put it to browser ๐Ÿ™‚

plain pelican
#

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.

winter lava
#

Here I dump \Stripe\Account::createLoginLink('acct_xxx') and copy paster url to my browser

plain pelican
#

I see but that's not really how you would actually use this in production

#

my guess is you made a mistake when copy-pasting and missed out a character!