From ca900d7a66dab5655dbb8d9d978c0f168cab3fae Mon Sep 17 00:00:00 2001 From: Azizbek Date: Thu, 3 Mar 2022 09:27:28 +0500 Subject: [PATCH 1/2] Fixed issue with wrong params for find() Order::find() method was called with wrong params, without order_id, so CancelTransaction method cannot find Order --- Paycom/Application.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Paycom/Application.php b/Paycom/Application.php index 8148984..adf9d36 100644 --- a/Paycom/Application.php +++ b/Paycom/Application.php @@ -284,7 +284,7 @@ private function CancelTransaction() // change order state to cancelled $order = new Order($this->request->id); - $order->find($this->request->params); + $order->find(['order_id' => $found->order_id]); $order->changeState(Order::STATE_CANCELLED); // send response @@ -298,7 +298,7 @@ private function CancelTransaction() case Transaction::STATE_COMPLETED: // find order and check, whether cancelling is possible this order $order = new Order($this->request->id); - $order->find($this->request->params); + $order->find(['order_id' => $found->order_id]); if ($order->allowCancel()) { // cancel and change state to cancelled $found->cancel(1 * $this->request->params['reason']); From 6df00911d0ef7661a994bb51c8c7f174634f3033 Mon Sep 17 00:00:00 2001 From: Azizbek Date: Thu, 3 Mar 2022 09:43:09 +0500 Subject: [PATCH 2/2] If datetime is null, return 0 Test.paycom.uz sandbox requires perform_time to be zero, null is not accepted --- Paycom/Format.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Paycom/Format.php b/Paycom/Format.php index 5f4e4bf..571c1ec 100644 --- a/Paycom/Format.php +++ b/Paycom/Format.php @@ -94,6 +94,9 @@ public static function datetime2timestamp($datetime) if ($datetime) { return 1000 * strtotime($datetime); } + if (is_null($datetime)) { + return 0; + } return $datetime; }