From ea14fff38315d9e1b6c4a8c6fa94c36fbbb9cd44 Mon Sep 17 00:00:00 2001 From: michaelangrivera Date: Fri, 2 Sep 2022 13:16:01 -0400 Subject: [PATCH 1/7] update readme with CLI usage --- firestore-stripe-payments/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/firestore-stripe-payments/README.md b/firestore-stripe-payments/README.md index ec6d39bc..fd3d4aec 100644 --- a/firestore-stripe-payments/README.md +++ b/firestore-stripe-payments/README.md @@ -50,6 +50,16 @@ Then, in the [Stripe Dashboard](https://dashboard.stripe.com): - 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. +#### Installing via Firebase CLI + +When installing via the CLI, be sure to pin the version. + +``` +firebase ext:install stripe/firestore-stripe-payments@0.3.1 --project=projectId_or_alias +``` + +The current version can be found in [extension.yaml](extension.yaml). + #### Billing This extension uses the following Firebase services which may have associated charges: From c097ad7c6f1cac71128a6d4247927eab23f13bed Mon Sep 17 00:00:00 2001 From: michaelangrivera Date: Fri, 2 Sep 2022 14:17:35 -0400 Subject: [PATCH 2/7] add webhook documentation --- firestore-stripe-payments/README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/firestore-stripe-payments/README.md b/firestore-stripe-payments/README.md index fd3d4aec..ad0a1247 100644 --- a/firestore-stripe-payments/README.md +++ b/firestore-stripe-payments/README.md @@ -50,7 +50,7 @@ Then, in the [Stripe Dashboard](https://dashboard.stripe.com): - 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. -#### Installing via Firebase CLI +#### Installing via Firebase CLI When installing via the CLI, be sure to pin the version. @@ -60,6 +60,33 @@ firebase ext:install stripe/firestore-stripe-payments@0.3.1 --project=projectId_ The current version can be found in [extension.yaml](extension.yaml). +#### Using webhooks locally + +If you wish to test the webhooks **locally**, use the following command to configure the extension: + +``` +firebase ext:configure firestore-stripe-payments --local +``` + +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. + +Start the firebase emulator with: + +``` +firebase emulators:start +``` + +Find the functions path associated with the stripe extension, typically it looks like this: + +`http://localhost:3999/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents` + + +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://localhost:3999`. Replace `localhost:3999` with your tunnel url. The end result would look something like `https://1234-1234-1234.ngrok.io/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents` + +Configure your test mode stripe [webhook endpoint](https://stripe.com/docs/webhooks) with the url you just constructed. + +Your local webhooks are now set up. + #### Billing This extension uses the following Firebase services which may have associated charges: From 921fee47cfecbc34bd7137a110b20f3f0e140cdf Mon Sep 17 00:00:00 2001 From: Michael Angelo <55844504+michaelangrivera@users.noreply.github.com> Date: Fri, 2 Sep 2022 14:22:09 -0400 Subject: [PATCH 3/7] lint --- firestore-stripe-payments/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/firestore-stripe-payments/README.md b/firestore-stripe-payments/README.md index ad0a1247..cd5449d4 100644 --- a/firestore-stripe-payments/README.md +++ b/firestore-stripe-payments/README.md @@ -78,14 +78,17 @@ firebase emulators:start Find the functions path associated with the stripe extension, typically it looks like this: -`http://localhost:3999/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents` +- `http://localhost:3999/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents` +- 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://localhost:3999`. Replace `localhost:3999` with your tunnel url. The end result would look something like: -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://localhost:3999`. Replace `localhost:3999` with your tunnel url. The end result would look something like `https://1234-1234-1234.ngrok.io/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents` +``` +https://1234-1234-1234.ngrok.io/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents +``` -Configure your test mode stripe [webhook endpoint](https://stripe.com/docs/webhooks) with the url you just constructed. +- Configure your test mode stripe [webhook endpoint](https://stripe.com/docs/webhooks) with the url you just constructed. -Your local webhooks are now set up. +- Your local webhooks are now set up. #### Billing From b7d8dc1ac52d184c44feaef9dbc61b2e818c7fb8 Mon Sep 17 00:00:00 2001 From: Michael Angelo Rivera <55844504+michaelangeloio@users.noreply.github.com> Date: Mon, 4 Sep 2023 17:02:45 -0400 Subject: [PATCH 4/7] Update firestore-stripe-payments/README.md Co-authored-by: Darren Ackers --- firestore-stripe-payments/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firestore-stripe-payments/README.md b/firestore-stripe-payments/README.md index cd5449d4..a1da4eb8 100644 --- a/firestore-stripe-payments/README.md +++ b/firestore-stripe-payments/README.md @@ -73,7 +73,7 @@ Be sure to configure your test mode [API Key](https://stripe.com/docs/keys) and Start the firebase emulator with: ``` -firebase emulators:start +firebase emulators:start --project=projectId_or_alias ``` Find the functions path associated with the stripe extension, typically it looks like this: From 73bd06d7d04b5f9bc9ca1b88f1ee99359f574f46 Mon Sep 17 00:00:00 2001 From: Michael Angelo Rivera <55844504+michaelangeloio@users.noreply.github.com> Date: Mon, 4 Sep 2023 17:02:49 -0400 Subject: [PATCH 5/7] Update firestore-stripe-payments/README.md Co-authored-by: Darren Ackers --- firestore-stripe-payments/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firestore-stripe-payments/README.md b/firestore-stripe-payments/README.md index a1da4eb8..9e6cd931 100644 --- a/firestore-stripe-payments/README.md +++ b/firestore-stripe-payments/README.md @@ -78,7 +78,7 @@ firebase emulators:start --project=projectId_or_alias Find the functions path associated with the stripe extension, typically it looks like this: -- `http://localhost:3999/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents` +- `http://192.0.0.1:5001/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents` - 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://localhost:3999`. Replace `localhost:3999` with your tunnel url. The end result would look something like: From 60e2351de095ef6b1126e52fc66709b8315eee42 Mon Sep 17 00:00:00 2001 From: Michael Angelo Rivera <55844504+michaelangeloio@users.noreply.github.com> Date: Mon, 4 Sep 2023 17:02:55 -0400 Subject: [PATCH 6/7] Update firestore-stripe-payments/README.md Co-authored-by: Darren Ackers --- firestore-stripe-payments/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firestore-stripe-payments/README.md b/firestore-stripe-payments/README.md index 9e6cd931..ac63414a 100644 --- a/firestore-stripe-payments/README.md +++ b/firestore-stripe-payments/README.md @@ -80,7 +80,7 @@ Find the functions path associated with the stripe extension, typically it looks - `http://192.0.0.1:5001/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents` -- 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://localhost:3999`. Replace `localhost:3999` with your tunnel url. The end result would look something like: +- 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: ``` https://1234-1234-1234.ngrok.io/{projectId}/{region}/ext-firestore-stripe-payments-handleWebhookEvents From 1bf2cb79dcda28536ce01604ab4a6699f7b23071 Mon Sep 17 00:00:00 2001 From: Michael Angelo Rivera <55844504+michaelangeloio@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:39:48 -0400 Subject: [PATCH 7/7] Update firestore-stripe-payments/README.md Co-authored-by: Darren Ackers --- firestore-stripe-payments/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firestore-stripe-payments/README.md b/firestore-stripe-payments/README.md index ac63414a..0986fead 100644 --- a/firestore-stripe-payments/README.md +++ b/firestore-stripe-payments/README.md @@ -55,7 +55,11 @@ Then, in the [Stripe Dashboard](https://dashboard.stripe.com): When installing via the CLI, be sure to pin the version. ``` -firebase ext:install stripe/firestore-stripe-payments@0.3.1 --project=projectId_or_alias +firebase ext:install invertase/firestore-stripe-payments --project=projectId_or_alias + +Alternatively for local source: + +firebase ext:install . --project=projectId_or_alias ``` The current version can be found in [extension.yaml](extension.yaml).