Skip to content

Commit

Permalink
Fetch using stripe intent model before using cart meta (#2081)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson authored Jan 24, 2025
1 parent 35d9fef commit 11261a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/stripe/src/Jobs/ProcessStripeWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Lunar\Facades\Payments;
use Lunar\Models\Cart;
use Lunar\Models\Order;
use Lunar\Stripe\Models\StripePaymentIntent;

class ProcessStripeWebhook implements ShouldQueue
{
Expand Down Expand Up @@ -48,7 +49,8 @@ public function handle()
}

if (! $order) {
$cart = Cart::where('meta->payment_intent', '=', $this->paymentIntentId)->first();
$cart = StripePaymentIntent::where('intent_id', $this->paymentIntentId)->first()?->cart ?:
Cart::where('meta->payment_intent', '=', $this->paymentIntentId)->first();
}

if (! $cart && ! $order) {
Expand Down

0 comments on commit 11261a9

Please sign in to comment.