Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
09a30a6
[ECP-9320] Refactor Data Helper
khushboo-singhvi May 20, 2025
1987b19
[ECP-9320] Refactor Data Helper
khushboo-singhvi May 21, 2025
51d4523
[ECP-9320] Refactor Data Helper
khushboo-singhvi May 21, 2025
cfcfe99
[ECP 9566] Refactor Donations to use PaymentDataObject (#2963)
khushboo-singhvi May 19, 2025
1fadf3d
Add missing JS reference
candemiralp May 20, 2025
e81ad76
Merge branch 'develop-10' into ECP-9320
khushboo-singhvi May 21, 2025
a4c5e03
Merge remote-tracking branch 'origin/ECP-9320' into ECP-9320
khushboo-singhvi May 21, 2025
bdcd0a3
[ECP-9320] Refactor Data Helper unit tests
khushboo-singhvi May 22, 2025
063b5c4
[ECP-9320] Refactor Data Helper unit tests
khushboo-singhvi May 22, 2025
6c5e50b
[ECP-9320] Refactor Data Helper unit tests
khushboo-singhvi May 23, 2025
2dca3c3
[ECP-9320] Refactor Data Helper unit tests
khushboo-singhvi May 26, 2025
b1d07e9
[ECP-9320] Updating failing Index Test
khushboo-singhvi May 26, 2025
4726795
Merge branch 'develop-10' into ECP-9320
khushboo-singhvi May 26, 2025
cf8d221
Merge branch 'develop-10' into ECP-9320
khushboo-singhvi May 27, 2025
242b966
[ECP-9320] Updating failing Index Test
khushboo-singhvi May 27, 2025
9684e1f
Merge remote-tracking branch 'origin/ECP-9320' into ECP-9320
khushboo-singhvi May 27, 2025
2f92ce1
[ECP-9320] Updating constants
khushboo-singhvi May 28, 2025
c880055
[ECP-9320] Updating unit tests
khushboo-singhvi May 28, 2025
af61dfd
[ECP-9320] Updating unit tests
khushboo-singhvi May 28, 2025
7dceee2
[ECP-9320] Updating unit tests
khushboo-singhvi May 28, 2025
8043aeb
[ECP-9320] Updating unit tests
khushboo-singhvi May 28, 2025
aa3a742
[ECP-9320] Updating declarations
khushboo-singhvi May 28, 2025
8af34a4
Run main pipeline on push event
candemiralp May 28, 2025
084fe16
Merge branch 'develop-10' into ECP-9320
khushboo-singhvi May 28, 2025
7827a8c
Merge branch 'develop-10' into ECP-9320
candemiralp May 28, 2025
f91c3c7
[ECP-9320] Updating unit test for PlatformInfoTest.php
khushboo-singhvi May 28, 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
35 changes: 12 additions & 23 deletions AdminMessage/VersionMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,32 @@
namespace Adyen\Payment\AdminMessage;

use Adyen\Payment\Helper\Data;
use Adyen\Payment\Helper\PlatformInfo;
use Magento\AdminNotification\Model\InboxFactory;
use Magento\Backend\Model\Auth\Session;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Notification\MessageInterface;

class VersionMessage implements MessageInterface
{
/**
* @var Session
*/
protected $_authSession;

/**
* @var Data
*/
protected $_adyenHelper;

/**
* @var InboxFactory
*/
protected $_inboxFactory;

/**
* @var RequestInterface
*/
protected $request;
protected Session $_authSession;
protected Data $_adyenHelper;
protected InboxFactory $_inboxFactory;
protected RequestInterface $request;
protected PlatformInfo $_platformInfo;

public function __construct(
Session $authSession,
Data $adyenHelper,
InboxFactory $inboxFactory,
RequestInterface $request
RequestInterface $request,
PlatformInfo $platformInfo
) {
$this->_authSession = $authSession;
$this->_adyenHelper = $adyenHelper;
$this->_inboxFactory = $inboxFactory;
$this->request = $request;
$this->_platformInfo = $platformInfo;
}

const MESSAGE_IDENTITY = 'Adyen Version Control message';
Expand Down Expand Up @@ -96,7 +85,7 @@ public function isDisplayed()
* This will compare the currently installed version with the latest available one.
* A message will appear after the login if the two are not matching.
*/
if ($this->_adyenHelper->getModuleVersion() != $githubContent['tag_name']) {
if ($this->_platformInfo->getModuleVersion() != $githubContent['tag_name']) {
return true;
}
} elseif ($this->request->getModuleName() === 'mui' && $this->isNewVersionAvailable()) {
Expand Down Expand Up @@ -127,7 +116,7 @@ public function getText()
"<a href= \"" . $githubContent['html_url'] . "\" target='_blank'> " . $githubContent['tag_name'] . "!</a>"
);
$message .= __(
" You are running the " . $this->_adyenHelper->getModuleVersion(
" You are running the " . $this->_platformInfo->getModuleVersion(
) . " version. We advise to update your extension."
);
return __($message);
Expand Down Expand Up @@ -177,7 +166,7 @@ private function isNewVersionAvailable()
$githubContent = $this->getSessionData("AdyenGithubVersion");

if (isset($githubContent)) {
return $this->_adyenHelper->getModuleVersion() !== $githubContent['tag_name'];
return $this->_platformInfo->getModuleVersion() !== $githubContent['tag_name'];
}
}
}
18 changes: 13 additions & 5 deletions Block/Adminhtml/System/Config/Field/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

namespace Adyen\Payment\Block\Adminhtml\System\Config\Field;

use Adyen\Payment\Helper\PlatformInfo;
use Magento\Backend\Block\Template\Context;

class Version extends \Magento\Config\Block\System\Config\Form\Field
{

Expand All @@ -23,20 +26,25 @@ class Version extends \Magento\Config\Block\System\Config\Form\Field
*/
protected $_adyenHelper;

/**
* @var PlatformInfo
*/
protected $_platformInfo;

/**
* Version constructor.
*
* @param \Magento\Framework\Module\ModuleListInterface $moduleList
* @param \Magento\Backend\Block\Template\Context $context
* @param PlatformInfo $platformInfo
* @param Context $context
* @param array $data
*/
public function __construct(
\Adyen\Payment\Helper\Data $adyenHelper,
PlatformInfo $platformInfo,
\Magento\Backend\Block\Template\Context $context,
array $data = []
) {
parent::__construct($context, $data);
$this->_adyenHelper = $adyenHelper;
$this->_platformInfo = $platformInfo;
}

/**
Expand All @@ -47,6 +55,6 @@ public function __construct(
*/
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
return $this->_adyenHelper->getModuleVersion();
return $this->_platformInfo->getModuleVersion();
}
}
6 changes: 5 additions & 1 deletion Block/Checkout/Multishipping/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use Adyen\Payment\Helper\Data;
use Adyen\Payment\Helper\Config;
use Adyen\Payment\Helper\Locale;
use Adyen\Payment\Helper\PaymentMethods;
use Adyen\Payment\Helper\PaymentResponseHandler;
use Adyen\Payment\Model\ResourceModel\PaymentResponse\Collection;
Expand All @@ -38,6 +39,7 @@ class Success extends \Magento\Multishipping\Block\Checkout\Success
private SearchCriteriaBuilder $searchCriteriaBuilder;
private Config $configHelper;
private PaymentMethods $paymentMethodsHelper;
private Locale $localeHelper;

