Note: Ensure that you've set up the database before proceeding with this step. If you haven't done so yet, please refer to our database-tutorial.
Note: Ensure that you've set up the mailing before proceeding with this step. If you haven't done so yet, please refer to our mailing-tutorial.
1. Create your stripe account
To be able to handle payments you have to register your own Stripe
2. Create your first Product
To ba able to sell, you should create a new or use an existing product! You can do it under the Product catalog tab. Here you can set the datails of your product!
Note: Here, you can setup your own coupons, tax rates or shipping for the product you want to sell! Make sure you created a Price, and set your price ID in the STRIPE_PRICE_ID record of your .env file!
3. Set your .env file
After you succesfully created your product, you should set your NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY and STRIPE_SECRET_KEY! Please make sure you are using the good keys! If you are in test mode, use the test mode keys, but if you want to launch your product, dont forget to change them to live values!
3. Setting up webhooks!
If you want to enable webhooks for stripe, you can just create a local or a public one for your webpage. Create a new local or public webhook! Set the route for your webhook to http://YOUR_LOCAL_ADDRESS_OR_DOMAIN/api/webhooks/checkout
Note: If you are using your live domain, dont forget to change http to https!
Then copy and paste your webook secret to to your .env file. Modify the following record: STRIPE_WEBHOOK_SECRET.