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']); 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; }