#Shaka
1 messages ยท Page 1 of 1 (latest)
Hi there!
Pasting the rest of your question here:
and after he fills out the information and clicks pay. does the window close automatically and my webhook gets the information?
How are you accepting payments? Checkout Session, Payment Element + PaymentIntent, something else?
I didn't implement anything yet - but i'm thinking Checkout Session
Checkout Session is the recommended implementation!
- Create the Checkout Session on the backend
- Redirect your user to the Checkout Session url
- After they complete the payment, the users will be redirected to the
success_urlyou set when creating the Checkout Session
You can learn more about Checkout Session here: https://stripe.com/docs/payments/accept-a-payment
according to this, when the user clicks the checkout on the Front-End, we create the session in the backend and then return this:
why do we return an empty string and what is the 303 there?
Where exactly did you see this code?
303 is the HTTP status code, it means the user will be redirected to a new page (the Checkout Session URL)
The return "" looks like a mistake to me.
on the link you sent me
on the 2nd section - Redirect your customer to Stripe Checkout
oh this is Java code. I'm not familiar with Java, so maybe the return "" is needed. Not sure.
oh ok.. thx
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
thank you... i'm sure there will be ๐
happy to oblige ๐
does the redirection take you to a different tab or window or in the same tab?
is there a way to open a small window instead of doing a redirect?
in that case instead of doing a redirect on the server side you can return the url to your front-end code and deal with opening the url yourself
so in the code image I sent - I just return session.getUrl() basically,
yes correct
usually it's better to send a JSON object that looks something like { url: <session.getURL()>}
OK thank you. i'll do that