In order to accept payments, you'll need to go through these steps to configure Stripe in the Translation app.
- Create a Stripe account if you don't have one yet
- From the Stripe Dashboard, navigate to the Developers page by clicking
Developers
at the top of the screen - Click the
API keys
tab and find thePublishable key
andSecret key
- Navigate to your
Vercel
deployment and click theSettings
tab. - Click the
Environment Variables
option in the side bar. - Add the
Publishable key
as theNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
environment variable in your Vercel settings and make sure your project redeploys. - Add the
Secret key
as theSTRIPE_SECRET_KEY
environment variable in your Vercel settings and make sure your project redeploys. - Redeploy your project
- Head back to the Stripe Dashboard and ensure you are in "Test Mode" by toggling the
Test Mode
switch at the top of the dashboard to theON
position. - In Stripe's
Developers
section, navigate to the Webhooks tab and clickAdd endpoint
- Under
Endpoint URL
enter your deployment URL with/api/webhooks
appended to the end (e.g.,https://your-deployment-url.vercel.app/api/webhooks
). - Under
Select events to listen to
chooseSelect events
, toggle onSelect all events
and then clickAdd events
- Scroll to the bottom of the form and select
Add endpoint
- In the page that appears, under
Signing secret
clickreveal
and copy the secret.
Add the Signing secret
from part 3 as the STRIPE_WEBHOOK_SECRET
environment variable in your Vercel settings and make sure your project redeploys.
With the Stripe webhook setup, you can start creating your products in the Stripe Dashboard. Stripe Checkout supports billing a set amount at regular intervals. It does not support complex pricing structures like tiered pricing or per-seat billing.
This section is completely optional, but can be used to make your app feel more official, and add some convenience for your users.
You can **optionally ** set up custom branding in the branding settings page to give your app a more white-labeled feeling.
The Stripe customer portal can give your users a way to manage their billing without you having to build and maintain any pages. Click here to setup the Customer Portal.