/**
* @var
Expand All @@ -56,6 +58,7 @@ public function __construct(
OrderRepositoryInterface $orderRepository,
SearchCriteriaBuilder $searchCriteriaBuilder,
Config $configHelper,
Locale $localeHelper,
array $data = []
) {
$this->adyenHelper = $adyenHelper;
Expand All @@ -66,6 +69,7 @@ public function __construct(
$this->orderRepository = $orderRepository;
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
$this->configHelper = $configHelper;
$this->localeHelper = $localeHelper;
parent::__construct($context, $multishipping, $data);

$orderIds = $this->getOrderIds();
Expand Down Expand Up @@ -97,7 +101,7 @@ public function getPaymentResponseEntities()

public function getLocale()
{
return $this->adyenHelper->getCurrentLocaleCode(
return $this->localeHelper->getCurrentLocaleCode(
$this->storeManager->getStore()->getId()
);
}
Expand Down
6 changes: 5 additions & 1 deletion Block/Checkout/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Adyen\Payment\Helper\Config;
use Adyen\Payment\Helper\Data;
use Adyen\Payment\Helper\Locale;
use Adyen\Payment\Helper\PaymentResponseHandler;
use Adyen\Payment\Model\Ui\AdyenCheckoutSuccessConfigProvider;
use Magento\Checkout\Model\Session as CheckoutSession;
Expand Down Expand Up @@ -40,6 +41,7 @@ class Success extends Template
private AdyenCheckoutSuccessConfigProvider $configProvider;
private QuoteIdToMaskedQuoteId $quoteIdToMaskedQuoteId;
private OrderRepositoryInterface $orderRepository;
private Locale $localeHelper;
/** @deprecated This property has been deprecated and will be removed on V10. */
protected OrderFactory $orderFactory;

