@@ -114,9 +114,49 @@ export default buildConfig({
114114})
115115```
116116
117- To use webhooks you also need to have them configured in your Stripe Dashboard.
117+ To use webhooks you also need to have them configured in your Stripe Dashboard or use the Stripe CLI for local development .
118118
119- You can use the [ Stripe CLI] ( https://stripe.com/docs/stripe-cli ) to forward webhooks to your local development environment.
119+ #### Local Development with Stripe CLI
120+
121+ You can use the [ Stripe CLI] ( https://stripe.com/docs/stripe-cli ) to forward webhooks to your local development environment:
122+
123+ 1 . ** Install and authenticate the Stripe CLI:**
124+
125+ ``` bash
126+ stripe login
127+ ```
128+
129+ 2 . ** Start listening for webhooks** (note the correct endpoint path):
130+
131+ ``` bash
132+ stripe listen --forward-to localhost:3000/api/payments/stripe/webhooks
133+ ```
134+
135+ 3 . ** Copy the webhook signing secret** that is displayed when you start listening. It will look like:
136+
137+ ```
138+ Ready! Your webhook signing secret is whsec_abc123xyz...
139+ ```
140+
141+ 4 . ** Add the secret to your ` .env ` file** - copy the secret exactly as shown (do not add an extra ` whsec_ ` prefix):
142+
143+ ``` bash
144+ STRIPE_WEBHOOKS_SIGNING_SECRET=whsec_abc123xyz...
145+ ```
146+
147+ 5 . ** Restart your Next.js dev server** to pick up the new environment variable.
148+
149+ 6 . ** Trigger a test webhook** to verify your setup:
150+
151+ ``` bash
152+ stripe trigger payment_intent.succeeded
153+ ```
154+
155+ <Banner type = " warning" >
156+ The webhook signing secret from ` stripe listen ` is ephemeral and can change
157+ each time you restart the CLI. Make sure to update your ` .env ` file and
158+ restart your dev server when you restart ` stripe listen ` .
159+ </Banner >
120160
121161### Frontend usage
122162
@@ -405,8 +445,8 @@ The client side adapter should implement the `PaymentAdapterClient` interface:
405445
406446And for the args use the ` PaymentAdapterClientArgs ` type:
407447
408- | Property | Type | Description |
409- | -------- | -------- | ----------------------------------------------------------------- |
448+ | Property | Type | Description |
449+ | -------- | -------- | ------------------------------------------------------------------ |
410450| ` label ` | ` string ` | (Optional) Allow overriding the default UI label for this adapter. |
411451
412452## Best Practices
0 commit comments