Stripe
Mkdirs uses Stripe as a payment processor.
Configuration
-
Create an account on Stripe
If don’t have an account on Stripe, follow their steps to signup.
-
Get the Stripe API key
- Go to your Stripe dashboard.
- Select
Developers
on the top right navigation bar. - Select
API keys
on the menu underDevelopers
. - Click on the
Reveal live key
(orReveal test key
if you are in test mode). - Copy the secret key and set it to the
.env
file.
-
Get the product price id
- Go to your Stripe dashboard.
- Select
Product Catalog
on the left sidebar. - Click on the
+ Create Product
button. - Give your product a clear name and set the one-time fee for user submissions.
- Click on the
Add Product
button to create it. - Go to the product detail page, click on the
...
button in the pricing section. - Copy the price id and set it to the
.env
file.
-
Get the webhook secret
- Go to your Stripe dashboard.
- Select
Developers
on the top right navigation bar. - Select
Webhooks
on the menu underDevelopers
. - Click on the
Add an endpoint
button. - Enter the endpoint URL where Stripe will send events to, for example,
https://your-domain.com/api/webhook
. - Choose the events you want to receive notifications for, common events include
checkout.session.completed
. - Copy the webhook secret and set it to the
.env
file.