-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/log-invoice-creation-as-info
- Loading branch information
Showing
67 changed files
with
2,313 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
paths-ignore: | ||
- 'view/base/web/js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment Module | ||
* | ||
* Copyright (c) 2025 Adyen N.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
* | ||
* Author: Adyen <magento@adyen.com> | ||
*/ | ||
|
||
namespace Adyen\Payment\Api\Repository; | ||
|
||
interface AdyenNotificationRepositoryInterface | ||
{ | ||
/** | ||
* @param array $entityIds | ||
* @return void | ||
*/ | ||
public function deleteByIds(array $entityIds): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment module (https://www.adyen.com/) | ||
* | ||
* Copyright (c) 2025 Adyen N.V. (https://www.adyen.com/) | ||
* See LICENSE.txt for license details. | ||
* | ||
* Author: Adyen <magento@adyen.com> | ||
*/ | ||
|
||
namespace Adyen\Payment\Block\Adminhtml\Notification; | ||
|
||
use Adyen\Payment\Helper\Config; | ||
use Magento\Framework\View\Element\Template\Context; | ||
use Magento\Theme\Block\Html\Notices; | ||
|
||
class WebhookRemovalJobNotice extends Notices | ||
{ | ||
public function __construct( | ||
Context $context, | ||
private readonly Config $configHelper, | ||
array $data = [] | ||
) { | ||
parent::__construct($context, $data); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isProcessedWebhookRemovalEnabled(): bool | ||
{ | ||
return $this->configHelper->getIsProcessedWebhookRemovalEnabled(); | ||
} | ||
|
||
/** | ||
* Returns the number of days after which the notifications will be cleaned-up. | ||
* | ||
* @return int | ||
*/ | ||
public function getNumberOfDays(): int | ||
{ | ||
return $this->configHelper->getProcessedWebhookRemovalTime(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment module (https://www.adyen.com/) | ||
* | ||
* Copyright (c) 2025 Adyen N.V. (https://www.adyen.com/) | ||
* See LICENSE.txt for license details. | ||
* | ||
* Author: Adyen <magento@adyen.com> | ||
*/ | ||
|
||
namespace Adyen\Payment\Cron\Providers; | ||
|
||
use Adyen\Payment\Api\Data\NotificationInterface; | ||
use Adyen\Payment\Helper\Config; | ||
use Adyen\Payment\Model\ResourceModel\Notification\Collection; | ||
use Adyen\Payment\Model\ResourceModel\Notification\CollectionFactory; | ||
|
||
class ProcessedWebhooksProvider implements WebhooksProviderInterface | ||
{ | ||
/** | ||
* @param CollectionFactory $notificationCollectionFactory | ||
* @param Config $configHelper | ||
*/ | ||
public function __construct( | ||
private readonly CollectionFactory $notificationCollectionFactory, | ||
private readonly Config $configHelper | ||
) { } | ||
|
||
/** | ||
* Provides the `entity_id`s of the processed webhooks limited by the removal time | ||
* | ||
* @return array | ||
*/ | ||
public function provide(): array | ||
{ | ||
$numberOfDays = $this->configHelper->getProcessedWebhookRemovalTime(); | ||
|
||
/** @var Collection $notificationCollection */ | ||
$notificationCollection = $this->notificationCollectionFactory->create(); | ||
$notificationCollection->getProcessedWebhookIdsByTimeLimit($numberOfDays, self::BATCH_SIZE); | ||
|
||
if ($notificationCollection->getSize() > 0) { | ||
return $notificationCollection->getColumnValues(NotificationInterface::ENTITY_ID); | ||
} else { | ||
return []; | ||
} | ||
} | ||
|
||
/** | ||
* Returns the provider name | ||
* | ||
* @return string | ||
*/ | ||
public function getProviderName(): string | ||
{ | ||
return "Adyen processed webhooks provider"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment module (https://www.adyen.com/) | ||
* | ||
* Copyright (c) 2025 Adyen N.V. (https://www.adyen.com/) | ||
* See LICENSE.txt for license details. | ||
* | ||
* Author: Adyen <magento@adyen.com> | ||
*/ | ||
|
||
namespace Adyen\Payment\Cron\Providers; | ||
|
||
interface WebhooksProviderInterface | ||
{ | ||
const BATCH_SIZE = 1000; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function provide(): array; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getProviderName(): string; | ||
} |
Oops, something went wrong.