# Payments

### Handling Stripe Test Data

When you run the `npm run setup` command for the first time, Stripe gets seeded with some dummy products and pricing plans.

You can delete the products here: <https://dashboard.stripe.com/test/products?active=true>

Or, you can delete the entire test data (products, prices, logs, etc.) here: <https://dashboard.stripe.com/test/developers>

![Untitled](https://prod-files-secure.s3.us-west-2.amazonaws.com/5f80d4d1-3a21-46b6-a6fe-ce724081cd76/96b8d71b-975a-42d0-87c9-990db1a943a9/Untitled.png)

In case you want to edit the existing products or prices or pricing tiers or add new ones, you can add it directly in your Stripe Dashboard or make the required changes in `prisma/schema.prisma` and `scripts/config.ts` files and run the `npm run setup` command again.

### Stripe Production Guide

* Toggle off the Test Mode.
* Copy the `Secret key` from <https://dashboard.stripe.com/apikeys> and use it as the value of `STRIPE_SECRET_KEY` in your production environment variables.
* Go to <https://dashboard.stripe.com/webhooks>.
* Click on `+ Add endpoint`. Use `https://www.{YOUR_DOMAIN}/api/webhook/`. Select `checkout.session.completed` event and others if you have modified the `api.webhook.ts` file. Copy the signing secret and add it to `STRIPE_ENDPOINT_SECRET` in your production environment variables.
