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 @@ -361,7 +361,13 @@ export const createPortalLink = functions.https.onCall(
361
361
) ;
362
362
}
363
363
try {
364
- const { returnUrl : return_url , locale = 'auto' , configuration } = data ;
364
+ const {
365
+ returnUrl : return_url ,
366
+ locale = 'auto' ,
367
+ configuration,
368
+ flow_data,
369
+ } = data ;
370
+
365
371
// Get stripe customer id
366
372
let customerRecord = ( await admin
367
373
. firestore ( )
@@ -391,6 +397,12 @@ export const createPortalLink = functions.https.onCall(
391
397
if ( configuration ) {
392
398
params . configuration = configuration ;
393
399
}
400
+ if ( flow_data ) {
401
+ // Ignore type-checking because `flow_data` was added to
402
+ // `Stripe.BillingPortal.SessionCreateParams` in
403
+ // [email protected] (API version 2022-12-06)
404
+ ( params as any ) . flow_data = flow_data ;
405
+ }
394
406
const session = await stripe . billingPortal . sessions . create ( params ) ;
395
407
logs . createdBillingPortalLink ( uid ) ;
396
408
return session ;
You can’t perform that action at this time.
0 commit comments