Skip to content

Commit 7c8776b

Browse files
committed
Merge remote-tracking branch 'upstream/next' into optional-customer-phone
2 parents 00a899c + 6c19e60 commit 7c8776b

File tree

195 files changed

+8034
-365
lines changed

Some content is hidden

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

195 files changed

+8034
-365
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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ jobs:
1414
- uses: actions/checkout@v1
1515
- name: NPM Install
1616
run: npm i
17-
- name: NPM Build
18-
run: npm run build
1917
- name: Unit Test
20-
run: lerna run --scope firestore-stripe-payments-js test
18+
run: lerna run --scope @stripe/firestore-stripe-payments test
2119
- name: API Report
22-
run: lerna run --scope firestore-stripe-payments-js api-extractor
20+
run: lerna run --scope @stripe/firestore-stripe-payments api-extractor

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ README.md
1111
**/functions/lib/**
1212
**/lib/**
1313
**/dist/**
14+
**/markdown/**
1415
coverage
1516

1617
# extension install md files

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Each directory in this repo contains the source code for the extension and a REA
1010

1111
This repository includes the source code for the following extensions:
1212

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

codelab-steps/index.lab.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ document
452452
const functionRef = firebase
453453
.app()
454454
.functions(functionLocation)
455-
.httpsCallable("ext-firestore-stripe-subscriptions-createPortalLink");
455+
.httpsCallable("ext-firestore-stripe-payments-createPortalLink");
456456
const { data } = await functionRef({ returnUrl: window.location.origin });
457457
window.location.assign(data.url);
458458
});

firestore-stripe-invoices/extension.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ contributors:
3838

3939
billingRequired: true # this extension makes requests to a third party API (Stripe)
4040

41+
externalServices:
42+
- name: Stripe
43+
- pricingUri: https://stripe.com/pricing
44+
4145
roles:
4246
- role: firebaseauth.viewer
4347
reason: >-
@@ -137,6 +141,7 @@ params:
137141

138142
- param: STRIPE_API_KEY
139143
label: Stripe API key with restricted access
144+
type: secret
140145
description: >-
141146
What is your Stripe API key for sending invoices?
142147
We recommend creating a new [restricted key](https://stripe.com/docs/keys#limit-access)
@@ -159,6 +164,7 @@ params:
159164

160165
- param: STRIPE_WEBHOOK_SECRET
161166
label: Stripe webhook secret
167+
type: secret
162168
description: >-
163169
This is your signing secret for a Stripe-registered webhook that updates
164170
each Cloud Firestore document with the invoice's status from the Stripe

firestore-stripe-invoices/functions/lib/index.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

firestore-stripe-invoices/functions/lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

firestore-stripe-invoices/functions/src/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,8 @@ export const sendInvoice = functions.handler.firestore.document.onCreate(
138138
}
139139

140140
// Check to see if there's a Stripe customer associated with the email address
141-
let customers: Stripe.ApiList<Stripe.Customer> = await stripe.customers.list(
142-
{ email }
143-
);
141+
let customers: Stripe.ApiList<Stripe.Customer> =
142+
await stripe.customers.list({ email });
144143
let customer: Stripe.Customer;
145144

146145
if (customers.data.length) {
@@ -178,10 +177,10 @@ export const sendInvoice = functions.handler.firestore.document.onCreate(
178177

179178
if (invoice) {
180179
// Email the invoice to the customer
181-
const finalizedInvoice: Stripe.Invoice = await stripe.invoices.sendInvoice(
182-
invoice.id,
183-
{ idempotencyKey: `invoices-sendInvoice-${eventId}` }
184-
);
180+
const finalizedInvoice: Stripe.Invoice =
181+
await stripe.invoices.sendInvoice(invoice.id, {
182+
idempotencyKey: `invoices-sendInvoice-${eventId}`,
183+
});
185184
if (finalizedInvoice.status === 'open') {
186185
// Successfully emailed the invoice
187186
logs.invoiceSent(

0 commit comments

Comments
 (0)