From bc86f7ac5fae2b38f60ef1da86c6b6f5b842e49c Mon Sep 17 00:00:00 2001 From: Dinwy Date: Wed, 29 May 2024 15:32:29 +0900 Subject: [PATCH] Fix webhook error on ping --- src/app/code/Komoju/Payments/Model/WebhookEvent.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/code/Komoju/Payments/Model/WebhookEvent.php b/src/app/code/Komoju/Payments/Model/WebhookEvent.php index c18d28bf0..a99a955c8 100644 --- a/src/app/code/Komoju/Payments/Model/WebhookEvent.php +++ b/src/app/code/Komoju/Payments/Model/WebhookEvent.php @@ -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); } } @@ -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; } /**