Skip to content

Commit

Permalink
Fix webhook error on ping
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinwy committed May 29, 2024
1 parent 04a145e commit bc86f7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/code/Komoju/Payments/Model/WebhookEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function __construct($requestBody)

if (! empty(json_last_error())) {
$errorMsg = (__("KOMOJU Payments JSON Decoding Failure. Error: %1", json_last_error_msg()));

throw new Komoju\Payments\Exception\InvalidJsonException($errorMsg);
}
}
Expand Down Expand Up @@ -62,7 +61,8 @@ public function status()
*/
public function externalOrderNum()
{
return $this->data()['external_order_num'];
$data = $this->data();
return isset($data['external_order_num']) ? $data['external_order_num'] : null;
}

/**
Expand Down

0 comments on commit bc86f7a

Please sign in to comment.