Skip to content

Commit 456cca4

Browse files
dackers86pr-Mais
authored andcommitted
docs(*): readded installaton guidelines
1 parent cc1fe2a commit 456cca4

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

firestore-stripe-payments/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,49 @@ Then, in the [Stripe Dashboard](https://dashboard.stripe.com):
6060

6161
- Create a new [restricted key](https://stripe.com/docs/keys#limit-access) with write access for the "Customers", "Checkout Sessions" and "Customer portal" resources, and read-only access for the "Subscriptions" and "Prices" resources.
6262

63+
#### Installing via Firebase CLI
64+
65+
When installing via the CLI, be sure to pin the version.
66+
67+
```
68+
firebase ext:install invertase/firestore-stripe-payments --project=projectId_or_alias
69+
Alternatively for local source:
70+
firebase ext:install . --project=projectId_or_alias
71+
```
72+
73+
The current version can be found in [extension.yaml](extension.yaml).
74+
75+
#### Using webhooks locally
76+
77+
If you wish to test the webhooks **locally**, use the following command to configure the extension:
78+
79+
```
80+
firebase ext:configure firestore-stripe-payments --local
81+
```
82+
83+
Be sure to configure your test mode [API Key](https://stripe.com/docs/keys) and webhook [signing secret](https://stripe.com/docs/webhooks/signatures#:~:text=Before%20you%20can%20verify%20signatures,secret%20key%20for%20each%20endpoint.) when prompted.
84+
85+
Start the firebase emulator with:
86+
87+
```
88+
firebase emulators:start --project=projectId_or_alias
89+
```
90+
91+
Find the functions path associated with the stripe extension, typically it looks like this:
92+
93+
- `http://192.0.0.1:5001/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents`
94+
95+
- You can tunnel your local endpoint using a tool like [ngrok](https://ngrok.com/). In this case you will tunnel the localhost domain and port `http://127.0.01:5001`. Replace `127.0.0.1:5001` with your tunnel url. The end result would look something like:
96+
97+
```
98+
https://1234-1234-1234.ngrok.io/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents
99+
```
100+
101+
- Configure your test mode stripe [webhook endpoint](https://stripe.com/docs/webhooks) with the url you just constructed.
102+
103+
- Your local webhooks are now set up.
104+
105+
63106
#### Billing
64107

65108
This extension uses the following Firebase services which may have associated charges:

0 commit comments

Comments
 (0)