1. Components
  2. Checkout Button

Components

Checkout Button

A Checkout Button which starts a stripe checkout session for one time payments.

Basic Usage

Create a product in your stripe account. Get the unique price id and add it to the env key PRIVATE_STRIPE_PRICE_ID.

To import the component, use:

+page.svelte copy
        <script lang="ts">
import CheckoutButton from "$lib/components/CheckoutButton.svelte"
</script>

<CheckoutButton classes="btn btn-wide btn-lg btn-outline btn-primary btn-sm px-6 mt-3 mx-2">
    Buy Now
</CheckoutButton>