From b77251e5afafb575c7d9630f0f19cd0d6faf0575 Mon Sep 17 00:00:00 2001 From: Sushmita Thakur Date: Thu, 3 Oct 2024 09:08:14 +0200 Subject: [PATCH 1/5] [ECP-9423] Add Support for Korean Payment Methods (#2753) * [ECP-9423] Added NeverPay * [ECP-9423] Added PayCo and NeverPay Logo * [ECP-9423] Added Credit Card via KCP * [ECP-9423] Set auto capture type field --------- Co-authored-by: sushmita --- etc/config.xml | 66 +++++++++++++++ etc/di.xml | 81 +++++++++++++++++++ etc/events.xml | 9 +++ etc/frontend/di.xml | 3 + etc/graphql/di.xml | 3 + etc/payment.xml | 9 +++ view/base/web/images/logos/kcp_creditcard.svg | 1 + view/base/web/images/logos/kcp_naverpay.svg | 1 + view/base/web/images/logos/kcp_payco.svg | 1 + view/frontend/layout/checkout_index_index.xml | 9 +++ .../layout/multishipping_checkout_billing.xml | 3 + 11 files changed, 186 insertions(+) create mode 100644 view/base/web/images/logos/kcp_creditcard.svg create mode 100644 view/base/web/images/logos/kcp_naverpay.svg create mode 100644 view/base/web/images/logos/kcp_payco.svg diff --git a/etc/config.xml b/etc/config.xml index c205ab519..dd7997bbd 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -2207,6 +2207,72 @@ Stored DANA AdyenPaymentDanaVaultFacade + + 0 + AdyenPaymentKcpNaverpayFacade + NaverPay + 0 + 0 + authorize + 1 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 1 + adyen-alternative-payment-method + + + 0 + AdyenPaymentKcpPaycoFacade + PayCo + 0 + 0 + authorize + 1 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 1 + adyen-alternative-payment-method + + + 0 + AdyenPaymentKcpCreditcardFacade + Credit Card via KCP + 0 + 0 + authorize + 1 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + adyen-alternative-payment-method + diff --git a/etc/di.xml b/etc/di.xml index 7b4cdc553..b87676dff 100755 --- a/etc/di.xml +++ b/etc/di.xml @@ -4236,4 +4236,85 @@ adyen_dana_vault + + + adyen_kcp_naverpay + Magento\Payment\Block\Form + Adyen\Payment\Block\Info\PaymentMethodInfo + AdyenPaymentKcpNaverpayValueHandlerPool + AdyenPaymentValidatorPool + AdyenPaymentCommandPool + + + + + + AdyenPaymentKcpNaverpayConfigValueHandler + + + + + + AdyenPaymentKcpNaverpayConfig + + + + + adyen_kcp_naverpay + + + + + adyen_kcp_payco + Magento\Payment\Block\Form + Adyen\Payment\Block\Info\PaymentMethodInfo + AdyenPaymentKcpPaycoValueHandlerPool + AdyenPaymentValidatorPool + AdyenPaymentCommandPool + + + + + + AdyenPaymentKcpPaycoConfigValueHandler + + + + + + AdyenPaymentKcpPaycoConfig + + + + + adyen_kcp_payco + + + + + adyen_kcp_creditcard + Magento\Payment\Block\Form + Adyen\Payment\Block\Info\PaymentMethodInfo + AdyenPaymentKcpCreditcardValueHandlerPool + AdyenPaymentValidatorPool + AdyenPaymentCommandPool + + + + + + AdyenPaymentKcpCreditcardConfigValueHandler + + + + + + AdyenPaymentKcpCreditcardConfig + + + + + adyen_kcp_creditcard + + \ No newline at end of file diff --git a/etc/events.xml b/etc/events.xml index 0a6acaf76..152061321 100644 --- a/etc/events.xml +++ b/etc/events.xml @@ -302,4 +302,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index f1ea6027d..34576cb77 100755 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -111,6 +111,9 @@ paypo upi dana + kcp_naverpay + kcp_payco + kcp_creditcard Adyen_Payment/js/view/payment/method-renderer/adyen-cc-method diff --git a/etc/graphql/di.xml b/etc/graphql/di.xml index 06b46a633..ca8deea49 100644 --- a/etc/graphql/di.xml +++ b/etc/graphql/di.xml @@ -92,6 +92,9 @@ Adyen\Payment\Model\Cart\Payment\AdditionalDataProvider\AdyenPm Adyen\Payment\Model\Cart\Payment\AdditionalDataProvider\AdyenPm Adyen\Payment\Model\Cart\Payment\AdditionalDataProvider\AdyenPm + Adyen\Payment\Model\Cart\Payment\AdditionalDataProvider\AdyenPm + Adyen\Payment\Model\Cart\Payment\AdditionalDataProvider\AdyenPm + Adyen\Payment\Model\Cart\Payment\AdditionalDataProvider\AdyenPm diff --git a/etc/payment.xml b/etc/payment.xml index e1f64a6a2..5c9920a18 100755 --- a/etc/payment.xml +++ b/etc/payment.xml @@ -263,5 +263,14 @@ 1 + + 1 + + + 1 + + + 1 + \ No newline at end of file diff --git a/view/base/web/images/logos/kcp_creditcard.svg b/view/base/web/images/logos/kcp_creditcard.svg new file mode 100644 index 000000000..48c5245d4 --- /dev/null +++ b/view/base/web/images/logos/kcp_creditcard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/view/base/web/images/logos/kcp_naverpay.svg b/view/base/web/images/logos/kcp_naverpay.svg new file mode 100644 index 000000000..806b94f60 --- /dev/null +++ b/view/base/web/images/logos/kcp_naverpay.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/view/base/web/images/logos/kcp_payco.svg b/view/base/web/images/logos/kcp_payco.svg new file mode 100644 index 000000000..803d06625 --- /dev/null +++ b/view/base/web/images/logos/kcp_payco.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index 3c8fcf436..076a3d1ca 100755 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -317,6 +317,15 @@ true + + true + + + true + + + true + diff --git a/view/frontend/layout/multishipping_checkout_billing.xml b/view/frontend/layout/multishipping_checkout_billing.xml index af5b0653d..64d663f2b 100644 --- a/view/frontend/layout/multishipping_checkout_billing.xml +++ b/view/frontend/layout/multishipping_checkout_billing.xml @@ -101,6 +101,9 @@ Adyen_Payment::form/multishipping/abstract-form.phtml Adyen_Payment::form/multishipping/abstract-form.phtml Adyen_Payment::form/multishipping/abstract-form.phtml + Adyen_Payment::form/multishipping/abstract-form.phtml + Adyen_Payment::form/multishipping/abstract-form.phtml + Adyen_Payment::form/multishipping/abstract-form.phtml false From 6eefcdc04ed04b59948d2f53dac495837348c67a Mon Sep 17 00:00:00 2001 From: khushboo-singhvi <7098889+khushboo-singhvi@users.noreply.github.com> Date: Thu, 3 Oct 2024 07:08:29 +0000 Subject: [PATCH 2/5] chore(release): bump to 9.9.0 --- VERSION | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 31476ce15..5ffe92ddd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.8.1 +9.9.0 diff --git a/composer.json b/composer.json index 6b22bf829..492fb54a8 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "adyen/module-payment", "description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.", "type": "magento2-module", - "version": "9.8.1", + "version": "9.9.0", "license": "MIT", "repositories": [ { From 4a2320dc37b9d977bd6d54856a19f366ad798f64 Mon Sep 17 00:00:00 2001 From: Krzysztof Tomczyk Date: Thu, 3 Oct 2024 11:55:31 +0200 Subject: [PATCH 3/5] Added index to Notification/created_at table (#2760) Co-authored-by: Can Demiralp --- etc/db_schema.xml | 3 +++ etc/db_schema_whitelist.json | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/etc/db_schema.xml b/etc/db_schema.xml index b27cee6c3..6f6147481 100644 --- a/etc/db_schema.xml +++ b/etc/db_schema.xml @@ -68,6 +68,9 @@ + + + diff --git a/etc/db_schema_whitelist.json b/etc/db_schema_whitelist.json index 8be925e25..d0067f852 100644 --- a/etc/db_schema_whitelist.json +++ b/etc/db_schema_whitelist.json @@ -62,7 +62,8 @@ "ADYEN_NOTIFICATION_PSPREFERENCE": true, "ADYEN_NOTIFICATION_EVENT_CODE": true, "ADYEN_NOTIFICATION_PSPREFERENCE_EVENT_CODE": true, - "ADYEN_NOTIFICATION_MERCHANT_REFERENCE_EVENT_CODE": true + "ADYEN_NOTIFICATION_MERCHANT_REFERENCE_EVENT_CODE": true, + "ADYEN_NOTIFICATION_CREATED_AT": true }, "constraint": { "PRIMARY": true @@ -110,4 +111,4 @@ "PRIMARY": true } } -} \ No newline at end of file +} From 1935d6f7691e60c537eb16ad3b84f04a474d713c Mon Sep 17 00:00:00 2001 From: Can Demiralp Date: Fri, 4 Oct 2024 08:53:27 +0200 Subject: [PATCH 4/5] [ECP-9506] Fix /payments response handling if an exception is thrown (#2763) * [ECP-9506] Fix response handling of non-200 http status codes * [ECP-9506] Update unit tests --------- Co-authored-by: Can Demiralp --- Gateway/Http/Client/TransactionPayment.php | 5 +++++ .../Validator/CheckoutResponseValidator.php | 9 ++++++--- .../Http/Client/TransactionPaymentTest.php | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/Gateway/Http/Client/TransactionPayment.php b/Gateway/Http/Client/TransactionPayment.php index 1e4cb800b..57d6474f8 100644 --- a/Gateway/Http/Client/TransactionPayment.php +++ b/Gateway/Http/Client/TransactionPayment.php @@ -162,6 +162,11 @@ public function placeRequest(TransferInterface $transferObject): array $this->adyenHelper->logResponse($responseData); } catch (AdyenException $e) { $this->adyenHelper->logAdyenException($e); + + $responseObj['error'] = $e->getMessage(); + $responseObj['errorCode'] = $e->getAdyenErrorCode(); + + $responseCollection[] = $responseObj; } return $responseCollection; diff --git a/Gateway/Validator/CheckoutResponseValidator.php b/Gateway/Validator/CheckoutResponseValidator.php index 102177dfd..b2e59bbc5 100644 --- a/Gateway/Validator/CheckoutResponseValidator.php +++ b/Gateway/Validator/CheckoutResponseValidator.php @@ -62,6 +62,10 @@ public function validate(array $validationSubject): ResultInterface // Extract all the payment responses $responseCollection = $validationSubject['response']; unset($validationSubject['response']); + + // hasOnlyGiftCards is needed later but cannot be processed as a response + unset($responseCollection['hasOnlyGiftCards']); + // Assign the remaining items to $commandSubject $commandSubject = $validationSubject; @@ -69,8 +73,6 @@ public function validate(array $validationSubject): ResultInterface throw new ValidatorException(__("No responses were provided")); } - // hasOnlyGiftCards is needed later but cannot be processed as a response - unset($responseCollection['hasOnlyGiftCards']); foreach ($responseCollection as $thisResponse) { $responseSubject = array_merge($commandSubject, ['response' => $thisResponse]); $this->validateResponse($responseSubject); @@ -90,11 +92,12 @@ private function validateResponse($responseSubject): void $payment->setAdditionalInformation('3dActive', false); - // validate result + // Handle empty result for unexpected cases if (empty($response['resultCode'])) { $this->handleEmptyResultCode($response); } + // Handle the `/payments` response $this->validateResult($response, $payment); } diff --git a/Test/Unit/Gateway/Http/Client/TransactionPaymentTest.php b/Test/Unit/Gateway/Http/Client/TransactionPaymentTest.php index 492c65ebc..3b1be8746 100644 --- a/Test/Unit/Gateway/Http/Client/TransactionPaymentTest.php +++ b/Test/Unit/Gateway/Http/Client/TransactionPaymentTest.php @@ -11,6 +11,7 @@ namespace Adyen\Payment\Test\Unit\Gateway\Http\Client; +use Adyen\AdyenException; use Adyen\Model\Checkout\ApplicationInfo; use Adyen\Model\Checkout\PaymentRequest; use Adyen\Model\Checkout\PaymentResponse as CheckoutPaymentResponse; @@ -87,6 +88,23 @@ public function testPlaceRequestWithResultCode() $this->assertEquals($requestBody, $result); } + public function testPlaceRequestWithoutResultCode() + { + $transferObjectMock = $this->createMock(TransferInterface::class); + + $requestBody = ['amount' => ['value' => 1000]]; + $transferObjectMock->method('getBody')->willReturn($requestBody); + $transferObjectMock->method('getClientConfig')->willReturn(['storeId' => 1]); + + $clientMock = $this->createMock(PaymentsApi::class); + $clientMock->method('payments')->willThrowException(new AdyenException()); + + $this->adyenHelperMock->method('initializePaymentsApi')->willReturn($clientMock); + + $response = $this->transactionPayment->placeRequest($transferObjectMock); + $this->assertArrayHasKey('errorCode', $response[0]); + } + public function testPlaceRequestGeneratesIdempotencyKey() { $requestBody = ['reference' => 'ABC12345', 'amount' => ['value' => 100], 'applicationInfo' => $this->applicationInfoMock]; From 1c4c0f8df8bb8bd1fa8d9bea1cd7defd4f1f5f3b Mon Sep 17 00:00:00 2001 From: candemiralp <20255503+candemiralp@users.noreply.github.com> Date: Fri, 4 Oct 2024 06:53:43 +0000 Subject: [PATCH 5/5] chore(release): bump to 9.9.1 --- VERSION | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 5ffe92ddd..327451916 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.9.0 +9.9.1 diff --git a/composer.json b/composer.json index 492fb54a8..3f6ebb8cd 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "adyen/module-payment", "description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.", "type": "magento2-module", - "version": "9.9.0", + "version": "9.9.1", "license": "MIT", "repositories": [ {