Skip to content

Commit 1848663

Browse files
committed
use Cashier::stripe() to resolve StripeClient
1 parent dc02f92 commit 1848663

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/Livewire/OrderSuccess.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
use App\Enums\Subscription;
66
use Illuminate\Support\Facades\Cache;
7+
use Laravel\Cashier\Cashier;
78
use Livewire\Attributes\Layout;
89
use Livewire\Attributes\Title;
910
use Livewire\Component;
10-
use Stripe\StripeClient;
1111

1212
#[Layout('components.layout')]
1313
#[Title('Thank You for Your Purchase')]
@@ -41,7 +41,7 @@ private function loadEmail(): ?string
4141
return $email;
4242
}
4343

44-
$stripe = app(StripeClient::class);
44+
$stripe = Cashier::stripe();
4545
$checkoutSession = $stripe->checkout->sessions->retrieve($this->checkoutSessionId);
4646

4747
if (! ($email = $checkoutSession?->customer_details?->email)) {
@@ -76,7 +76,7 @@ private function loadSubscription(): ?Subscription
7676
return Subscription::tryFrom($subscription);
7777
}
7878

79-
$stripe = app(StripeClient::class);
79+
$stripe = Cashier::stripe();
8080
$priceId = $stripe->checkout->sessions->allLineItems($this->checkoutSessionId)->first()?->price->id;
8181

8282
if (! $priceId) {

0 commit comments

Comments
 (0)