diff --git a/src/PosNet.php b/src/PosNet.php index 133769d0..912c6d66 100644 --- a/src/PosNet.php +++ b/src/PosNet.php @@ -515,7 +515,7 @@ public function make3DPayment() $this->send($contents); } - if ($this->getProcReturnCode() == '00' && $this->getStatusDetail() == 'approved' && $this->getStatusDetail() == 'approved') { + if ($this->getProcReturnCode() == '00' && $this->getStatusDetail() == 'approved') { if ($this->data->oosResolveMerchantDataResponse->mdStatus == '1') { $transaction_security = 'Full 3D Secure'; $status = 'approved'; @@ -525,7 +525,7 @@ public function make3DPayment() } $nodes = [ - 'posnetRequest' => [ + 'posnetRequest' => [ 'mid' => $this->account->client_id, 'tid' => $this->account->terminal_id, 'oosTranData' => [ @@ -543,6 +543,10 @@ public function make3DPayment() $this->response = (object) $this->data; + if ($this->data->approved != 1) { + $status = 'declined'; + } + $this->response = (object) [ 'id' => isset($this->data->AuthCode) ? $this->printData($this->data->AuthCode) : null, 'order_id' => isset($this->order->id) ? $this->printData($this->order->id) : null,