@@ -29,8 +29,10 @@ public static function fromStripePriceId(string $priceId): self
2929 config ('subscriptions.plans.mini.stripe_price_id ' ),
3030 config ('subscriptions.plans.mini.stripe_price_id_eap ' ) => self ::Mini,
3131 config ('subscriptions.plans.pro.stripe_price_id ' ),
32+ config ('subscriptions.plans.pro.stripe_price_id_discounted ' ),
3233 config ('subscriptions.plans.pro.stripe_price_id_eap ' ) => self ::Pro,
3334 config ('subscriptions.plans.max.stripe_price_id ' ),
35+ config ('subscriptions.plans.max.stripe_price_id_discounted ' ),
3436 config ('subscriptions.plans.max.stripe_price_id_eap ' ) => self ::Max,
3537 default => throw new RuntimeException ("Unknown Stripe price id: {$ priceId }" ),
3638 };
@@ -53,12 +55,18 @@ public function name(): string
5355 return config ("subscriptions.plans. {$ this ->value }.name " );
5456 }
5557
56- public function stripePriceId (bool $ forceEap = false ): string
58+ public function stripePriceId (bool $ forceEap = false , bool $ discounted = false ): string
5759 {
5860 // EAP ends June 1st at midnight UTC
59- return now ()->isBefore ('2025-06-01 00:00:00 ' ) || $ forceEap
60- ? config ("subscriptions.plans. {$ this ->value }.stripe_price_id_eap " )
61- : config ("subscriptions.plans. {$ this ->value }.stripe_price_id " );
61+ if (now ()->isBefore ('2025-06-01 00:00:00 ' ) || $ forceEap ) {
62+ return config ("subscriptions.plans. {$ this ->value }.stripe_price_id_eap " );
63+ }
64+
65+ if ($ discounted ) {
66+ return config ("subscriptions.plans. {$ this ->value }.stripe_price_id_discounted " );
67+ }
68+
69+ return config ("subscriptions.plans. {$ this ->value }.stripe_price_id " );
6270 }
6371
6472 public function stripePaymentLink (): string
0 commit comments