Skip to main content

Setup

We'll need to configure Stripe to handle test payments. If you don't already have a Stripe account, create one now.

For the following steps, make sure you have the "Test Mode" toggle switched on:

  1. Create a stripe account and set it up
  2. Create a product
  3. Go to portal settings and click "Save Changes"
  4. Go to Supabase dashboard > Edge Functions and copy the stripe_webhooks URL. It should look something like below:

  1. Add stripe webhook,
  2. Click Select events under the Select events to listen to heading.
  3. Click Select all events in the Select events to send section.
  4. Copy Signing secret as we'll need that in the next step (e.g whsec_xxx)
  5. Get your Stripe API secret key and update STRIPE_SECRET_KEY in .env
  6. Get the signing webhook signing secret and update STRIPE_WEBHOOK_SIGNING_SECRET in .env
  7. Set your secrets in production
supabase secrets set --env-file .env
info

You can follow steps 1-7 in the Stripe test environment to have your local environment use the stripe test environment. Update .env.local instead of .env.

note

After setting up the webhooks, you can run the command below to do an initial sync between your supabase and stripe database

deno run  --env -A supabase/functions/_scripts/sync-stripe.ts