-
Notifications
You must be signed in to change notification settings - Fork 5
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
Stripe promote on checkout #228
Conversation
cac7e7e
to
add777d
Compare
SKY-1056 Implement an API endpoint to query the status of a payment
This endpoint should synchronously check the payment status with Stripe and update the user record if it was successful (so that we don't need to wait for the webhook call to arrive). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, would clean it up a bit but definitely close to done
Pull request was converted to draft
…e parts we need and use the proper naming convention. Fix some error messages.
Set the client's email and description in Stripe when creating it.
PULL REQUEST
Overview
Our typical payment flow starts with us creating a checkout session and redirecting the user to a Stripe-controlled page where they make the actual payment. After the payment is done, we wait for a push notification on our webhook endpoint. We process that notification and promote/demote the user accordingly.
This works well and is reliable because Stripe will keep sending the webhook event until they get a successful response.
The problem with it is that it might take a while and the user will be left without any notification what is going on.
This PR solves that problem by introducing a new endpoint which we can proactively call in order to check the status of a given checkout session and promote the user, if required. Note that we won't demote the user by calling this endpoint - that will be handled by the webhook endpoint. This new endpoint will only be used in order to speed up the user promotion process, so we get happy users.
Example for Visual Changes
Response JSON example:
Checklist
Issues Closed
Closes SKY-1056