Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(checkout): build payment section #67

Merged
merged 5 commits into from
Jan 8, 2023
Merged

Conversation

mapra99
Copy link
Owner

@mapra99 mapra99 commented Jan 1, 2023

Closes #36

This PR implements the payments section for checkout. The flow basically goes as follows:

  • After authenticating and submitting the location, the user will go to the payment page
  • During the page load, the frontend server will hit a backend endpoint to create a payment record on the DB and also hit the Stripe API to create a payment_intent. The frontend server will receive a client_secret that identifies the payment_intent.
  • The frontend in the browser will use the stripe.js library to use the client_secret and render the Stripe payment form.
  • The user submits the form, and Stripe will process the payment. When the payment is successful, Strip will notify a webhook in the backend to update the payment status on the DB. Also, the Stripe components on the frontend will redirect the user to a thank you page. If the payment fails the flow is analogous.

https://www.loom.com/share/fc0bc160ec444e41b0199784d9ec7e34

@mapra99 mapra99 marked this pull request as ready for review January 7, 2023 04:29
@mapra99 mapra99 requested a review from ImMPrada January 7, 2023 19:01
Copy link
Collaborator

@ImMPrada ImMPrada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mapra99 mapra99 merged commit 59c3d71 into main Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checkout - build payment page
2 participants