diff --git a/Gateway/Request/CheckoutDataBuilder.php b/Gateway/Request/CheckoutDataBuilder.php index f28c0f147..ef7c67225 100644 --- a/Gateway/Request/CheckoutDataBuilder.php +++ b/Gateway/Request/CheckoutDataBuilder.php @@ -16,7 +16,7 @@ use Adyen\Payment\Helper\Data; use Adyen\Payment\Helper\StateData; use Adyen\Payment\Helper\OpenInvoice; -use Adyen\Payment\Model\Config\Source\ThreeDSMode; +use Adyen\Payment\Model\Config\Source\ThreeDSFlow; use Adyen\Payment\Model\Ui\AdyenPayByLinkConfigProvider; use Adyen\Payment\Observer\AdyenCcDataAssignObserver; use Adyen\Payment\Observer\AdyenPaymentMethodDataAssignObserver; @@ -211,7 +211,7 @@ public function build(array $buildSubject): array } $requestBody['additionalData']['allow3DS2'] = - $this->configHelper->getThreeDSMode($storeId) === ThreeDSMode::THREEDS_MODE_NATIVE; + $this->configHelper->getThreeDSFlow($storeId) === ThreeDSFlow::THREEDS_NATIVE; return [ 'body' => $requestBody diff --git a/Gateway/Request/RecurringVaultDataBuilder.php b/Gateway/Request/RecurringVaultDataBuilder.php index f11f4c3da..4cac64a81 100644 --- a/Gateway/Request/RecurringVaultDataBuilder.php +++ b/Gateway/Request/RecurringVaultDataBuilder.php @@ -14,7 +14,7 @@ use Adyen\Payment\Helper\Config; use Adyen\Payment\Helper\StateData; use Adyen\Payment\Helper\Vault; -use Adyen\Payment\Model\Config\Source\ThreeDSMode; +use Adyen\Payment\Model\Config\Source\ThreeDSFlow; use Adyen\Payment\Model\Ui\AdyenCcConfigProvider; use Magento\Payment\Gateway\Data\PaymentDataObject; use Magento\Payment\Gateway\Helper\SubjectReader; @@ -68,7 +68,7 @@ public function build(array $buildSubject): array */ if ($paymentMethod->getCode() === AdyenCcConfigProvider::CC_VAULT_CODE) { $requestBody['additionalData']['allow3DS2'] = - $this->configHelper->getThreeDSMode($order->getStoreId()) === ThreeDSMode::THREEDS_MODE_NATIVE; + $this->configHelper->getThreeDSFlow($order->getStoreId()) === ThreeDSFlow::THREEDS_NATIVE; $requestBody['paymentMethod']['holderName'] = $details['cardHolderName'] ?? null; } diff --git a/Helper/Config.php b/Helper/Config.php index ed36a9007..8657bfe26 100644 --- a/Helper/Config.php +++ b/Helper/Config.php @@ -56,7 +56,7 @@ class Config const AUTO_CAPTURE_OPENINVOICE = 'auto'; const XML_RECURRING_CONFIGURATION = 'recurring_configuration'; const XML_ALLOW_MULTISTORE_TOKENS = 'allow_multistore_tokens'; - const XML_THREEDS_MODE = 'threeds_mode'; + const XML_THREEDS_FLOW = 'threeds_flow'; protected ScopeConfigInterface $scopeConfig; private EncryptorInterface $encryptor; @@ -583,10 +583,10 @@ public function getAllowMultistoreTokens(int $storeId = null): ?bool * @param int|null $storeId * @return string */ - public function getThreeDSMode(int $storeId = null): string + public function getThreeDSFlow(int $storeId = null): string { return $this->getConfigData( - self::XML_THREEDS_MODE, + self::XML_THREEDS_FLOW, self::XML_ADYEN_CC, $storeId ); diff --git a/Model/Config/Source/ThreeDSMode.php b/Model/Config/Source/ThreeDSFlow.php similarity index 57% rename from Model/Config/Source/ThreeDSMode.php rename to Model/Config/Source/ThreeDSFlow.php index b67c8e3f5..d2bebd614 100755 --- a/Model/Config/Source/ThreeDSMode.php +++ b/Model/Config/Source/ThreeDSFlow.php @@ -13,10 +13,10 @@ use Magento\Framework\Data\OptionSourceInterface; -class ThreeDSMode implements OptionSourceInterface +class ThreeDSFlow implements OptionSourceInterface { - const THREEDS_MODE_NATIVE = 'native'; - const THREEDS_MODE_REDIRECT = 'redirect'; + const THREEDS_NATIVE = 'native'; + const THREEDS_REDIRECT = 'redirect'; /** * @return array @@ -24,8 +24,8 @@ class ThreeDSMode implements OptionSourceInterface public function toOptionArray(): array { return [ - ['value' => self::THREEDS_MODE_NATIVE, 'label' => __('Native 3D Secure 2')], - ['value' => self::THREEDS_MODE_REDIRECT, 'label' => __('Redirect 3D Secure 2')], + ['value' => self::THREEDS_NATIVE, 'label' => __('Native 3D Secure 2')], + ['value' => self::THREEDS_REDIRECT, 'label' => __('Redirect 3D Secure 2')], ]; } } diff --git a/Test/Unit/Gateway/Request/CheckoutDataBuilderTest.php b/Test/Unit/Gateway/Request/CheckoutDataBuilderTest.php index c3bc5e86a..cfcb2532f 100644 --- a/Test/Unit/Gateway/Request/CheckoutDataBuilderTest.php +++ b/Test/Unit/Gateway/Request/CheckoutDataBuilderTest.php @@ -8,7 +8,7 @@ use Adyen\Payment\Helper\Data; use Adyen\Payment\Helper\OpenInvoice; use Adyen\Payment\Helper\StateData; -use Adyen\Payment\Model\Config\Source\ThreeDSMode; +use Adyen\Payment\Model\Config\Source\ThreeDSFlow; use Adyen\Payment\Test\Unit\AbstractAdyenTestCase; use Magento\Payment\Gateway\Data\PaymentDataObject; use Magento\Quote\Api\CartRepositoryInterface; @@ -72,9 +72,9 @@ public function testAllowThreeDSFlag() ]; $this->configMock->expects($this->once()) - ->method('getThreeDSMode') + ->method('getThreeDSFlow') ->with($storeId) - ->willReturn(ThreeDSMode::THREEDS_MODE_NATIVE); + ->willReturn(ThreeDSFlow::THREEDS_NATIVE); $request = $this->checkoutDataBuilder->build($buildSubject); diff --git a/Test/Unit/Helper/ConfigTest.php b/Test/Unit/Helper/ConfigTest.php index 5cb3a990e..bf70dd4f4 100644 --- a/Test/Unit/Helper/ConfigTest.php +++ b/Test/Unit/Helper/ConfigTest.php @@ -137,7 +137,7 @@ public function testGetThreeDSModes() "%s/%s/%s", Config::XML_PAYMENT_PREFIX, Config::XML_ADYEN_CC, - Config::XML_THREEDS_MODE + Config::XML_THREEDS_FLOW ); $this->scopeConfigMock->expects($this->once()) @@ -145,7 +145,7 @@ public function testGetThreeDSModes() ->with($this->equalTo($path), $this->equalTo(ScopeInterface::SCOPE_STORE), $this->equalTo($storeId)) ->willReturn($expectedResult); - $result = $this->configHelper->getThreeDSMode($storeId); + $result = $this->configHelper->getThreeDSFlow($storeId); $this->assertEquals($expectedResult, $result); } } diff --git a/Test/Unit/Model/Config/Source/ThreeDSModeTest.php b/Test/Unit/Model/Config/Source/ThreeDSModeTest.php index 2537faa4d..e7ff61dfe 100644 --- a/Test/Unit/Model/Config/Source/ThreeDSModeTest.php +++ b/Test/Unit/Model/Config/Source/ThreeDSModeTest.php @@ -2,18 +2,18 @@ namespace Adyen\Payment\Test\Unit\Model\Config\Source; -use Adyen\Payment\Model\Config\Source\ThreeDSMode; +use Adyen\Payment\Model\Config\Source\ThreeDSFlow; use Adyen\Payment\Test\Unit\AbstractAdyenTestCase; class ThreeDSModeTest extends AbstractAdyenTestCase { public function testToOptionArray() { - $threeDSModeSource = new ThreeDSMode(); + $threeDSModeSource = new ThreeDSFlow(); $expected = [ - ['value' => ThreeDSMode::THREEDS_MODE_NATIVE, 'label' => __('Native 3D Secure 2')], - ['value' => ThreeDSMode::THREEDS_MODE_REDIRECT, 'label' => __('Redirect 3D Secure 2')], + ['value' => ThreeDSFlow::THREEDS_NATIVE, 'label' => __('Native 3D Secure 2')], + ['value' => ThreeDSFlow::THREEDS_REDIRECT, 'label' => __('Redirect 3D Secure 2')], ]; $this->assertEquals($expected, $threeDSModeSource->toOptionArray()); diff --git a/etc/adminhtml/system/adyen_card_payments.xml b/etc/adminhtml/system/adyen_card_payments.xml index 85fac4934..b356ad22a 100755 --- a/etc/adminhtml/system/adyen_card_payments.xml +++ b/etc/adminhtml/system/adyen_card_payments.xml @@ -74,10 +74,10 @@ Magento\Config\Model\Config\Source\Yesno payment/adyen_cc/enable_click_to_pay - - - Adyen\Payment\Model\Config\Source\ThreeDSMode - payment/adyen_cc/threeds_mode + + + Adyen\Payment\Model\Config\Source\ThreeDSFlow + payment/adyen_cc/threeds_flow diff --git a/etc/config.xml b/etc/config.xml index f2294325e..d61cff0b2 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -61,7 +61,7 @@ 1 1 1 - native + native adyen