#buddhaprovides - checkout

1 messages · Page 1 of 1 (latest)

red laurel
#

Hello! Just starting a thread for you -- I'll review and respond as soon as I can 🙂

#

What part of this do you mean exactly? WHat are you trying to accomplish?

#

Are you talking about creating the session, or getting updates about it after payment?

dire cypress
#

Thanks so much - I know getting updates after payment is via webhooks so that's clear. I'm trying to understand the flow when the user hits the checkout button. From what I see with other payment gateways is that this happens one of 3 ways:

  1. User clicks on checkout, merchant backend calls stripe backend to create session, stripe backend responds to merchant backend, merchant backend sends session ID to merchant frontend and merchant frontend passes that to Stripe JS (in frontend) and Stripe JS opens checkout

  2. User clicks on checkout, merchant frontend passes data to Stripe JS talks to stripe backend to create session, Stripe backend sends session ID to Stripe JS, and Stripe JS opens checkout

  3. User clicks on checkout, merchant frontend passes data to Stripe backend (via Ajax) and Stripe backend sends checkout session ID to merchant frontend, and merchant frontend passes session ID to stripe JS and stripe JS opens checkout

Just trying to understand how the 4 moving parts work together (merchant FE/BE and Stripe JS/BE)

red laurel
#

Sure! Mainly you want to go with 1/3, your client sending details to your backend to create a session. Redirecting to the checkout session depends on some details, but can be done either server side or client side after the session is created.

dire cypress
#

Doesn't the Stripe JS redirect to the checkout session? How would the stripe JS in the merchant frontend know the session ID?

red laurel
#

It doesn't need to any longer -- the checkout session has a url an your server can redirect the client request

#

(assuming that request is made in a way that can be redirected)

dire cypress
#

I see, so the stripe JS wouldn't be involved in redirections at all maybe just rendering the button and sorts?

red laurel
#

COrrect

dire cypress
#

great thanks so much