ComponentsButton Checkout

Opens a Stripe Checkout session. Perfect for a one-time payment or a subscription.

Set mode="payment" for one-time payments or mode="subscription" for recurring payments like a monthly/yearly membership.

By default the user must be logged in to checkout to prevent potential disputes like a fraudulent payment with a fake email. You can change that in the /api/stripe/create-checkout/route.ts API route

This component is used to create Stripe or Lemon Squeezy subscriptions and one-time payments.

Button Checkout Component

/components/Pricing.tsx

1import ButtonCheckout from "./ButtonCheckout";
2
3const Pricing = () => {
4  return (
5    <>
6      <section>
7	      ...
8        <ButtonCheckout priceId={plan.priceId} />
9        ...
10      </section>
11    </>
12  );
13};
14
15export default Pricing;