diff --git a/Gateway/Request/CheckoutDataBuilder.php b/Gateway/Request/CheckoutDataBuilder.php index a935602..da56917 100644 --- a/Gateway/Request/CheckoutDataBuilder.php +++ b/Gateway/Request/CheckoutDataBuilder.php @@ -5,8 +5,10 @@ namespace Jh\AdyenPayment\Gateway\Request; use Adyen\Payment\Gateway\Request\CheckoutDataBuilder as OrigCheckoutDataBuilder; +use Adyen\Payment\Helper\ChargedCurrency; use Adyen\Payment\Helper\Data; use Adyen\Payment\Model\Gender; +use Magento\Framework\UrlInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Quote\Api\CartRepositoryInterface; @@ -18,9 +20,11 @@ public function __construct( Data $adyenHelper, StoreManagerInterface $storeManager, CartRepositoryInterface $cartRepository, - Gender $gender + Gender $gender, + ChargedCurrency $chargedCurrency, + UrlInterface $url ) { - parent::__construct($adyenHelper, $storeManager, $cartRepository, $gender); + parent::__construct($adyenHelper, $storeManager, $cartRepository, $gender, $chargedCurrency, $url); $this->adyenHelper = $adyenHelper; } diff --git a/Service/AdyenThreeDS1Process.php b/Service/AdyenThreeDS1Process.php index 4c5692e..67b1245 100644 --- a/Service/AdyenThreeDS1Process.php +++ b/Service/AdyenThreeDS1Process.php @@ -34,7 +34,8 @@ public function __construct( public function authorisePayment($payment, string $md, $paRes) : void { - if ($payment->getAdditionalInformation('md') === $md) { + $actionData = $payment->getAdditionalInformation('action'); + if (isset($actionData['data']['MD']) && $actionData['data']['MD'] === $md) { $result = $this->authorise3d($payment, $paRes); $responseCode = $result['resultCode']; if ($responseCode == 'Authorised') { @@ -89,7 +90,7 @@ private function authorise3d(\Magento\Payment\Model\InfoInterface $payment, stri return $service->paymentsDetails([ 'paymentData' => $payment->getAdditionalInformation('paymentData'), 'details' => [ - 'MD' => $payment->getAdditionalInformation('md'), + 'MD' => $payment->getAdditionalInformation('action')['data']['MD'], 'PaRes' => $paRes ] ]); diff --git a/composer.json b/composer.json index b8c45fe..f8916b5 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,9 @@ { "name": "wearejh/m2-module-adyen-payment", "description": "Adyen Payment module extension to support headless frontend", + "version": "2.0.0", "require": { - "adyen/module-payment": "^6.6" + "adyen/module-payment": ">=7.0" }, "autoload": { "files": [