File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
firestore-stripe-payments/functions/src Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,13 @@ export const createPortalLink = functions.https.onCall(
338
338
) ;
339
339
}
340
340
try {
341
- const { returnUrl : return_url , locale = 'auto' , configuration } = data ;
341
+ const {
342
+ returnUrl : return_url ,
343
+ locale = 'auto' ,
344
+ configuration,
345
+ flow_data,
346
+ } = data ;
347
+
342
348
// Get stripe customer id
343
349
const customer = (
344
350
await admin
@@ -355,6 +361,12 @@ export const createPortalLink = functions.https.onCall(
355
361
if ( configuration ) {
356
362
params . configuration = configuration ;
357
363
}
364
+ if ( flow_data ) {
365
+ // Ignore type-checking because `flow_data` was added to
366
+ // `Stripe.BillingPortal.SessionCreateParams` in
367
+ // [email protected] (API version 2022-12-06)
368
+ ( params as any ) . flow_data = flow_data ;
369
+ }
358
370
const session = await stripe . billingPortal . sessions . create ( params ) ;
359
371
logs . createdBillingPortalLink ( uid ) ;
360
372
return session ;
You can’t perform that action at this time.
0 commit comments