How our Stripe Integration works #3042
slinlee
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
@fionnachan wrote up a good description of how the integration works: Originally posted here: #3028 (comment)
On our webapp, when the user clicks the "Request Onboarding Service" button, a POST request with
X-PM-API-TOKENis sent to our pathmind-api's/create-checkout-sessionendpoint.This endpoint will create a Stripe session id with the session configuration (product name, description, price, amount, customer email and id that are attached to the Stripe user in out DB).
Upon receiving a successful POST request response with the Stripe session id, on the frontend we will pass in the session id and call a function from the stripe.js to redirect the browser page to the Stripe Checkout page.
User inputs payment info on the Checkout page. If the payment is successful, they will be redirected to our webapp's payment success page. If unsuccessful, they will return to the main page (which will be the project view). These URLs were configured at
pathmind-api/create-checkout-session.https://stripe.com/docs/api/checkout/sessions
I'm not familiar with Selenium so I'm not sure if this is possible but this is what I think could be done to write the tests:
pathmind-apiendpoint response to return a dummy Stripe session id to call the mocked Stripe service to initialize a Checkout session.All reactions