Stripe Checkout (subscription mode)

Manages recurring payments through subscription-based billing.

When a user clicks on the "select plan" button in ⛏️Subscription Cards, custom workflows are triggered from the reusable element "πŸ” SECURITY REDIRECT ", from which we use the Retrieve Subscription API Call to check if the user is subscribed to a plan as follows:

If user's retrieve subscription is 0 (meaning not subscribed to any plan), this triggers a custom workflow to Create a subscription. Here are the steps:

  1. Calling the Stripe Checkout (Subscription with price id) API by passing the price ID and ensuring the "mode" parameter is set to subscription.

  2. Triggering the πŸ“š Log API Response custom if step 1 returned an error. Here we capture the error details to use it to create a new dt_API_log record and trigger a toast displaying the error body.

  3. Navigating the user to a stripe hosted page by using result of step 1's body url as the destination. This stripe page allows the user to checkout using a credit card (it can also be configured from the Stripe's dashboard to accept other means of payment).

If user's retrieve subscription > 0 (meaning user is subscribed to a plan), this triggers a custom workflow to Update a subscription using a confirmation popup (🍿PU_Action) which handles the steps for updating a subscription:

  1. Using the Stripe - Update Subscription action by passing in the subscription_id, items_id, and price_id parameters from the Retrieve Subscription API Call.

  2. Triggering the πŸ“š Log API Response custom if step 1 returned an error. Here we capture the error details to use it to create a new dt_API_log record and trigger a toast displaying the error body.

  3. Triggering a toast if step 1 was successful.

Last updated