-
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 pull request #2588 from Adyen/develop
Release v9.5.0
- Loading branch information
Showing
52 changed files
with
1,301 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment module (https://www.adyen.com/) | ||
* | ||
* Copyright (c) 2024 Adyen N.V. (https://www.adyen.com/) | ||
* See LICENSE.txt for license details. | ||
* | ||
* Author: Adyen <[email protected]> | ||
*/ | ||
|
||
namespace Adyen\Payment\Api; | ||
interface AdyenPosCloudInterface | ||
{ | ||
/** | ||
* @param int $orderId | ||
* @return void | ||
*/ | ||
public function pay(int $orderId): 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,21 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment module (https://www.adyen.com/) | ||
* | ||
* Copyright (c) 2024 Adyen N.V. (https://www.adyen.com/) | ||
* See LICENSE.txt for license details. | ||
* | ||
* Author: Adyen <[email protected]> | ||
*/ | ||
|
||
namespace Adyen\Payment\Api; | ||
|
||
interface GuestAdyenPosCloudInterface | ||
{ | ||
/** | ||
* @param string $cartId | ||
* @return void | ||
*/ | ||
public function payByCart(string $cartId): 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
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,81 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment Module | ||
* | ||
* Copyright (c) 2024 Adyen N.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
* | ||
* Author: Adyen <[email protected]> | ||
*/ | ||
|
||
namespace Adyen\Payment\Helper\Webhook; | ||
|
||
use Adyen\Payment\Helper\Order; | ||
use Adyen\Payment\Model\Notification; | ||
use Adyen\Webhook\PaymentStates; | ||
use Magento\Sales\Model\Order as MagentoOrder; | ||
use Adyen\Payment\Logger\AdyenLogger; | ||
use Adyen\Payment\Helper\Config; | ||
|
||
|
||
abstract class AbstractDisputeWebhookHandler implements WebhookHandlerInterface | ||
{ | ||
/** @var Order */ | ||
private $orderHelper; | ||
|
||
/** @var AdyenLogger */ | ||
private $adyenLogger; | ||
|
||
/** @var Config */ | ||
private $configHelper; | ||
|
||
public function __construct(Order $orderHelper, AdyenLogger $adyenLogger, Config $configHelper) | ||
{ | ||
$this->orderHelper = $orderHelper; | ||
$this->adyenLogger = $adyenLogger; | ||
$this->configHelper = $configHelper; | ||
} | ||
|
||
public function handleWebhook(MagentoOrder $order, Notification $notification, string $transitionState): MagentoOrder | ||
{ | ||
$ignoreDisputeNotifications = $this->configHelper->getConfigData( | ||
'ignore_dispute_notification', | ||
'adyen_abstract', | ||
$order->getStoreId() | ||
); | ||
|
||
if ($transitionState === PaymentStates::STATE_REFUNDED && !$ignoreDisputeNotifications){ | ||
$order = $this->orderHelper->refundOrder($order, $notification); | ||
$this->adyenLogger->addAdyenNotification(sprintf( | ||
'The order has been updated by the %s notification. ', | ||
$notification->getEventCode(), | ||
), [ | ||
'pspReference' => $order->getPayment()->getData('adyen_psp_reference'), | ||
'merchantReference' => $order->getPayment()->getData('entity_id') | ||
]); | ||
} | ||
elseif ($ignoreDisputeNotifications){ | ||
$this->adyenLogger->addAdyenNotification(sprintf( | ||
'Config to ignore dispute notification is enabled. Notification %s will be ignored', | ||
$notification->getId() | ||
), [ | ||
'pspReference' => $notification->getPspreference(), | ||
'merchantReference' => $notification->getMerchantReference() | ||
]); | ||
} | ||
else { | ||
$this->orderHelper->addWebhookStatusHistoryComment($order, $notification); | ||
$this->adyenLogger->addAdyenNotification(sprintf( | ||
'There is a %s notification for the order.', | ||
$notification->getEventCode(), | ||
), [ | ||
'pspReference' => $order->getPayment()->getData('adyen_psp_reference'), | ||
'merchantReference' => $order->getPayment()->getData('entity_id') | ||
]); | ||
} | ||
return $order; | ||
} | ||
|
||
} |
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,23 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment Module | ||
* | ||
* Copyright (c) 2024 Adyen N.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
* | ||
* Author: Adyen <[email protected]> | ||
*/ | ||
|
||
namespace Adyen\Payment\Helper\Webhook; | ||
|
||
use Adyen\Payment\Helper\Order; | ||
use Adyen\Payment\Model\Notification; | ||
use Magento\Sales\Model\Order as MagentoOrder; | ||
|
||
|
||
class ChargebackReversedWebhookHandler extends AbstractDisputeWebhookHandler implements WebhookHandlerInterface | ||
{ | ||
|
||
} |
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,23 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment Module | ||
* | ||
* Copyright (c) 2024 Adyen N.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
* | ||
* Author: Adyen <[email protected]> | ||
*/ | ||
|
||
namespace Adyen\Payment\Helper\Webhook; | ||
|
||
use Adyen\Payment\Helper\Order; | ||
use Adyen\Payment\Model\Notification; | ||
use Magento\Sales\Model\Order as MagentoOrder; | ||
|
||
|
||
class ChargebackWebhookHandler extends AbstractDisputeWebhookHandler implements WebhookHandlerInterface | ||
{ | ||
|
||
} |
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,23 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment Module | ||
* | ||
* Copyright (c) 2024 Adyen N.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
* | ||
* Author: Adyen <[email protected]> | ||
*/ | ||
|
||
namespace Adyen\Payment\Helper\Webhook; | ||
|
||
use Adyen\Payment\Helper\Order; | ||
use Adyen\Payment\Model\Notification; | ||
use Magento\Sales\Model\Order as MagentoOrder; | ||
|
||
|
||
class NotificationOfChargebackWebhookHandler extends AbstractDisputeWebhookHandler implements WebhookHandlerInterface | ||
{ | ||
|
||
} |
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,23 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment Module | ||
* | ||
* Copyright (c) 2024 Adyen N.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
* | ||
* Author: Adyen <[email protected]> | ||
*/ | ||
|
||
namespace Adyen\Payment\Helper\Webhook; | ||
|
||
use Adyen\Payment\Helper\Order; | ||
use Adyen\Payment\Model\Notification; | ||
use Magento\Sales\Model\Order as MagentoOrder; | ||
|
||
|
||
class RequestForInformationWebhookHandler extends AbstractDisputeWebhookHandler implements WebhookHandlerInterface | ||
{ | ||
|
||
} |
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,23 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment Module | ||
* | ||
* Copyright (c) 2024 Adyen N.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
* | ||
* Author: Adyen <[email protected]> | ||
*/ | ||
|
||
namespace Adyen\Payment\Helper\Webhook; | ||
|
||
use Adyen\Payment\Helper\Order; | ||
use Adyen\Payment\Model\Notification; | ||
use Magento\Sales\Model\Order as MagentoOrder; | ||
|
||
|
||
class SecondChargebackWebhookHandler extends AbstractDisputeWebhookHandler implements WebhookHandlerInterface | ||
{ | ||
|
||
} |
Oops, something went wrong.