From 20a776b29a902664dbd11d053687accecd84fc76 Mon Sep 17 00:00:00 2001 From: Filip Heymans Date: Wed, 21 Jun 2017 11:44:22 +0200 Subject: [PATCH] Removed response code '60' from being a successful transaction cause it's not (it's pending and can still fail). --- README.md | 4 +++- src/Message/CompletePurchaseResponse.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9ea549b..e410f36 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,9 @@ if ($response->isSuccessful()) { $bankTransactionRef = $response->getTransactionReference(); $websiteOrderId = $response->getTransactionId(); +} elseif ($response->isPending()) { + // Do temporary things until we get a success/failed tranaction response. } else { echo $response->getMessage(); } -``` \ No newline at end of file +``` diff --git a/src/Message/CompletePurchaseResponse.php b/src/Message/CompletePurchaseResponse.php index afe6717..ba2f10f 100644 --- a/src/Message/CompletePurchaseResponse.php +++ b/src/Message/CompletePurchaseResponse.php @@ -67,7 +67,7 @@ protected function decomposeData() */ public function isSuccessful() { - return $this->isValid() && in_array($this->getCode(), array('00', '60')); + return $this->isValid() && $this->getCode() === '00'; } /** @@ -203,4 +203,4 @@ public function getTransactionId() { return $this->fields['orderId']; } -} \ No newline at end of file +}