From fdd6489939b6b3bbf78faa035685a8b71bd3e2fc Mon Sep 17 00:00:00 2001 From: tomjas1997 Date: Mon, 14 Nov 2022 17:01:22 +0200 Subject: [PATCH] Enum for controlelr name --- controllers/front/iframe.php | 3 ++- controllers/front/successHosted.php | 5 +++-- controllers/front/successIFrame.php | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/controllers/front/iframe.php b/controllers/front/iframe.php index c9096840e..cb42c231e 100755 --- a/controllers/front/iframe.php +++ b/controllers/front/iframe.php @@ -24,6 +24,7 @@ use Invertus\SaferPay\Config\SaferPayConfig; use Invertus\SaferPay\Controller\AbstractSaferPayController; use Invertus\SaferPay\EntityBuilder\SaferPayOrderBuilder; +use Invertus\SaferPay\Enum\ControllerName; use Invertus\SaferPay\Repository\SaferPayCardAliasRepository; use Invertus\SaferPay\Service\SaferPayInitialize; @@ -111,7 +112,7 @@ public function initContent() } catch (Exception $e) { $redirectLink = $this->context->link->getModuleLink( $this->module->name, - 'fail', + ControllerName::FAIL, [ 'cartId' => $this->context->cart->id, 'orderId' => Order::getOrderByCartId($this->context->cart->id), diff --git a/controllers/front/successHosted.php b/controllers/front/successHosted.php index e25aefd6e..51d70f673 100755 --- a/controllers/front/successHosted.php +++ b/controllers/front/successHosted.php @@ -24,6 +24,7 @@ use Invertus\SaferPay\Config\SaferPayConfig; use Invertus\SaferPay\Controller\AbstractSaferPayController; use Invertus\SaferPay\DTO\Response\Assert\AssertBody; +use Invertus\SaferPay\Enum\ControllerName; use Invertus\SaferPay\Repository\SaferPayOrderRepository; use Invertus\SaferPay\Service\SaferPay3DSecureService; use Invertus\SaferPay\Service\SaferPayOrderStatusService; @@ -87,7 +88,7 @@ public function postProcess() $this->redirectWithNotifications($this->context->link->getModuleLink( $this->module->name, - 'fail', + ControllerName::FAIL, [ 'cartId' => $cartId, 'secureKey' => $secureKey, @@ -126,7 +127,7 @@ public function postProcess() Tools::redirect( $this->context->link->getModuleLink( $this->module->name, - 'fail', + ControllerName::FAIL, [ 'cartId' => $cartId, 'secureKey' => $secureKey, diff --git a/controllers/front/successIFrame.php b/controllers/front/successIFrame.php index 0281b5390..9c66a1d97 100755 --- a/controllers/front/successIFrame.php +++ b/controllers/front/successIFrame.php @@ -24,6 +24,7 @@ use Invertus\SaferPay\Api\Request\AuthorizationService; use Invertus\SaferPay\Config\SaferPayConfig; use Invertus\SaferPay\Controller\AbstractSaferPayController; +use Invertus\SaferPay\Enum\ControllerName; use Invertus\SaferPay\Exception\Api\SaferPayApiException; use Invertus\SaferPay\Repository\SaferPayOrderRepository; use Invertus\SaferPay\Service\Request\AuthorizationRequestObjectCreator; @@ -77,7 +78,7 @@ public function postProcess() $this->warning[] = $this->module->l('We couldn\'t authorize your payment. Please try again.', self::FILENAME); $this->redirectWithNotifications($this->context->link->getModuleLink( $this->module->name, - 'failValidation', + ControllerName::FAIL_VALIDATION, [ 'cartId' => $cartId, 'secureKey' => $secureKey, @@ -104,7 +105,7 @@ public function postProcess() $this->redirectWithNotifications($this->context->link->getModuleLink( $this->module->name, - 'fail', + ControllerName::FAIL, [ 'cartId' => $cartId, 'secureKey' => $secureKey,