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.
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).
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