forked from jhuleatt/create-invoice-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextension.yaml
91 lines (85 loc) · 2.85 KB
/
extension.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: create-stripe-invoice
version: 0.0.1
specVersion: v1beta
displayName: Email an invoice to a customer
resources:
- name: sendInvoice
type: firebaseextensions.v1beta.function
properties:
sourceDirectory: .
location: ${LOCATION}
eventTrigger:
eventType: providers/cloud.firestore/eventTypes/document.create
resource: projects/${PROJECT_ID}/databases/(default)/documents/${DB_PATH}/{id}
- name: updateInvoice
type: firebaseextensions.v1beta.function
properties:
sourceDirectory: .
location: ${LOCATION}
httpsTrigger: {}
roles:
- role: firebaseauth.viewer
reason: Allows the extension to read user data from Auth.
- role: datastore.user
reason:
Allows the extension's webhook to update invoices in Firestore when called
by Stripe.
params:
- param: LOCATION
type: select
label: Deployment location
description: >-
Where should the extension be deployed? You usually want a location close
to your database. For help selecting a location, refer to the [location
selection guide](https://firebase.google.com/docs/functions/locations).
options:
- label: Iowa (us-central1)
value: us-central1
- label: South Carolina (us-east1)
value: us-east1
- label: Northern Virginia (us-east4)
value: us-east4
- label: Belgium (europe-west1)
value: europe-west1
- label: London (europe-west2)
value: europe-west2
- label: Hong Kong (asia-east2)
value: asia-east2
- label: Tokyo (asia-northeast1)
value: asia-northeast1
default: us-central1
required: true
- param: DB_PATH
type: string
label: Collection
default: invoices
required: true
description: >-
The DB path to the Firestore collection.
- param: STRIPE_SECRET_KEY
type: string
label: Stripe secret API key
default: sk_1234567890
required: true
description: >-
Your Stripe secret API key that is used to send the invoice. You can find
your API keys in your [Stripe
dashboard.](https://dashboard.stripe.com/apikeys)
- param: STRIPE_ENDPOINT_SECRET
type: string
label: Stripe webhook secret
default: whsec_1234567890
required: false
description: >-
If you are testing your webhook locally with the Stripe CLI you can find
the endpoint's secret by running `stripe listen`. Otherwise, you'll need
to leave this blank for now. Once you finish installing your extension,
follow the postinstall instructions for configuring your webhook.
- param: DAYS_UNTIL_DUE_DEFAULT
type: string
label: Days until payment is due
default: 7
required: true
description: >-
The number of days the customer has to pay the invoice before it's closed.
You can later override this default value for each invoice.