Skip to content

Commit

Permalink
Merge pull request #5 from WeareJH/adyen-7.0-update
Browse files Browse the repository at this point in the history
Adyen module dependency bump to 7.0
  • Loading branch information
maciejslawik authored Jun 18, 2021
2 parents d41fc73 + d9dbbad commit 1dc72a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions Gateway/Request/CheckoutDataBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down
5 changes: 3 additions & 2 deletions Service/AdyenThreeDS1Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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
]
]);
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit 1dc72a0

Please sign in to comment.