Stripe Button

File locations:

  • src/components/stripeButton.tsx

The StripeButton component allows you to create a new Stripe checkout session, where the customer can make their purchase.

For monthly subscription option, the StripeButton also allows the customer to cancel and resume their subscription.

The StripeButton component accepts to arguments, plan and type.

The plan can be month or onetime, and the type can be checkout, cancel, or resume.

To use the component, import it into your page.tsx like this:

import StripeButton from "@/components/stripeButton";

<StripeButton type="checkout" plan="onetime" />

<StripeButton type="checkout" plan="month" />
<StripeButton type="cancel" plan="month" />
<StripeButton type="resume" plan="month" />