From 8a2e0910529e3deb07e5eeeee5390e82948270d1 Mon Sep 17 00:00:00 2001 From: daniel21703 Date: Tue, 2 Apr 2024 16:52:18 +0300 Subject: [PATCH] Add fix for unknown order id --- wp_robokassa.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp_robokassa.php b/wp_robokassa.php index 8f70b19..51f39c7 100644 --- a/wp_robokassa.php +++ b/wp_robokassa.php @@ -363,11 +363,13 @@ function robokassa_payment_wp_robokassa_checkPayment() http_response_code(400); } } else { - $order = new WC_Order($_REQUEST['InvId']); - $order->add_order_note('Bad CRC'); - $order->update_status('failed'); + $returner = 'BAD SIGN'; - $returner = 'BAD SIGN'; + try { + $order = new WC_Order($_REQUEST['InvId']); + $order->add_order_note('Bad CRC'); + $order->update_status('failed'); + } catch (Exception $e) {} } }