From 3ab803cad41af20fa75954a21cde45586c5e59de Mon Sep 17 00:00:00 2001 From: Sushmita Thakur Date: Tue, 24 Dec 2024 19:35:07 +0100 Subject: [PATCH] [ECP-9482] Refactor Header Data Builder For Transaction Clients (#2819) * [ECP-9482-1] Added HeaderDataBuilderInterface, moved header builder to separate directory, updated constants in the observers, updated frontend type values to `luma`, added HeaderDataBuilder in the authorization flow for cancel, capture, refund, donate, payByLink, and pos transaction clients in di.xml * [ECP-9482-1] Removed HeaderDataBuilder from pos transaction client, updated the headers in all transaction clients * [ECP-9482-1] Updated Tests * [ECP-9482-1] Updated constants in data helper * [ECP-9482-1] Updated header in refund request options * [ECP-9482-1] Updated header in capture request options, revert donation header updates * [ECP-9482-1] Updated format * [ECP-9482-1] Remove capture test update * [ECP-9482-1] Update DataTest for new frontend type constant * [ECP-9482-1] Update Constants use in Data, remove unused constant for `headless` from HeaderDataBuilderInterface * [ECP-9482-1] Set frontendType in JS renderers to be `default` * [ECP-9482-1] Set placeorder method * [ECP-9482-1] Remove unused variable * [ECP-9482-1] fix formatting issue * [ECP-9482-1] reverse the frontend type change for giftcard * [ECP-9482-1] Added unit test for TransactionPaymentLinks * [ECP-9482-1] Added unit test for initializePaymentLinksApi in DataTest * [ECP-9482-1] Optimized TrasactionPaymentLinks test * [ECP-9482-1] Remove unused classes --------- Co-authored-by: sushmita --- Gateway/Http/Client/TransactionCancel.php | 2 +- Gateway/Http/Client/TransactionCapture.php | 6 +- .../Http/Client/TransactionPaymentLinks.php | 8 +- Gateway/Http/Client/TransactionRefund.php | 7 +- .../{ => Header}/HeaderDataBuilder.php | 7 +- .../Header/HeaderDataBuilderInterface.php | 15 +++ Helper/Data.php | 24 ++-- Observer/AdyenCcDataAssignObserver.php | 4 +- .../AdyenPaymentMethodDataAssignObserver.php | 4 +- .../Client/TransactionPaymentLinksTest.php | 120 ++++++++++++++++++ .../Http/Client/TransactionRefundTest.php | 2 - .../{ => Header}/HeaderDataBuilderTest.php | 2 +- Test/Unit/Helper/DataTest.php | 17 ++- etc/di.xml | 18 ++- .../method-renderer/adyen-cc-vault-method.js | 2 +- .../method-renderer/adyen-pm-method.js | 4 +- .../method-renderer/adyen-pm-vault-method.js | 9 ++ 17 files changed, 207 insertions(+), 44 deletions(-) rename Gateway/Request/{ => Header}/HeaderDataBuilder.php (84%) create mode 100644 Gateway/Request/Header/HeaderDataBuilderInterface.php create mode 100644 Test/Unit/Gateway/Http/Client/TransactionPaymentLinksTest.php rename Test/Unit/Gateway/Request/{ => Header}/HeaderDataBuilderTest.php (97%) diff --git a/Gateway/Http/Client/TransactionCancel.php b/Gateway/Http/Client/TransactionCancel.php index 707412d06d..f7d1406469 100644 --- a/Gateway/Http/Client/TransactionCancel.php +++ b/Gateway/Http/Client/TransactionCancel.php @@ -66,7 +66,7 @@ public function placeRequest(TransferInterface $transferObject): array $headers['idempotencyExtraData'] ?? null ); $requestOptions['idempotencyKey'] = $idempotencyKey; - $requestOptions['headers'] = $this->adyenHelper->buildRequestHeaders(); + $requestOptions['headers'] = $headers; $this->adyenHelper->logRequest($request, Client::API_CHECKOUT_VERSION, '/cancels'); $request['applicationInfo'] = $this->adyenHelper->buildApplicationInfo($client); $paymentCancelRequest = new PaymentCancelRequest($request); diff --git a/Gateway/Http/Client/TransactionCapture.php b/Gateway/Http/Client/TransactionCapture.php index ad699a9ba6..0ed6dbb109 100644 --- a/Gateway/Http/Client/TransactionCapture.php +++ b/Gateway/Http/Client/TransactionCapture.php @@ -72,12 +72,14 @@ public function placeRequest(TransferInterface $transferObject): array { $request = $transferObject->getBody(); $headers = $transferObject->getHeaders(); + $idempotencyKeyExtraData = $headers['idempotencyExtraData']; + unset($headers['idempotencyExtraData']); $clientConfig = $transferObject->getClientConfig(); $client = $this->adyenHelper->initializeAdyenClientWithClientConfig($clientConfig); $service = $this->adyenHelper->initializeModificationsApi($client); - $requestOptions['headers'] = $this->adyenHelper->buildRequestHeaders(); + $requestOptions['headers'] = $headers; $request['applicationInfo'] = $this->adyenHelper->buildApplicationInfo($client); if (array_key_exists(self::MULTIPLE_AUTHORIZATIONS, $request)) { @@ -86,7 +88,7 @@ public function placeRequest(TransferInterface $transferObject): array $idempotencyKey = $this->idempotencyHelper->generateIdempotencyKey( $request, - $headers['idempotencyExtraData'] ?? null + $idempotencyKeyExtraData ?? null ); $requestOptions['idempotencyKey'] = $idempotencyKey; diff --git a/Gateway/Http/Client/TransactionPaymentLinks.php b/Gateway/Http/Client/TransactionPaymentLinks.php index c43d5d81bf..71e0f8237a 100644 --- a/Gateway/Http/Client/TransactionPaymentLinks.php +++ b/Gateway/Http/Client/TransactionPaymentLinks.php @@ -55,10 +55,12 @@ public function placeRequest(TransferInterface $transferObject): array { $request = $transferObject->getBody(); $headers = $transferObject->getHeaders(); + $idempotencyKeyExtraData = $headers['idempotencyExtraData'] ?? null; + unset($headers['idempotencyExtraData']); $clientConfig = $transferObject->getClientConfig(); $client = $this->adyenHelper->initializeAdyenClientWithClientConfig($clientConfig); - $service = new PaymentLinksApi($client); + $service = $this->adyenHelper->initializePaymentLinksApi($client); // If the payment links call is already done return the request if (!empty($request['resultCode'])) { @@ -68,11 +70,11 @@ public function placeRequest(TransferInterface $transferObject): array $idempotencyKey = $this->idempotencyHelper->generateIdempotencyKey( $request, - $headers['idempotencyExtraData'] ?? null + $idempotencyKeyExtraData ); $requestOptions['idempotencyKey'] = $idempotencyKey; - $requestOptions['headers'] = $this->adyenHelper->buildRequestHeaders(); + $requestOptions['headers'] = $headers; $request['applicationInfo'] = $this->adyenHelper->buildApplicationInfo($client); $this->adyenHelper->logRequest($request, Client::API_CHECKOUT_VERSION, '/paymentLinks'); diff --git a/Gateway/Http/Client/TransactionRefund.php b/Gateway/Http/Client/TransactionRefund.php index 238f18fb79..6474c300de 100644 --- a/Gateway/Http/Client/TransactionRefund.php +++ b/Gateway/Http/Client/TransactionRefund.php @@ -56,6 +56,8 @@ public function placeRequest(TransferInterface $transferObject): array { $requests = $transferObject->getBody(); $headers = $transferObject->getHeaders(); + $idempotencyKeyExtraData = $headers['idempotencyExtraData']; + unset($headers['idempotencyExtraData']); $clientConfig = $transferObject->getClientConfig(); $client = $this->adyenHelper->initializeAdyenClientWithClientConfig($clientConfig); @@ -66,10 +68,11 @@ public function placeRequest(TransferInterface $transferObject): array $responseData = []; $idempotencyKey = $this->idempotencyHelper->generateIdempotencyKey( $request, - $headers['idempotencyExtraData'] ?? null + $idempotencyKeyExtraData ?? null ); $requestOptions['idempotencyKey'] = $idempotencyKey; - $requestOptions['headers'] = $this->adyenHelper->buildRequestHeaders(); + $requestOptions['headers'] = $headers; + $this->adyenHelper->logRequest($request, Client::API_CHECKOUT_VERSION, '/refunds'); $request['applicationInfo'] = $this->adyenHelper->buildApplicationInfo($client); $paymentRefundRequest = new PaymentRefundRequest($request); diff --git a/Gateway/Request/HeaderDataBuilder.php b/Gateway/Request/Header/HeaderDataBuilder.php similarity index 84% rename from Gateway/Request/HeaderDataBuilder.php rename to Gateway/Request/Header/HeaderDataBuilder.php index 66cd1aa703..d2c772f1e6 100644 --- a/Gateway/Request/HeaderDataBuilder.php +++ b/Gateway/Request/Header/HeaderDataBuilder.php @@ -9,18 +9,15 @@ * Author: Adyen */ -namespace Adyen\Payment\Gateway\Request; +namespace Adyen\Payment\Gateway\Request\Header; use Adyen\Payment\Helper\Data; use Magento\Payment\Gateway\Data\PaymentDataObject; use Magento\Payment\Gateway\Helper\SubjectReader; use Magento\Payment\Gateway\Request\BuilderInterface; -class HeaderDataBuilder implements BuilderInterface +class HeaderDataBuilder implements BuilderInterface, HeaderDataBuilderInterface { - const FRONTENDTYPE = 'external-platform-frontendtype'; - const FRONTENDTYPE_HEADLESS = 'headless'; - /** * @var Data */ diff --git a/Gateway/Request/Header/HeaderDataBuilderInterface.php b/Gateway/Request/Header/HeaderDataBuilderInterface.php new file mode 100644 index 0000000000..ac10244854 --- /dev/null +++ b/Gateway/Request/Header/HeaderDataBuilderInterface.php @@ -0,0 +1,15 @@ +getMagentoDetails(); $headers = [ - 'external-platform-name' => $magentoDetails['name'], - 'external-platform-version' => $magentoDetails['version'], - 'external-platform-edition' => $magentoDetails['edition'], - 'merchant-application-name' => $this->getModuleName(), - 'merchant-application-version' => $this->getModuleVersion() + HeaderDataBuilderInterface::EXTERNAL_PLATFORM_NAME => $magentoDetails['name'], + HeaderDataBuilderInterface::EXTERNAL_PLATFORM_VERSION => $magentoDetails['version'], + HeaderDataBuilderInterface::EXTERNAL_PLATFORM_EDITION => $magentoDetails['edition'], + HeaderDataBuilderInterface::MERCHANT_APPLICATION_NAME => $this->getModuleName(), + HeaderDataBuilderInterface::MERCHANT_APPLICATION_VERSION => $this->getModuleVersion() ]; - if(isset($payment) && !is_null($payment->getAdditionalInformation(HeaderDataBuilder::FRONTENDTYPE))) { - $headers[HeaderDataBuilder::FRONTENDTYPE] = - $payment->getAdditionalInformation(HeaderDataBuilder::FRONTENDTYPE); + if(isset($payment) && !is_null($payment->getAdditionalInformation(HeaderDataBuilderInterface::ADDITIONAL_DATA_FRONTEND_TYPE_KEY))) { + $headers[HeaderDataBuilderInterface::EXTERNAL_PLATFORM_FRONTEND_TYPE] = + $payment->getAdditionalInformation(HeaderDataBuilderInterface::ADDITIONAL_DATA_FRONTEND_TYPE_KEY); } return $headers; @@ -1248,6 +1249,11 @@ public function initializeOrdersApi(Client $client): OrdersApi return new OrdersApi($client); } + public function initializePaymentLinksApi(Client $client):PaymentLinksApi + { + return new PaymentLinksApi($client); + } + /** * @param Client $client * @return PosPayment diff --git a/Observer/AdyenCcDataAssignObserver.php b/Observer/AdyenCcDataAssignObserver.php index 6168deebb3..79ed087eab 100644 --- a/Observer/AdyenCcDataAssignObserver.php +++ b/Observer/AdyenCcDataAssignObserver.php @@ -19,7 +19,7 @@ use Magento\Framework\Event\Observer; use Magento\Payment\Observer\AbstractDataAssignObserver; use Magento\Quote\Api\Data\PaymentInterface; -use Adyen\Payment\Gateway\Request\HeaderDataBuilder; +use Adyen\Payment\Gateway\Request\Header\HeaderDataBuilderInterface; class AdyenCcDataAssignObserver extends AbstractDataAssignObserver { @@ -46,7 +46,7 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver self::CC_TYPE, self::RETURN_URL, self::RECURRING_PROCESSING_MODEL, - HeaderDataBuilder::FRONTENDTYPE + HeaderDataBuilderInterface::ADDITIONAL_DATA_FRONTEND_TYPE_KEY ]; /** diff --git a/Observer/AdyenPaymentMethodDataAssignObserver.php b/Observer/AdyenPaymentMethodDataAssignObserver.php index e90ce7b0a0..efe803a0fc 100644 --- a/Observer/AdyenPaymentMethodDataAssignObserver.php +++ b/Observer/AdyenPaymentMethodDataAssignObserver.php @@ -11,7 +11,7 @@ namespace Adyen\Payment\Observer; -use Adyen\Payment\Gateway\Request\HeaderDataBuilder; +use Adyen\Payment\Gateway\Request\Header\HeaderDataBuilderInterface; use Adyen\Payment\Helper\StateData; use Adyen\Payment\Helper\Util\CheckoutStateDataValidator; use Adyen\Payment\Helper\Util\DataArrayValidator; @@ -39,7 +39,7 @@ class AdyenPaymentMethodDataAssignObserver extends AbstractDataAssignObserver self::RETURN_URL, self::RECURRING_PROCESSING_MODEL, self::CC_NUMBER, - HeaderDataBuilder::FRONTENDTYPE + HeaderDataBuilderInterface::ADDITIONAL_DATA_FRONTEND_TYPE_KEY ]; protected CheckoutStateDataValidator $checkoutStateDataValidator; diff --git a/Test/Unit/Gateway/Http/Client/TransactionPaymentLinksTest.php b/Test/Unit/Gateway/Http/Client/TransactionPaymentLinksTest.php new file mode 100644 index 0000000000..c52733c959 --- /dev/null +++ b/Test/Unit/Gateway/Http/Client/TransactionPaymentLinksTest.php @@ -0,0 +1,120 @@ +adyenHelperMock = $this->createMock(Data::class); + $this->idempotencyHelperMock = $this->createMock(Idempotency::class); + $this->transferObjectMock = $this->createMock(TransferInterface::class); + $this->applicationInfoMock = $this->createMock(ApplicationInfo::class); + $this->adyenHelperMock->method('buildApplicationInfo')->willReturn($this->applicationInfoMock); + $this->transferObjectMock->method('getClientConfig')->willReturn([]); + $this->clientMock = $this->createMock(Client::class); + $this->adyenHelperMock->method('initializeAdyenClientWithClientConfig')->willReturn($this->clientMock); + $this->paymentLinksApiMock = $this->createMock(PaymentLinksApi::class); + $this->adyenHelperMock + ->method('initializePaymentLinksApi') + ->with($this->clientMock) + ->willReturn($this->paymentLinksApiMock); + + $this->transactionPaymentLinks = new TransactionPaymentLinks( + $this->adyenHelperMock, + $this->idempotencyHelperMock + ); + } + + public function testSuccessfulPlaceRequest() + { + $requestBody = [ + 'allowedPaymentMethods' => ['ideal','giropay'], + 'amount' => ['value' => 1000, 'currency' => 'EUR'], + 'applicationInfo' => $this->applicationInfoMock + ]; + + $headers = [ 'idempotencyExtraData' => [], 'header' => 'some-data']; + $idempotencyKey = 'generated_idempotency_key'; + + $this->transferObjectMock->method('getBody')->willReturn($requestBody); + $this->transferObjectMock->method('getHeaders')->willReturn($headers); + + $this->idempotencyHelperMock->expects($this->once()) + ->method('generateIdempotencyKey') + ->with($requestBody, $headers['idempotencyExtraData']) + ->willReturn('generated_idempotency_key'); + + $this->paymentLinksApiMock->expects($this->once()) + ->method('paymentLinks') + ->with( + $this->callback(function (PaymentLinkRequest $paymentLinkRequest) use ($requestBody) { + $amount = $paymentLinkRequest->getAmount(); + $this->assertEquals($amount, ['value' => 1000, 'currency' => 'EUR']); + $allowedPaymentMethods = $paymentLinkRequest->getAllowedPaymentMethods(); + $this->assertEquals($allowedPaymentMethods, ['ideal', 'giropay']); + return true; + }), + $this->callback(function ($requestOptions) use ($idempotencyKey, $headers) { + $this->assertArrayHasKey('idempotencyKey', $requestOptions); + $this->assertArrayHasKey('headers', $requestOptions); + $this->assertEquals($idempotencyKey, $requestOptions['idempotencyKey']); + $this->assertEquals(['header' => 'some-data'], $requestOptions['headers']); + return true; + }) + )->willReturn(new PaymentLinkResponse(['url' => 'https://paymentlink.com'])); + + $response = $this->transactionPaymentLinks->placeRequest($this->transferObjectMock); + $this->assertIsArray($response); + $this->assertArrayHasKey('url', $response); + } + + public function testRequestWithAdyenException() + { + $requestBody = [ + 'amount' => ['currency' => 'EUR', 'value' => 1000], + 'merchantAccount' => 'TestMerchant', + 'reference' => 'TestReference', + ]; + $this->transferObjectMock->method('getBody')->willReturn($requestBody); + $this->transferObjectMock->method('getHeaders')->willReturn([]); + $this->transferObjectMock->method('getClientConfig')->willReturn([]); + + $this->paymentLinksApiMock + ->method('paymentLinks') + ->willThrowException(new AdyenException()); + + $response = $this->transactionPaymentLinks->placeRequest($this->transferObjectMock); + + $this->assertArrayHasKey('error', $response); + } + + public function testRequestWithResultCodePresent() + { + $requestBody = ['resultCode' => 'Authorised']; + $this->transferObjectMock->method('getBody')->willReturn($requestBody); + + $response = $this->transactionPaymentLinks->placeRequest($this->transferObjectMock); + $this->assertEquals($requestBody, $response); + } + +} diff --git a/Test/Unit/Gateway/Http/Client/TransactionRefundTest.php b/Test/Unit/Gateway/Http/Client/TransactionRefundTest.php index 21b2730451..3ba9370ac4 100644 --- a/Test/Unit/Gateway/Http/Client/TransactionRefundTest.php +++ b/Test/Unit/Gateway/Http/Client/TransactionRefundTest.php @@ -71,7 +71,6 @@ public function testPlaceRequestIncludesHeadersInRequest() $this->adyenHelperMock->method('initializeAdyenClientWithClientConfig')->willReturn($adyenClientMock); $this->adyenHelperMock->method('initializeModificationsApi')->willReturn($serviceMock); - $this->adyenHelperMock->method('buildRequestHeaders')->willReturn(['custom-header' => 'value']); $this->idempotencyHelperMock->expects($this->once()) ->method('generateIdempotencyKey') @@ -91,7 +90,6 @@ public function testPlaceRequestIncludesHeadersInRequest() $this->assertArrayHasKey('idempotencyKey', $requestOptions); $this->assertArrayHasKey('headers', $requestOptions); $this->assertEquals('generated_idempotency_key', $requestOptions['idempotencyKey']); - $this->assertArrayHasKey('custom-header', $requestOptions['headers']); return true; }) ) diff --git a/Test/Unit/Gateway/Request/HeaderDataBuilderTest.php b/Test/Unit/Gateway/Request/Header/HeaderDataBuilderTest.php similarity index 97% rename from Test/Unit/Gateway/Request/HeaderDataBuilderTest.php rename to Test/Unit/Gateway/Request/Header/HeaderDataBuilderTest.php index 7c15e659a1..b270347fb1 100644 --- a/Test/Unit/Gateway/Request/HeaderDataBuilderTest.php +++ b/Test/Unit/Gateway/Request/Header/HeaderDataBuilderTest.php @@ -2,7 +2,7 @@ namespace Adyen\Payment\Test\Unit\Gateway\Request; -use Adyen\Payment\Gateway\Request\HeaderDataBuilder; +use Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder; use Adyen\Payment\Test\Unit\AbstractAdyenTestCase; use Adyen\Payment\Helper\Data; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; diff --git a/Test/Unit/Helper/DataTest.php b/Test/Unit/Helper/DataTest.php index ffb82e21cc..ffc52261e3 100755 --- a/Test/Unit/Helper/DataTest.php +++ b/Test/Unit/Helper/DataTest.php @@ -15,7 +15,7 @@ use Adyen\Config as AdyenConfig; use Adyen\Model\Checkout\ApplicationInfo; use Adyen\Model\Checkout\CommonField; -use Adyen\Payment\Gateway\Request\HeaderDataBuilder; +use Adyen\Payment\Gateway\Request\Header\HeaderDataBuilderInterface; use Adyen\Payment\Helper\Config as ConfigHelper; use Adyen\Payment\Helper\Data; use Adyen\Payment\Helper\Locale; @@ -27,6 +27,7 @@ use Adyen\Payment\Test\Unit\AbstractAdyenTestCase; use Adyen\Service\Checkout\ModificationsApi; use Adyen\Service\Checkout\OrdersApi; +use Adyen\Service\Checkout\PaymentLinksApi; use Adyen\Service\Checkout\PaymentsApi; use Adyen\Service\RecurringApi; use Magento\Backend\Helper\Data as BackendHelper; @@ -1090,15 +1091,15 @@ public function testBuildRequestHeadersWithNonNullFrontendType() // Set up expectations for the getAdditionalInformation method $payment->method('getAdditionalInformation') - ->with(HeaderDataBuilder::FRONTENDTYPE) + ->with(HeaderDataBuilderInterface::ADDITIONAL_DATA_FRONTEND_TYPE_KEY) ->willReturn('some_frontend_type'); // Call the method under test $result = $this->dataHelper->buildRequestHeaders($payment); // Assert that the 'frontend-type' header is correctly set - $this->assertArrayHasKey(HeaderDataBuilder::FRONTENDTYPE, $result); - $this->assertEquals('some_frontend_type', $result[HeaderDataBuilder::FRONTENDTYPE]); + $this->assertArrayHasKey(HeaderDataBuilderInterface::EXTERNAL_PLATFORM_FRONTEND_TYPE, $result); + $this->assertEquals('some_frontend_type', $result[HeaderDataBuilderInterface::EXTERNAL_PLATFORM_FRONTEND_TYPE]); // Assert other headers as needed } @@ -1110,7 +1111,7 @@ public function testBuildRequestHeadersWithoutPayment() $result = $this->dataHelper->buildRequestHeaders(); // Assert that the 'frontend-type' header is not set - $this->assertArrayNotHasKey(HeaderDataBuilder::FRONTENDTYPE, $result); + $this->assertArrayNotHasKey(HeaderDataBuilderInterface::EXTERNAL_PLATFORM_FRONTEND_TYPE, $result); } public function testLogResponse() @@ -1892,6 +1893,12 @@ public function testInitializeOrdersApi() $this->assertInstanceOf(OrdersApi::class, $service); } + public function testInitializePaymentLinksApi() + { + $service = $this->dataHelper->initializePaymentLinksApi($this->clientMock); + $this->assertInstanceOf(PaymentLinksApi::class, $service); + } + public function testLogAdyenException() { $this->store->method('getId')->willReturn(1); diff --git a/etc/di.xml b/etc/di.xml index aefb9b552a..880ffe546c 100755 --- a/etc/di.xml +++ b/etc/di.xml @@ -1079,7 +1079,7 @@ Adyen\Payment\Gateway\Request\ReturnUrlDataBuilder Adyen\Payment\Gateway\Request\ChannelDataBuilder Adyen\Payment\Gateway\Request\OriginDataBuilder - Adyen\Payment\Gateway\Request\HeaderDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder Adyen\Payment\Gateway\Request\GiftcardDataBuilder @@ -1113,6 +1113,7 @@ Adyen\Payment\Gateway\Request\PaymentDataBuilder Adyen\Payment\Gateway\Request\DescriptionDataBuilder Adyen\Payment\Gateway\Request\CheckoutDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder @@ -1132,7 +1133,7 @@ Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder Adyen\Payment\Gateway\Request\RecurringVaultDataBuilder Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder - Adyen\Payment\Gateway\Request\HeaderDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder Adyen\Payment\Gateway\Request\GiftcardDataBuilder @@ -1152,7 +1153,7 @@ Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder Adyen\Payment\Gateway\Request\RecurringVaultDataBuilder Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder - Adyen\Payment\Gateway\Request\HeaderDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder Adyen\Payment\Gateway\Request\GiftcardDataBuilder @@ -1200,7 +1201,7 @@ Adyen\Payment\Gateway\Request\RecurringDataBuilder Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder Adyen\Payment\Gateway\Request\CheckoutDataBuilder - Adyen\Payment\Gateway\Request\HeaderDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder Adyen\Payment\Gateway\Request\ReturnUrlDataBuilder Adyen\Payment\Gateway\Request\ChannelDataBuilder Adyen\Payment\Gateway\Request\OriginDataBuilder @@ -1220,7 +1221,7 @@ Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder Adyen\Payment\Gateway\Request\CheckoutDataBuilder - Adyen\Payment\Gateway\Request\HeaderDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder Adyen\Payment\Gateway\Request\ReturnUrlDataBuilder Adyen\Payment\Gateway\Request\ChannelDataBuilder Adyen\Payment\Gateway\Request\OriginDataBuilder @@ -1248,7 +1249,7 @@ Adyen\Payment\Gateway\Request\RecurringDataBuilder Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder Adyen\Payment\Gateway\Request\CheckoutDataBuilder - Adyen\Payment\Gateway\Request\HeaderDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder Adyen\Payment\Gateway\Request\ReturnUrlDataBuilder Adyen\Payment\Gateway\Request\ChannelDataBuilder Adyen\Payment\Gateway\Request\OriginDataBuilder @@ -1269,6 +1270,7 @@ Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder Adyen\Payment\Gateway\Request\CaptureDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder @@ -1286,6 +1288,7 @@ Adyen\Payment\Gateway\Request\RefundDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder @@ -1302,6 +1305,7 @@ Adyen\Payment\Gateway\Request\CancelDataBuilder + Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder @@ -4559,4 +4563,4 @@ adyen_doku_mandiri_va - \ No newline at end of file + diff --git a/view/frontend/web/js/view/payment/method-renderer/adyen-cc-vault-method.js b/view/frontend/web/js/view/payment/method-renderer/adyen-cc-vault-method.js index dbad6e1d5a..45a44078e1 100644 --- a/view/frontend/web/js/view/payment/method-renderer/adyen-cc-vault-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/adyen-cc-vault-method.js @@ -260,7 +260,7 @@ define([ stateData: stateData, public_hash: this.publicHash, numberOfInstallments: this.installment(), - frontendType: 'luma' + frontendType: 'default' }, }; }, diff --git a/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js b/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js index f6bf2dffc9..c3918236f7 100755 --- a/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js @@ -155,7 +155,7 @@ define( fullScreenLoader.stopLoader(); errorProcessor.process(error, this.currentMessageContainer); }, - + renderCheckoutComponent: function() { let methodCode = this.getMethodCode(); let configuration = this.buildComponentConfiguration(this.paymentMethod(), this.paymentMethodsExtraInfo()); @@ -294,7 +294,7 @@ define( let additionalData = {}; additionalData.brand_code = this.paymentMethod().type; - additionalData.frontendType = 'luma'; + additionalData.frontendType = 'default'; let stateData; if (this.paymentComponent) { diff --git a/view/frontend/web/js/view/payment/method-renderer/adyen-pm-vault-method.js b/view/frontend/web/js/view/payment/method-renderer/adyen-pm-vault-method.js index 5452313181..3f56674671 100644 --- a/view/frontend/web/js/view/payment/method-renderer/adyen-pm-vault-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/adyen-pm-vault-method.js @@ -54,6 +54,15 @@ define([ */ getIcons: function (type) { return this.details.icon; + }, + getData: function () { + return { + method: this.code, + additional_data: { + public_hash: this.publicHash, + frontendType: 'default' + }, + }; } }); });