File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed
resources/views/components Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ public function name(): string
55
55
56
56
public function stripePriceId (): string
57
57
{
58
- return config ("subscriptions.plans. {$ this ->value }.stripe_price_id " );
58
+ // EAP ends June 1st at midnight UTC
59
+ return now ()->isBefore ('2025-06-01 00:00:00 ' )
60
+ ? config ("subscriptions.plans. {$ this ->value }.stripe_price_id_eap " )
61
+ : config ("subscriptions.plans. {$ this ->value }.stripe_price_id " );
59
62
}
60
63
61
64
public function stripePaymentLink (): string
Original file line number Diff line number Diff line change @@ -24,8 +24,15 @@ public function handlePurchaseRequest(array $data)
24
24
return $ this ->createCheckoutSession ($ data ['plan ' ], $ user );
25
25
}
26
26
27
- public function createCheckoutSession (string $ plan , ?User $ user = null )
27
+ public function createCheckoutSession (? string $ plan , ?User $ user = null )
28
28
{
29
+ // This method is somehow getting called without a plan being passed in.
30
+ // Not sure how (probably folks hacking or a bot thing),
31
+ // but we will just return early when this happens.
32
+ if (! $ plan ) {
33
+ return ;
34
+ }
35
+
29
36
// If a user isn't passed into this method, Livewire will instantiate
30
37
// a new User. So we need to check that the user exists before using it,
31
38
// and then use the authenticated user as a fallback.
Original file line number Diff line number Diff line change 33
33
<env name =" STRIPE_MINI_PRICE_ID" value =" price_mini" />
34
34
<env name =" STRIPE_PRO_PRICE_ID" value =" price_pro" />
35
35
<env name =" STRIPE_MAX_PRICE_ID" value =" price_max" />
36
+ <env name =" STRIPE_MINI_PRICE_ID_EAP" value =" price_mini_eap" />
37
+ <env name =" STRIPE_PRO_PRICE_ID_EAP" value =" price_pro_eap" />
38
+ <env name =" STRIPE_MAX_PRICE_ID_EAP" value =" price_max_eap" />
36
39
<env name =" STRIPE_MINI_PAYMENT_LINK" value =" https://buy.stripe.com/test_mini" />
37
40
<env name =" STRIPE_PRO_PAYMENT_LINK" value =" https://buy.stripe.com/test_pro" />
38
41
<env name =" STRIPE_MAX_PAYMENT_LINK" value =" https://buy.stripe.com/test_max" />
You can’t perform that action at this time.
0 commit comments