From 6c965805cd084ab85d458a20b6360538c03fc495 Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Sun, 23 Jun 2024 19:59:07 +0200 Subject: [PATCH] stripe: accept 1-year subscriptions as valid (#5797) --- front/lib/plans/stripe.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/lib/plans/stripe.ts b/front/lib/plans/stripe.ts index 0617631af5ae..7f84f63c54a6 100644 --- a/front/lib/plans/stripe.ts +++ b/front/lib/plans/stripe.ts @@ -421,12 +421,12 @@ export function assertStripeSubscriptionItemIsValid({ } if ( - item.price.recurring.interval !== "month" || + !["month", "year"].includes(item.price.recurring.interval) || item.price.recurring.interval_count !== 1 ) { return new Err({ invalidity_message: - "Subscription recurring price has invalid interval, only 1-month intervals are allowed.", + "Subscription recurring price has invalid interval, only 1-month or 1-year intervals are allowed.", }); } }