Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
02f8ad9
Solving the hidden dependency on Magento_Paypal module
khushboo-singhvi Jan 20, 2025
4a0a599
Merge branch 'main' into ECP-9542
candemiralp Jan 23, 2025
46aa3d8
Solving the Paypal module dependency
khushboo-singhvi Jan 23, 2025
7ec2631
Updating unit test
khushboo-singhvi Jan 23, 2025
cb12688
Updating unit test
khushboo-singhvi Jan 23, 2025
41f13e9
Updating unit test
khushboo-singhvi Jan 23, 2025
26d5d68
Merge branch 'main' into ECP-9542
khushboo-singhvi Feb 4, 2025
ac78954
Merge branch 'main' into ECP-9542
khushboo-singhvi Feb 4, 2025
d2a47a3
[ECP-9605] Replace union return types with single return types
candemiralp Feb 4, 2025
bffcee7
[ECP-9605] Downgrade Instant Purchase module dependency
candemiralp Feb 4, 2025
a230cef
Merge pull request #2855 from Adyen/ECP-9542
khushboo-singhvi Feb 4, 2025
8bdaead
Merge branch 'main' into ECP-9605
candemiralp Feb 5, 2025
68b824e
[EPC-9605] Update return type
candemiralp Feb 5, 2025
6f1c717
[ECP-9605] Update return type
candemiralp Feb 5, 2025
6c37baa
Merge pull request #2875 from Adyen/ECP-9605
khushboo-singhvi Feb 5, 2025
b33bd6f
chore(release): bump to 9.14.1
khushboo-singhvi Feb 5, 2025
89473aa
Fix error on empty paymentMethodsResponse (#2844)
aschrammel Feb 5, 2025
1508a9c
Merge branch 'main' into promote/main
khushboo-singhvi Feb 5, 2025
08f214c
Merge pull request #2864 from Adyen/promote/main
khushboo-singhvi Feb 5, 2025
ec8477e
[EPC-9612] Migrate to CodeQL action v3 and introduce a config file (#…
candemiralp Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
paths-ignore:
- 'view/base/web/js'
11 changes: 4 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: "CodeQL"

on:
pull_request:
paths-ignore:
- 'view/base/web/js/**'
workflow_dispatch:

jobs:
analyze:
Expand All @@ -24,15 +23,13 @@ jobs:
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
config-file: ./.github/codeql-config.yml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public function __construct(
}

/**
* @return $this|ApplePayDomainAssociationFileButton
* @return ApplePayDomainAssociationFileButton
*/
protected function _prepareLayout(): ApplePayDomainAssociationFileButton|static
protected function _prepareLayout(): ApplePayDomainAssociationFileButton
{
parent::_prepareLayout();

Expand Down
7 changes: 6 additions & 1 deletion Model/Ui/AdyenCcConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Adyen\Payment\Helper\PaymentMethods;
use Adyen\Payment\Helper\Vault;
use Magento\Checkout\Model\ConfigProviderInterface;
use Magento\Framework\App\Request\Http;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\UrlInterface;
Expand All @@ -38,6 +39,7 @@ class AdyenCcConfigProvider implements ConfigProviderInterface
private Config $configHelper;
private PaymentMethods $paymentMethodsHelper;
private Vault $vaultHelper;
private Http $httpRequest;

public function __construct(
Data $adyenHelper,
Expand All @@ -49,7 +51,8 @@ public function __construct(
SerializerInterface $serializer,
Config $configHelper,
PaymentMethods $paymentMethodsHelper,
Vault $vaultHelper
Vault $vaultHelper,
Http $httpRequest
) {
$this->adyenHelper = $adyenHelper;
$this->request = $request;
Expand All @@ -61,6 +64,7 @@ public function __construct(
$this->configHelper = $configHelper;
$this->paymentMethodsHelper = $paymentMethodsHelper;
$this->vaultHelper = $vaultHelper;
$this->httpRequest = $httpRequest;
}

public function getConfig(): array
Expand Down Expand Up @@ -111,6 +115,7 @@ public function getConfig(): array
$config['payment']['adyenCc']['isCardRecurringEnabled'] = $cardRecurringEnabled;
$config['payment']['adyenCc']['icons'] = $this->getIcons();
$config['payment']['adyenCc']['isClickToPayEnabled'] = $this->configHelper->isClickToPayEnabled($storeId);
$config['payment']['adyenCc']['controllerName'] = $this->httpRequest->getControllerName();

// has installments by default false
$config['payment']['adyenCc']['hasInstallments'] = false;
Expand Down
15 changes: 14 additions & 1 deletion Test/Unit/Model/Ui/AdyenCcConfigProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Adyen\Payment\Helper\Vault;
use Adyen\Payment\Test\Unit\AbstractAdyenTestCase;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\App\Request\Http;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\UrlInterface;
use Magento\Framework\View\Asset\File;
Expand Down Expand Up @@ -47,6 +48,7 @@ protected function setUp(): void
{
$this->adyenHelperMock = $this->createMock(Data::class);
$this->requestMock = $this->createMock(RequestInterface::class);
$this->requestHttpMock = $this->createMock(Http::class);
$this->urlBuilderMock = $this->createMock(UrlInterface::class);
$this->assetSourceMock = $this->createMock(Source::class);
$this->storeManagerMock = $this->createMock(StoreManagerInterface::class);
Expand All @@ -66,7 +68,8 @@ protected function setUp(): void
$this->serializerMock,
$this->configHelperMock,
$this->paymentMethodsHelperMock,
$this->vaultHelperMock
$this->vaultHelperMock,
$this->requestHttpMock,
);
}

Expand All @@ -90,6 +93,7 @@ public function testGetConfig($enableInstallments)
$store = $this->createMock(StoreInterface::class);
$store->method('getId')->willReturn($storeId);
$this->storeManagerMock->method('getStore')->willReturn($store);
$controllerName = 'index';

$this->configHelperMock->method('getAdyenCcConfigData')
->willReturnMap([
Expand Down Expand Up @@ -121,10 +125,19 @@ public function testGetConfig($enableInstallments)
$this->ccConfigMock->expects($this->once())
->method('getCvvImageUrl');

$this->requestHttpMock->expects(
$this->once()
)->method(
'getControllerName'
)->willReturn(
$controllerName
);

$configObject = $this->adyenCcConfigProvider->getConfig();

$this->assertArrayHasKey('installments', $configObject['payment']['adyenCc']);
$this->assertArrayHasKey('isClickToPayEnabled', $configObject['payment']['adyenCc']);
$this->assertArrayHasKey('controllerName', $configObject['payment']['adyenCc']);
$this->assertArrayHasKey('icons', $configObject['payment']['adyenCc']);
$this->assertArrayHasKey('isCardRecurringEnabled', $configObject['payment']['adyenCc']);
$this->assertArrayHasKey('locale', $configObject['payment']['adyenCc']);
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.14.0
9.14.1
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module",
"version": "9.14.0",
"version": "9.14.1",
"license": "MIT",
"repositories": [
{
Expand All @@ -18,7 +18,7 @@
"magento/module-vault": ">=101.2.4",
"magento/module-multishipping": ">=100.4.4",
"magento/module-graph-ql": ">=100.4.4",
"magento/module-instant-purchase": ">=100.4.4",
"magento/module-instant-purchase": ">=100.4.3",
"ext-json": "*"
},
"require-dev": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ define(

// Check the paymentMethods response to enable Credit Card payments
if (!!paymentMethodsResponse &&
!paymentMethodsResponse.paymentMethodsResponse.paymentMethods.find(self.isSchemePaymentsEnabled)) {
!paymentMethodsResponse.paymentMethodsResponse?.paymentMethods.find(self.isSchemePaymentsEnabled)) {
return;
}

Expand Down Expand Up @@ -533,10 +533,7 @@ define(
return true;
},
getControllerName: function() {
return window.checkoutConfig.payment.iframe.controllerName[this.getCode()];
},
getPlaceOrderUrl: function() {
return window.checkoutConfig.payment.iframe.placeOrderUrl[this.getCode()];
return window.checkoutConfig.payment.adyenCc.controllerName;
},
grandTotal: function () {
for (const totalsegment of quote.getTotals()()['total_segments']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ define(
fullScreenLoader.startLoader();
let giftcards = [];

let paymentMethods = paymentMethodsResponse.paymentMethodsResponse.paymentMethods;
let paymentMethods = paymentMethodsResponse.paymentMethodsResponse?.paymentMethods;

if (!!paymentMethods && paymentMethods.length > 0) {
giftcards.push({
Expand Down
9 changes: 1 addition & 8 deletions view/frontend/web/template/payment/cc-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,16 @@
<!--/ko-->
</div>


<form class="form" id="adyen-cc-form" data-role="adyen-cc-form" action="#" method="post" data-bind="mageInit: {
'transparent':{
'context': context(),
'controller': getControllerName(),
'orderSaveUrl':getPlaceOrderUrl(),
'controller': getControllerName()
}, 'validation':[]}">


<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->


<fieldset
data-bind="attr: {class: 'fieldset payment items ccard ' + getCode(), id: 'payment_form_' + getCode()}">
<!-- ko if: (isShowLegend())-->
Expand Down Expand Up @@ -94,7 +90,6 @@
</div>
</div>


<!-- ko if: (hasInstallments())-->

<div class="field required"
Expand All @@ -119,7 +114,6 @@
</div>
</div>


<!-- /ko -->
</fieldset>

Expand All @@ -145,4 +139,3 @@
</div>
</div>
<!--/ko-->

Loading