#J-e-s-u-s-keys
1 messages · Page 1 of 1 (latest)
Can you share the ID (req_xxx) of the failing API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
compulsory to use publishable key at frontend when you are making payment
Yes, do not use yoursk_xxxkey in your front-end application!
req_RQ8BlvWOKNbR2g
I am using my secret key at backend,
and not using publishable key on frontend.
Is it necessary to use publishable key at front?
Hi! I'm taking over this thread.
If you are using Checkout Session, then you don't have to use the publishable key on the frontend.
Can you please help me figure it out why i am getting 403
Where are you getting a 403? The request you shared (req_RQ8BlvWOKNbR2g) was successful.
Can you share your code to redirect users to your Checkout Session URL?
And you are making a POST request to that function from your frontend?
If you are making a POST request, then your backend needs to return a JSON reponse, something like { url: checjout_session.url }, and then on the frontend you redirect users to that page, for example with location.href = url.
Yes i am making a POST request,
You cannot do a redirect while doing a POST request, that's why it fails.
Either you do a POST request to retreive the URL in JSON format
Or you don't do a POST request, instead directly use a link, and in that case your backend can do a redirect.
@pale robin I have unarchived this thread, catching up in it and will be able to help you in a bit
@uncut compass i am getting this in my postman, when i try to retrieve url
instead of redirect
Hey, just catching up. Is that an error message that your server is passing back or is that a general POSTMAN error?
this error message is from server
Hi 👋 jumping in as my teammate needs to step away. I just want to make sure I'm understanding what you're currently trying to do correctly. You're making a request to your API via Postman, but your endpoint is returning an error?
Is the request being made to Stripe completing successfully?
Yes, the request is completing successfully, but i am unable to redirect so can't make any payments
Okay, so the Stripe portion seems to be working as expected, but you're having problem returning the created URL from your backend to your frontend.
Looking at your endpoint code, you seem to be returning a string instead of returning an HttpResponse. I would recommend reviewing how to build an endpoint with that framework and how to respond to those requests.