You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 3, 2022. It is now read-only.
- Making `.env` variables available to next: [next.config.js](next.config.js)
38
-
-**Note**: When deploying with Now you need to [add your secrets](https://vercel.com/docs/v2/serverless-functions/env-and-secrets) and specify a [now.json](/now.json) file.
39
37
- Implementation of a Layout component that loads and sets up Stripe.js and Elements for usage with SSR via `loadStripe` helper: [components/Layout.tsx](components/Layout.tsx).
40
38
- Stripe Checkout
41
39
- Custom Amount Donation with redirect to Stripe Checkout:
@@ -78,13 +76,13 @@ cd with-stripe-typescript
78
76
79
77
### Required configuration
80
78
81
-
Copy the `.env.example` file into a file named `.env` in the root directory of this project:
79
+
Copy the `.env.local.example` file into a file named `.env.local` in the root directory of this project:
82
80
83
81
```bash
84
-
cp .env.example .env
82
+
cp .env.local.example .env.local
85
83
```
86
84
87
-
You will need a Stripe account ([register](https://dashboard.stripe.com/register)) to run this sample. Go to the Stripe [developer dashboard](https://stripe.com/docs/development#api-keys) to find your API keys and replace them in the `.env` file.
85
+
You will need a Stripe account ([register](https://dashboard.stripe.com/register)) to run this sample. Go to the Stripe [developer dashboard](https://stripe.com/docs/development#api-keys) to find your API keys and replace them in the `.env.local` file.
The CLI will print a webhook secret key to the console. Set `STRIPE_WEBHOOK_SECRET` to this value in your `.env` file.
112
+
The CLI will print a webhook secret key to the console. Set `STRIPE_WEBHOOK_SECRET` to this value in your `.env.local` file.
115
113
116
114
### Deploy
117
115
116
+
[](https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/with-stripe-typescript)
117
+
118
118
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
119
119
120
120
**Note**: You must add your Stripe secrets using the Vercel CLI ([Download here](https://vercel.com/download)):
After deploying, copy the deployment URL with the webhook path (`https://your-url.now.sh/api/webhooks`) and create a live webhook endpoint [in your Stripe dashboard](https://stripe.com/docs/webhooks/setup#configure-webhook-settings).
129
129
130
130
**Note**: Your live webhook will have a different secret. To update it in your deployed application you will need to first remove the existing secret and then add the new secret:
0 commit comments