Skip to content

Commit fa2f3b1

Browse files
I have successfully pulled the changes from the upstream/next branch into the local next branch, which created a merge commit. The code is now synced.
1 parent 0337e85 commit fa2f3b1

File tree

292 files changed

+31462
-2660
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

292 files changed

+31462
-2660
lines changed

.github/ISSUE_TEMPLATE/1.Bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ about: Create a bug report for one of the extensions.
55

66
# Bug report
77

8-
- Extension name: [e.g. `firestore-stripe-subscriptions`]
8+
- Extension name: [e.g. `firestore-stripe-payments`]
99

1010
## Describe the bug
1111

.github/ISSUE_TEMPLATE/2.Feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ about: Request a new feature or extension.
55

66
# Feature request
77

8-
- Extension name: [e.g. `firestore-stripe-subscriptions`, or leave empty if suggesting a new extension]
8+
- Extension name: [e.g. `firestore-stripe-payments`, or leave empty if suggesting a new extension]
99

1010
## Is your feature request related to a problem? Please describe.
1111

.github/workflows/test.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches:
6+
- next
7+
- master
8+
pull_request:
9+
branches:
10+
- "**"
11+
12+
jobs:
13+
nodejs:
14+
runs-on: ubuntu-latest
15+
concurrency:
16+
group: ${{ github.workflow }}
17+
cancel-in-progress: false
18+
strategy:
19+
matrix:
20+
node: ["20"]
21+
max-parallel: 1
22+
name: node.js_${{ matrix.node }}_test
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Setup node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node }}
29+
cache: "npm"
30+
cache-dependency-path: "**/package-lock.json"
31+
32+
- name: Install Dependencies
33+
run: npm install
34+
35+
- name: Build emulator functions
36+
run: |
37+
cd firestore-stripe-payments/_emulator/functions && npm i && cd ../../..
38+
cd firestore-stripe-web-sdk/_emulator/functions && npm i && cd ../../..
39+
40+
- name: Install Firebase CLI
41+
uses: nick-invision/retry@v3
42+
with:
43+
timeout_minutes: 10
44+
retry_wait_seconds: 60
45+
max_attempts: 3
46+
command: npm i -g firebase-tools@14
47+
48+
- name: Install Stripe CLI
49+
run: |
50+
STRIPE_VERSION=$(curl -s https://api.github.com/repos/stripe/stripe-cli/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
51+
curl -L -o stripe_linux_x86_64.tar.gz https://github.com/stripe/stripe-cli/releases/download/${STRIPE_VERSION}/stripe_${STRIPE_VERSION#v}_linux_x86_64.tar.gz
52+
tar -xzf stripe_linux_x86_64.tar.gz
53+
sudo mv stripe /usr/local/bin/
54+
55+
- name: Run Tests
56+
run: npm test
57+
env:
58+
STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }}

.github/workflows/validate.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Validate
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "**"
7+
8+
jobs:
9+
formatting:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: NPM Install & Build
14+
run: npm i
15+
- name: Prettier Lint Check
16+
run: npm run lint

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ build
1111
local.properties
1212
coverage
1313
package-lock.json
14-
yarn.lock
14+
yarn.lock
15+
firestore-stripe-payments/_emulator/extensions/firestore-stripe-payments.secret.local
16+
*.secret.local# Trigger CI

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
api-extractor.json
12
package.json
23
extension.yaml
34
package-lock.json
@@ -6,12 +7,15 @@ package-lock.json
67

