#Shaka

1 messages ยท Page 1 of 1 (latest)

sullen hazelBOT
lunar ivy
#

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?

eternal juniper
#

I didn't implement anything yet - but i'm thinking Checkout Session

lunar ivy
#

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_url you set when creating the Checkout Session
    You can learn more about Checkout Session here: https://stripe.com/docs/payments/accept-a-payment
eternal juniper
#

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?

lunar ivy
#

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.

eternal juniper
#

on the link you sent me

#

on the 2nd section - Redirect your customer to Stripe Checkout

lunar ivy
#

oh this is Java code. I'm not familiar with Java, so maybe the return "" is needed. Not sure.

eternal juniper
#

oh ok.. thx

formal fiber
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

eternal juniper
#

thank you... i'm sure there will be ๐Ÿ™‚

formal fiber
#

happy to oblige ๐Ÿ™‚

eternal juniper
#

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?

formal fiber
#

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

eternal juniper
#

so in the code image I sent - I just return session.getUrl() basically,

formal fiber
#

yes correct

#

usually it's better to send a JSON object that looks something like { url: <session.getURL()>}

eternal juniper
#

OK thank you. i'll do that