Expand All @@ -55,6 +57,7 @@ public function __construct(
StoreManagerInterface $storeManager,
SerializerInterface $serializerInterface,
OrderRepositoryInterface $orderRepository,
Locale $localeHelper,
array $data = []
) {
parent::__construct($context, $data);
Expand All @@ -69,6 +72,7 @@ public function __construct(
$this->storeManager = $storeManager;
$this->serializerInterface = $serializerInterface;
$this->orderRepository = $orderRepository;
$this->localeHelper = $localeHelper;
}

/**
Expand Down Expand Up @@ -128,7 +132,7 @@ public function getSerializedCheckoutConfig()

public function getLocale()
{
return $this->adyenHelper->getCurrentLocaleCode(
return $this->localeHelper->getCurrentLocaleCode(
$this->storeManager->getStore()->getId()
);
}
Expand Down
20 changes: 17 additions & 3 deletions Block/Form/Moto.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
use Adyen\Payment\Helper\Config;
use Adyen\Payment\Helper\Data;
use Adyen\Payment\Helper\Installments;
use Adyen\Payment\Helper\Locale;
use Adyen\Payment\Logger\AdyenLogger;
use Magento\Backend\Model\Session\Quote;
use Magento\Checkout\Model\Session;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\View\Element\Template\Context;

class Moto extends \Magento\Payment\Block\Form\Cc
Expand All @@ -31,6 +34,11 @@ class Moto extends \Magento\Payment\Block\Form\Cc
*/
protected $adyenHelper;

/**
* @var Locale
*/
protected $localeHelper;

/**
* @var \Magento\Framework\App\State
*/
Expand Down Expand Up @@ -65,10 +73,12 @@ class Moto extends \Magento\Payment\Block\Form\Cc
* @param Context $context
* @param \Magento\Payment\Model\Config $paymentConfig
* @param Data $adyenHelper
* @param \Magento\Checkout\Model\Session $checkoutSession
* @param Session $checkoutSession
* @param Installments $installmentsHelper
* @param AdyenLogger $adyenLogger
* @param Config $configHelper
* @param Quote $backendSession
* @param Locale $localeHelper
*/
public function __construct(
Context $context,
Expand All @@ -78,7 +88,8 @@ public function __construct(
Installments $installmentsHelper,
AdyenLogger $adyenLogger,
Config $configHelper,
Quote $backendSession
Quote $backendSession,
Locale $localeHelper
) {
parent::__construct($context, $paymentConfig);
$this->adyenHelper = $adyenHelper;
Expand All @@ -88,10 +99,13 @@ public function __construct(
$this->adyenLogger = $adyenLogger;
$this->configHelper = $configHelper;
$this->backendSession = $backendSession;
$this->localeHelper = $localeHelper;
}

/**
* @return string
* @throws LocalizedException
* @throws NoSuchEntityException
*/
public function getCheckoutEnvironment()
{
Expand All @@ -103,7 +117,7 @@ public function getCheckoutEnvironment()
*/
public function getLocale()
{
return $this->adyenHelper->getStoreLocale($this->checkoutSession->getQuote()->getStore()->getId());
return $this->localeHelper->getStoreLocale($this->checkoutSession->getQuote()->getStore()->getId());
}

/**
Expand Down
13 changes: 11 additions & 2 deletions Gateway/Http/Client/TransactionCancel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Adyen\Model\Checkout\PaymentCancelRequest;
use Adyen\Payment\Helper\Data;
use Adyen\Payment\Helper\Idempotency;
use Adyen\Payment\Helper\PlatformInfo;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Payment\Gateway\Http\ClientInterface;
use Magento\Payment\Gateway\Http\TransferInterface;
Expand All @@ -32,16 +33,24 @@ class TransactionCancel implements ClientInterface
*/
private Idempotency $idempotencyHelper;

/**
* @var PlatformInfo
*/
private PlatformInfo $platformInfo;

/**
* @param Data $adyenHelper
* @param Idempotency $idempotencyHelper
* @param PlatformInfo $platformInfo
*/
public function __construct(
Data $adyenHelper,
Idempotency $idempotencyHelper
Idempotency $idempotencyHelper,
PlatformInfo $platformInfo
) {
$this->adyenHelper = $adyenHelper;
$this->idempotencyHelper = $idempotencyHelper;
$this->platformInfo = $platformInfo;
}

/**
Expand All @@ -68,7 +77,7 @@ public function placeRequest(TransferInterface $transferObject): array
$requestOptions['idempotencyKey'] = $idempotencyKey;
$requestOptions['headers'] = $headers;
$this->adyenHelper->logRequest($request, Client::API_CHECKOUT_VERSION, '/cancels');
$request['applicationInfo'] = $this->adyenHelper->buildApplicationInfo($client);
$request['applicationInfo'] = $this->platformInfo->buildApplicationInfo($client);
$paymentCancelRequest = new PaymentCancelRequest($request);

try {
Expand Down
13 changes: 11 additions & 2 deletions Gateway/Http/Client/TransactionCapture.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Adyen\Payment\Helper\Requests;
use Adyen\Payment\Logger\AdyenLogger;
use Adyen\Service\Checkout\ModificationsApi;
use Adyen\Payment\Helper\PlatformInfo;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Payment\Gateway\Http\ClientInterface;
use Magento\Payment\Gateway\Http\TransferInterface;
Expand Down Expand Up @@ -47,19 +48,27 @@ class TransactionCapture implements ClientInterface
*/
private Idempotency $idempotencyHelper;

/**
* @var PlatformInfo
*/
private PlatformInfo $platformInfo;

/**
* @param Data $adyenHelper
* @param AdyenLogger $adyenLogger
* @param Idempotency $idempotencyHelper
* @param PlatformInfo $platformInfo
*/
public function __construct(
Data $adyenHelper,
AdyenLogger $adyenLogger,
Idempotency $idempotencyHelper
Idempotency $idempotencyHelper,
PlatformInfo $platformInfo
) {
$this->adyenHelper = $adyenHelper;
$this->adyenLogger = $adyenLogger;
$this->idempotencyHelper = $idempotencyHelper;
$this->platformInfo = $platformInfo;
}

/**
Expand All @@ -78,7 +87,7 @@ public function placeRequest(TransferInterface $transferObject): array
$service = $this->adyenHelper->initializeModificationsApi($client);

$requestOptions['headers'] = $headers;
$request['applicationInfo'] = $this->adyenHelper->buildApplicationInfo($client);
$request['applicationInfo'] = $this->platformInfo->buildApplicationInfo($client);

if (array_key_exists(self::MULTIPLE_AUTHORIZATIONS, $request)) {
return $this->placeMultipleCaptureRequests($service, $request, $requestOptions);
Expand Down
Loading
Loading