78
# generated files
89
README.md
10+
**/etc/**
911
**/functions/lib/**
1012
**/lib/**
1113
**/dist/**
14+
**/markdown/**
1215
coverage
1316

1417
# extension install md files
1518
# - excluded as prettier escapes variables e.g. `${PROJECT_ID}` becomes `\${PROJECT_ID}`
19+
CHANGELOG.md
1620
POSTINSTALL.md
1721
PREINSTALL.md

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# UPDATE 2023-10-08:
2+
This project has now being officially transferred to [Invertase](https://github.com/invertase), who will maintain this extension going forward. Please see [this issue](https://github.com/stripe/stripe-firebase-extensions/issues/524) for more details.
3+
It is now recommended to uninstall the `stripe/firestore-stripe-payments` extension and install `invertase/firestore-stripe-payments` from the Firebase Extension Hub.
4+
5+
Alternatively, you can also use the following link to convert your current installation to the Invertase version
6+
7+
`https://console.firebase.google.com/project/_/extensions/install?instanceId=STRIPE_EXTENSION_INSTANCE_ID&ref=invertase%2Ffirestore-stripe-payments@0.3.12`
8+
19
# Stripe Firebase Extensions
210

311
This repository contains the source code for Firebase Extensions that enable payment functionality. Created and tested by Stripe, these official Stripe Firebase extensions are reliable and secure. To learn more about Firebase Extensions, including how to install them in your Firebase projects, visit the [Firebase documentation](https://firebase.google.com/docs/extensions).
@@ -10,9 +18,9 @@ Each directory in this repo contains the source code for the extension and a REA
1018

1119
This repository includes the source code for the following extensions:
1220

13-
1. Run Subscription Payments with Stripe
14-
- [Homepage](https://firebase.google.com/products/extensions/firestore-stripe-subscriptions)
15-
- [Source code](./firestore-stripe-subscriptions)
21+
1. Stripe backend for web, mobile, and subscription payments
22+
- [Homepage](https://firebase.google.com/products/extensions/firestore-stripe-payments)
23+
- [Source code](./firestore-stripe-payments)
1624
1. Send invoices using Stripe
1725
- [Homepage](https://firebase.google.com/products/extensions/firestore-stripe-invoices)
18-
- [Source code](./firestore-stripe-invoices)
26+
- [Source code](./firestore-stripe-invoices)

codelab-steps/index.lab.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ function startDataListeners() {
282282
.collection("prices")
283283
.orderBy("unit_amount")
284284
.get();
285-
if (!"content" in document.createElement("template")) {
285+
if ((!"content") in document.createElement("template")) {
286286
console.error("Your browser doesn't support HTML template elements.");
287287
return;
288288
}
@@ -402,14 +402,13 @@ function startDataListeners() {
402402
// In this implementation we only expect one Subscription to exist
403403
const subscription = snapshot.docs[0].data();
404404
const priceData = (await subscription.price.get()).data();
405-
document.querySelector(
406-
"#my-subscription p"
407-
).textContent = `You are paying ${new Intl.NumberFormat("en-US", {
408-
style: "currency",
409-
currency: priceData.currency,
410-
}).format((priceData.unit_amount / 100).toFixed(2))} per ${
411-
priceData.interval
412-
}`;
405+
document.querySelector("#my-subscription p").textContent =
406+
`You are paying ${new Intl.NumberFormat("en-US", {
407+
style: "currency",
408+
currency: priceData.currency,
409+
}).format((priceData.unit_amount / 100).toFixed(2))} per ${
410+
priceData.interval
411+
}`;
413412
});
414413
}
415414
```
@@ -452,7 +451,7 @@ document
452451
const functionRef = firebase
453452
.app()
454453
.functions(functionLocation)
455-
.httpsCallable("ext-firestore-stripe-subscriptions-createPortalLink");
454+
.httpsCallable("ext-firestore-stripe-payments-createPortalLink");
456455
const { data } = await functionRef({ returnUrl: window.location.origin });
457456
window.location.assign(data.url);
458457
});
@@ -526,7 +525,6 @@ Check out some of these other extensions:
526525

527526
- [Check out the Cloud Functions for Firebase codelab](https://codelabs.developers.google.com/codelabs/firebase-cloud-functions/#0)
528527
- [Create Stripe customers and charge them on Firestore write](https://github.com/firebase/functions-samples/tree/master/stripe)
529-
- [Firebase mobile payments: Android & iOS with Cloud Functions for Firebase](https://github.com/stripe-samples/firebase-mobile-payments)
530528

531529
### Learn more about Stripe
532530

firestore-stripe-invoices/CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
## Version 0.2.7 - 2025-03-24
2+
3+
[fix] - upgrade resources to node 20
4+
5+
### Version 0.2.6 - 2024-02-14
6+
7+
[feat] - Added `payments` tag to the extension to allow for easier discovery in the marketplace.
8+
9+
### Version 0.2.5 - 2023-12-21
10+
11+
[fix] - upgraded the resources to node 18 [#583]
12+
13+
## Version 0.2.4 - 2023-10-08
14+
15+
[fix] - updated extension icons
16+
17+
[fix] - updated external services to correct pricing uri configuration (#360)
18+
19+
[feat] - added new secret param type for ext config
20+
21+
[feat] - add Warsaw Cloud Function Location
22+
23+
[fix] - Only one of email or uid.
24+
25+
[feat] - Add support for invoiceItem quantity. (#2)
26+
27+
## Version 0.2.3 - 2023-08-21
28+
[chore] Updated naming and upgraded to node18
29+
30+
[fix] Updated icons
31+
32+
[fix] updated appinfo versioning
33+
34+
## Version 0.2.2 - 2023-08-14
35+
This extension has been formally transferred to Invertase. See the updated README for more details.
36+
37+
## Version 0.2.1 - 2022-08-24
38+
[chore] Added `package-lock.json` to version control to prevent installation issues. [#426]
39+
40+
## Version 0.2.0 - 2022-04-26
41+
42+
[feat] - Add `invoice.paid`, `invoice.updated` to permitted webhook events list. #356
43+
144
## Version 0.1.6 - 2021-02-11
245

346
[feat] - Add `stripeInvoiceUrl` to the invoice object in Cloud Firestore. #132

firestore-stripe-invoices/POSTINSTALL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ To test out the extension:
1111

1212
1. Go to your [Cloud Firestore dashboard](https://console.firebase.google.com/project/${param:PROJECT_ID}/firestore/data) in the Firebase console.
1313

14-
1. If it doesn't already exist, create the collection you specified during installation: `${param:INVOICES_COLLECTION}`
14+
2. If it doesn't already exist, create the collection you specified during installation: `${param:INVOICES_COLLECTION}`
1515

16-
1. Test the invoicing functionality by adding a document to your collection, for example:
16+
3. Test the invoicing functionality by adding a document to your collection, for example:
1717

1818
```js
1919
{
@@ -32,7 +32,7 @@ To test out the extension:
3232
}
3333
```
3434

35-
1. Look in your [Stripe dashboard](https://dashboard.stripe.com/test/invoices) for a record of the test invoice.
35+
4. Look in your [Stripe dashboard](https://dashboard.stripe.com/test/invoices) for a record of the test invoice.
3636

3737
**Note:** Stripe only sends an email to your customer when the extension is using Stripe's live mode but not when using test mode. If you configured your extension with a test mode API key, you'll need to [reconfigure](https://console.firebase.google.com/project/${param:PROJECT_ID}/extensions/instances/${param:EXT_INSTANCE_ID}?tab=config) your installed extension with your [live mode key](https://dashboard.stripe.com/apikeys) before actually using the extension for customer invoicing.
3838

@@ -204,11 +204,11 @@ Here's how to set up the webhook and configure your extension to use it:
204204

205205
1. Go to the [Stripe dashboard.](https://dashboard.stripe.com/webhooks)
206206

207-
1. Use the URL of your extension's function as the endpoint URL. Here's your function's URL: `${function:updateInvoice.url}`
207+
2. Use the URL of your extension's function as the endpoint URL. Here's your function's URL: `${function:updateInvoice.url}`
208208

209-
1. Select all the invoice events.
209+
3. Select all the invoice events.
210210

211-
1. Using the Firebase console or Firebase CLI, [reconfigure](https://console.firebase.google.com/project/${param:PROJECT_ID}/extensions/instances/${param:EXT_INSTANCE_ID}?tab=config) your extension with your webhook’s signing secret (such as, `whsec_12345678`). Enter the value in the parameter called `Stripe webhook secret`.
211+
2. Using the Firebase console or Firebase CLI, [reconfigure](https://console.firebase.google.com/project/${param:PROJECT_ID}/extensions/instances/${param:EXT_INSTANCE_ID}?tab=config) your extension with your webhook’s signing secret (such as, `whsec_12345678`). Enter the value in the parameter called `Stripe webhook secret`.
212212

213213
The webhook fires whenever the invoice's status updates in the Stripe dashboard. The first time the webhook fires, it finds the relevant document in Cloud Firestore, then creates two fields: `stripeInvoiceStatus` and `lastStripeEvent`. If the webhook fires subsequent times for the same invoice, it will update those same fields.
214214

0 commit comments

Comments
 (0)