Skip to content

Commit 1beca29

Browse files
fix(firestore-stripe-payments): minInstances parameter expects number
1 parent 28c4117 commit 1beca29

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

firestore-stripe-payments/functions/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ export default {
2222
stripeConfigCollectionPath: process.env.STRIPE_CONFIG_COLLECTION,
2323
syncUsersOnCreate: process.env.SYNC_USERS_ON_CREATE === 'Sync',
2424
autoDeleteUsers: process.env.DELETE_STRIPE_CUSTOMERS === 'Auto delete',
25-
minCheckoutInstances: process.env.CREATE_CHECKOUT_MIN_INSTANCES ?? 0,
25+
minCheckoutInstances: Number(process.env.CREATE_CHECKOUT_MIN_INSTANCES) ?? 0,
2626
};

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,13 @@ exports.createCustomer = functions.auth
106106
/**
107107
* Create a CheckoutSession or PaymentIntent based on which client is being used.
108108
*/
109-
exports.createCheckoutSession = functions.runWith({
110-
minInstances: config.minCheckoutInstances,
111-
}).firestore
112-
.document(`/${config.customersCollectionPath}/{uid}/checkout_sessions/{id}`)
109+
exports.createCheckoutSession = functions
110+
.runWith({
111+
minInstances: config.minCheckoutInstances,
112+
})
113+
.firestore.document(
114+
`/${config.customersCollectionPath}/{uid}/checkout_sessions/{id}`
115+
)
113116
.onCreate(async (snap, context) => {
114117
const {
115118
client = 'web',

0 commit comments

Comments
 (0)