diff --git a/controllers/front/notify.php b/controllers/front/notify.php index 0c6def53..2e6b2d43 100755 --- a/controllers/front/notify.php +++ b/controllers/front/notify.php @@ -66,8 +66,14 @@ public function postProcess() $secureKey )); - if (!$lockResult->isSuccessful()) { - die($this->module->l('Lock already exist', self::FILENAME)); + if (!SaferPayConfig::isVersion17()) { + if ($lockResult > 200) { + die($this->module->l('Lock already exists', self::FILENAME)); + } + } else { + if (!$lockResult->isSuccessful()) { + die($this->module->l('Lock already exists', self::FILENAME)); + } } if ($cart->orderExists()) { @@ -96,7 +102,6 @@ public function postProcess() $checkoutData->setOrderStatus($transactionStatus); - $checkoutProcessor->run($checkoutData); $orderId = $this->getOrderId($cartId); //TODO look into pipeline design pattern to use when object is modified in multiple places to avoid this issue. diff --git a/controllers/front/return.php b/controllers/front/return.php index 473997c4..1ce79fd0 100755 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -175,10 +175,6 @@ private function executeTransaction($orderId, $selectedCard) ); } - private function assertTransaction($cartId) { - - } - /** * @param int $cartId * diff --git a/src/Controller/AbstractSaferPayController.php b/src/Controller/AbstractSaferPayController.php index d62b5e46..cac8b4a2 100755 --- a/src/Controller/AbstractSaferPayController.php +++ b/src/Controller/AbstractSaferPayController.php @@ -82,6 +82,10 @@ protected function applyLock($resource) $this->lock->create($resource); if (!$this->lock->acquire()) { + + if (!SaferPayConfig::isVersion17()) { + return http_response_code(409); + } return Response::respond( $this->module->l('Resource conflict', self::FILE_NAME), Response::HTTP_CONFLICT @@ -93,12 +97,20 @@ protected function applyLock($resource) $logger->payload = $resource; $logger->save(); + if (!SaferPayConfig::isVersion17()) { + return http_response_code(500); + } + return Response::respond( $this->module->l('Internal error', self::FILE_NAME), Response::HTTP_INTERNAL_SERVER_ERROR ); } + if (!SaferPayConfig::isVersion17()) { + return http_response_code(200); + } + return Response::respond( '', Response::HTTP_OK