Skip to content

Commit 17fef46

Browse files
authored
101-stripe-connect-documentation added stripe connect documentation (#102)
1 parent 537d556 commit 17fef46

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

docs/assets/ngrok-server.png

21.9 KB
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
# Test Stripe Connect Webhook locally
5+
If you are using Stripe Connect, you will now have two stripe webhooks to listen to. However, each of these webhooks need to have a different signing secret. If you use the [Stripe CLI](https://stripe.com/docs/stripe-cli) the same way we used it on [Test Webhooks](./test-webhooks.md), you will get the same signing secret for both webhooks. This results in stripe connect webhooks and stripe webhooks leaking events to one another.
6+
7+
To fix this issue, we use [Ngrok](https://ngrok.com/) to create a secure tunnel to our local webhook server:
8+
9+
1. [Download Ngrok](https://download.ngrok.com/downloads/linux) and install it on your machine.
10+
11+
2. Spin up a tunnel using ngrok. The tunnel will forward stripe webhook and connect webhook to your supabase edge functions:
12+
```
13+
ngrok http 54321
14+
```
15+
![](../assets/ngrok-server.png)
16+
17+
3. Navigate to the [Stripe Dashboard](https://dashboard.stripe.com) search for webhooks in the search bar. Connect two seperate endpoints from the url provided by ngrok as highlighted in the image above. You need to create two seperate webhooks for the stripe connect and stripe webhooks:
18+
```
19+
https://<ngrok-url>/functions/v1/stripe_connect_webhook
20+
https://<ngrok-url>/functions/v1/stripe_webhook
21+
```
22+
4. Finally, copy the signin secrets for each of the webhooks and paste them into your supabase .env file as `STRIPE_CONNECT_WEBHOOK_SECRET` and `STRIPE_WEBHOOK_SECRET` respectively. Note that the two secrets should be different from each other.

0 commit comments

Comments
 (0)