Payment

Subscriptions with built-in SCA 💳

Boostack supports Stripe with the new subscription workflow (Payment intents APIs) so you can charge your customers to access your application or features in your application. The scripts and configurations have all features you need out of the box.

Configuration

In the (stripe-utils.js) file, we define some constants and helper functions that will be used to fetch our Stripe product and plan information.

First, we define constants that help us format our pricing table.

  1. A product subheader — this is a catchy description of our product

  2. Plan features — these are a list of what's included in each specific plan

Next, we define some helper functions to go between Stripe amounts and formatted USD numbers.

Service

To make our code more modular and organized, we recommend having an API directory to house all our Stripe specific functions. we'll store all our functions in one file, (stripe-services.js).

In this file, we grab your Stripe account's products and plans then we perform some operations to format and sort the data. We add additional display information such as a product subheader and specific plan features, We attach the appropriate plans to their corresponding product so that the product now has a plans field. Lastly, we filter for products that have at least 1 plan set up.

We currently retrieve all products and plans so that you don't have to hardcode any product or plan information.

Stripe Elements

To collect and handle card information. We're using Stripe Elements over Stripe Checkout to provide a more brand-specific, customized payment experience.

Last updated

Was this helpful?