diff --git a/Helper/PaymentResponseHandler.php b/Helper/PaymentResponseHandler.php index 8d3075791..7dd404248 100644 --- a/Helper/PaymentResponseHandler.php +++ b/Helper/PaymentResponseHandler.php @@ -20,6 +20,7 @@ use Adyen\Payment\Model\Ui\AdyenOneclickConfigProvider; use Adyen\Payment\Observer\AdyenHppDataAssignObserver; use Exception; +use Magento\Framework\Exception\LocalizedException; use Magento\Sales\Api\Data\OrderInterface; use Magento\Sales\Model\Order\Payment; use Magento\Sales\Model\ResourceModel\Order; @@ -89,7 +90,7 @@ class PaymentResponseHandler * * @param AdyenLogger $adyenLogger * @param Data $adyenHelper - * @param \Adyen\Payment\Helper\Vault $vaultHelper + * @param Vault $vaultHelper */ public function __construct( AdyenLogger $adyenLogger, @@ -113,7 +114,7 @@ public function __construct( $this->paymentMethodFactory = $paymentMethodFactory; } - public function formatPaymentResponse($resultCode, $action = null, $additionalData = null, $donationToken = null) + public function formatPaymentResponse($resultCode, $action = null, $additionalData = null) { switch ($resultCode) { case self::AUTHORISED: @@ -122,8 +123,7 @@ public function formatPaymentResponse($resultCode, $action = null, $additionalDa case self::POS_SUCCESS: return [ "isFinal" => true, - "resultCode" => $resultCode, - "donationToken" => $donationToken + "resultCode" => $resultCode ]; case self::REDIRECT_SHOPPER: case self::IDENTIFY_SHOPPER: @@ -159,7 +159,7 @@ public function formatPaymentResponse($resultCode, $action = null, $additionalDa * @param Payment $payment * @param OrderInterface|null $order * @return bool - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException */ public function handlePaymentResponse($paymentsResponse, $payment, $order = null) { diff --git a/Model/Api/AdyenOrderPaymentStatus.php b/Model/Api/AdyenOrderPaymentStatus.php index 330543bbf..512abf590 100644 --- a/Model/Api/AdyenOrderPaymentStatus.php +++ b/Model/Api/AdyenOrderPaymentStatus.php @@ -17,7 +17,7 @@ use Adyen\Payment\Helper\PaymentResponseHandler; use Adyen\Payment\Logger\AdyenLogger; use Magento\Sales\Api\OrderRepositoryInterface; -use \Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Exception\NoSuchEntityException; class AdyenOrderPaymentStatus implements AdyenOrderPaymentStatusInterface { @@ -89,8 +89,7 @@ public function getOrderPaymentStatus($orderId) return json_encode($this->paymentResponseHandler->formatPaymentResponse( $additionalInformation['resultCode'], !empty($additionalInformation['action']) ? $additionalInformation['action'] : null, - !empty($additionalInformation['additionalData']) ? $additionalInformation['additionalData'] : null, - !empty($additionalInformation['donationToken']) ? $additionalInformation['donationToken'] : null + !empty($additionalInformation['additionalData']) ? $additionalInformation['additionalData'] : null )); } }