diff --git a/packages/features/ee/billing/billing-service.ts b/packages/features/ee/billing/billing-service.ts index ebbbd9d2d1..745d3c7c2a 100644 --- a/packages/features/ee/billing/billing-service.ts +++ b/packages/features/ee/billing/billing-service.ts @@ -30,6 +30,7 @@ export interface BillingService { quantity: number; metadata?: Record; mode?: "subscription" | "setup" | "payment"; + allowPromotionCodes?: boolean; }): Promise<{ checkoutUrl: string | null; sessionId: string }>; // Price management diff --git a/packages/features/ee/billing/stripe-billling-service.ts b/packages/features/ee/billing/stripe-billling-service.ts index b9d621a32f..953b9a14e2 100644 --- a/packages/features/ee/billing/stripe-billling-service.ts +++ b/packages/features/ee/billing/stripe-billling-service.ts @@ -41,7 +41,16 @@ export class StripeBillingService implements BillingService { } async createSubscriptionCheckout(args: Parameters[0]) { - const { customerId, successUrl, cancelUrl, priceId, quantity, metadata, mode = "subscription" } = args; + const { + customerId, + successUrl, + cancelUrl, + priceId, + quantity, + metadata, + mode = "subscription", + allowPromotionCodes = true, + } = args; const session = await this.stripe.checkout.sessions.create({ customer: customerId, @@ -55,6 +64,7 @@ export class StripeBillingService implements BillingService { quantity, }, ], + allow_promotion_codes: allowPromotionCodes, }); return {