Stripe: allow passing custom parameters to the Checkout session

This commit is contained in:
gbuomprisco
2024-09-20 18:38:44 +02:00
parent 98b77d8ee1
commit f2118e97f8
2 changed files with 2 additions and 0 deletions

View File

@@ -15,4 +15,5 @@ export const CreateBillingCheckoutSchema = z.object({
quantity: z.number(),
}),
),
metadata: z.record(z.string()).optional(),
});

View File

@@ -36,6 +36,7 @@ export async function createStripeCheckout(
trial_period_days: params.plan.trialDays,
metadata: {
accountId: params.accountId,
...(params.metadata ?? {}),
},
}
: {};