Skip to content

Commit

Permalink
[7.x] Handle Stripe webhooks without order_id metadata (#1181)
Browse files Browse the repository at this point in the history
* Check if Stripe webhook contains a order_id

* fix style
  • Loading branch information
Web10-Joris authored Nov 22, 2024
1 parent 7addd31 commit 9b011d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Gateways/Builtin/StripeGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ public function webhook(Request $request)

$data = $payload['data']['object'];

if (! isset($data['metadata']['order_id'])) {
return new Response('Webhook received but no order_id found', 202);
}

if ($method === 'handlePaymentIntentSucceeded') {
$order = Order::find($data['metadata']['order_id']);

Expand Down

0 comments on commit 9b011d8

Please sign in to comment.