Skip to content

Commit

Permalink
Merge branch 'next' into esm-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pr-Mais authored Jul 3, 2024
2 parents 238bb77 + 6c5966d commit fb716e5
Show file tree
Hide file tree
Showing 191 changed files with 19,859 additions and 3,382 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,48 @@ on:

jobs:
nodejs:
if:
github.event_name == 'push' || (github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
strategy:
matrix:
node: ["14", "16"]
node: ["18"]
max-parallel: 1
name: node.js_${{ matrix.node }}_test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install cloudflared
run: |
wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
sudo apt-get update
sudo apt-get install -f
shell: /usr/bin/bash -e {0}

- name: NPM install
run: npm install
- name: Install firebase CLI
uses: nick-invision/retry@v1
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
retry_wait_seconds: 60
max_attempts: 3
command: npm i -g firebase-tools
- name: Use extension commands
run: firebase --open-sesame extdev
- name: mask env paramaters
run: echo "::add-mask::$STRIPE_WEBHOOK_SECRET"
- name: Run tests with coverage
run: npm run test
env:
STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
CLOUDFLARE_SECRET: ${{ secrets.CLOUDFLARE_SECRET }}
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: NPM Install & Build
run: npm i
- name: Prettier Lint Check
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# UPDATE 2023-10-08:
This project has now being officailly 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.
It is now reccomended to uninstall the `stripe/firestore-stripe-payments` extension and install `invertase/firestore-stripe-payments` from the Firebase Extension Hub.

Alternativley, you can also use the following link to convert your current installation to the Invertase version

`https://console.firebase.google.com/project/_/extensions/install?instanceId=STRIPE_EXTENSION_INSTANCE_ID&ref=invertase%[email protected]`

# Stripe Firebase Extensions

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).
Expand All @@ -15,4 +23,4 @@ This repository includes the source code for the following extensions:
- [Source code](./firestore-stripe-payments)
1. Send invoices using Stripe
- [Homepage](https://firebase.google.com/products/extensions/firestore-stripe-invoices)
- [Source code](./firestore-stripe-invoices)
- [Source code](./firestore-stripe-invoices)
32 changes: 32 additions & 0 deletions firestore-stripe-invoices/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
### Version 0.2.6 - 2024-02-14

[feat] - Added `payments` tag to the extension to allow for easier discovery in the marketplace.

### Version 0.2.5 - 2023-12-21

[fix] - upgraded the resources to node 18 [#583]

## Version 0.2.4 - 2023-10-08

[fix] - updated extension icons

[fix] - updated external services to correct pricing uri configuration (#360)

[feat] - added new secret param type for ext config

[feat] - add Warsaw Cloud Function Location

[fix] - Only one of email or uid.

[feat] - Add support for invoiceItem quantity. (#2)

## Version 0.2.3 - 2023-08-21
[chore] Updated naming and upgraded to node18

[fix] Updated icons

[fix] updated appinfo versioning

## Version 0.2.2 - 2023-08-14
This extension has been formally transferred to Invertase. See the updated README for more details.

## Version 0.2.1 - 2022-08-24
[chore] Added `package-lock.json` to version control to prevent installation issues. [#426]

Expand Down
12 changes: 6 additions & 6 deletions firestore-stripe-invoices/POSTINSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ To test out the extension:

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

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

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

```js
{
Expand All @@ -32,7 +32,7 @@ To test out the extension:
}
```

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

**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.

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

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

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

1. Select all the invoice events.
3. Select all the invoice events.

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`.
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`.

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.

Expand Down
9 changes: 6 additions & 3 deletions firestore-stripe-invoices/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
# limitations under the License.

name: firestore-stripe-invoices
version: 0.2.1
version: 0.2.6
specVersion: v1beta

displayName: Send Invoices using Stripe
description: Creates and sends brandable customer invoices using the Stripe payments platform.

icon: icon.png
tags: [payments]

license: Apache-2.0

sourceUrl: https://github.com/stripe/stripe-firebase-extensions/tree/master/firestore-stripe-invoices
Expand Down Expand Up @@ -60,7 +63,7 @@ resources:
in your specified Cloud Firestore collection
properties:
location: ${LOCATION}
runtime: nodejs10
runtime: nodejs18
eventTrigger:
eventType: providers/cloud.firestore/eventTypes/document.create
resource: projects/${PROJECT_ID}/databases/(default)/documents/${INVOICES_COLLECTION}/{id}
Expand All @@ -73,7 +76,7 @@ resources:
a new Stripe Event is received.
properties:
location: ${LOCATION}
runtime: nodejs10
runtime: nodejs18
httpsTrigger: {}

params:
Expand Down
Loading

0 comments on commit fb716e5

Please sign in to comment.