Skip to content

Scheduling infrastructure for absolutely everyone.

allow promotion codes (#20387)

sean-brydon6bd11009a8e7
diff --git a/packages/features/ee/billing/billing-service.ts b/packages/features/ee/billing/billing-service.ts
index ebbbd9d2d13..745d3c7c2ab 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<string, string | number>;
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 b9d621a32f4..953b9a14e2d 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<BillingService["createSubscriptionCheckout"]>[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 {