Skip to content

Commit 4a2b2b7

Browse files
committed
Merge branch 'main' into eap-ending
# Conflicts: # resources/views/components/eap-banner.blade.php
2 parents 500ba58 + 267411c commit 4a2b2b7

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

app/Enums/Subscription.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ public function name(): string
5555

5656
public function stripePriceId(): string
5757
{
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");
5962
}
6063

6164
public function stripePaymentLink(): string

app/Livewire/MobilePricing.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ public function handlePurchaseRequest(array $data)
2424
return $this->createCheckoutSession($data['plan'], $user);
2525
}
2626

27-
public function createCheckoutSession(string $plan, ?User $user = null)
27+
public function createCheckoutSession(?string $plan, ?User $user = null)
2828
{
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+
2936
// If a user isn't passed into this method, Livewire will instantiate
3037
// a new User. So we need to check that the user exists before using it,
3138
// and then use the authenticated user as a fallback.

phpunit.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
<env name="STRIPE_MINI_PRICE_ID" value="price_mini"/>
3434
<env name="STRIPE_PRO_PRICE_ID" value="price_pro"/>
3535
<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"/>
3639
<env name="STRIPE_MINI_PAYMENT_LINK" value="https://buy.stripe.com/test_mini"/>
3740
<env name="STRIPE_PRO_PAYMENT_LINK" value="https://buy.stripe.com/test_pro"/>
3841
<env name="STRIPE_MAX_PAYMENT_LINK" value="https://buy.stripe.com/test_max"/>

resources/views/components/eap-banner.blade.php

Whitespace-only changes.

0 commit comments

Comments
 (0)