We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit bcbba30e authored by Rik ter Beek's avatar Rik ter Beek Committed by GitHub

Merge pull request #533 from Adyen/develop

Release 4.5.3
parents a3238d7b 342a4f3f
...@@ -69,12 +69,14 @@ class TransactionAuthorization implements ClientInterface ...@@ -69,12 +69,14 @@ class TransactionAuthorization implements ClientInterface
public function placeRequest(\Magento\Payment\Gateway\Http\TransferInterface $transferObject) public function placeRequest(\Magento\Payment\Gateway\Http\TransferInterface $transferObject)
{ {
$request = $transferObject->getBody(); $request = $transferObject->getBody();
$requestOptions['idempotencyKey'] = $request['reference'];
// call lib // call lib
$service = new \Adyen\Service\Payment($this->_client); $service = new \Adyen\Service\Payment($this->_client);
try { try {
$response = $service->authorise($request); $response = $service->authorise($request, $requestOptions);
} catch (\Adyen\AdyenException $e) { } catch (\Adyen\AdyenException $e) {
$response['error'] = $e->getMessage(); $response['error'] = $e->getMessage();
} }
......
...@@ -65,9 +65,10 @@ class TransactionPayment implements ClientInterface ...@@ -65,9 +65,10 @@ class TransactionPayment implements ClientInterface
$client = $this->adyenHelper->initializeAdyenClient(); $client = $this->adyenHelper->initializeAdyenClient();
$service = new \Adyen\Service\Checkout($client); $service = new \Adyen\Service\Checkout($client);
$requestOptions['idempotencyKey'] = $request['reference'];
try { try {
$response = $service->payments($request); $response = $service->payments($request, $requestOptions);
} catch (\Adyen\AdyenException $e) { } catch (\Adyen\AdyenException $e) {
$response['error'] = $e->getMessage(); $response['error'] = $e->getMessage();
} }
......
...@@ -97,6 +97,8 @@ class AdyenThreeDS2Process implements AdyenThreeDS2ProcessInterface ...@@ -97,6 +97,8 @@ class AdyenThreeDS2Process implements AdyenThreeDS2ProcessInterface
try { try {
$client = $this->adyenHelper->initializeAdyenClient($quote->getStoreId()); $client = $this->adyenHelper->initializeAdyenClient($quote->getStoreId());
$service = $this->adyenHelper->createAdyenCheckoutService($client); $service = $this->adyenHelper->createAdyenCheckoutService($client);
$requestOptions['idempotencyKey'] = $quote->reserveOrderId()->getReservedOrderId();
$result = $service->paymentsDetails($request); $result = $service->paymentsDetails($request);
} catch (\Adyen\AdyenException $e) { } catch (\Adyen\AdyenException $e) {
throw new \Magento\Framework\Exception\LocalizedException(__('3D secure 2.0 failed')); throw new \Magento\Framework\Exception\LocalizedException(__('3D secure 2.0 failed'));
......
...@@ -118,7 +118,8 @@ class PaymentRequest extends DataObject ...@@ -118,7 +118,8 @@ class PaymentRequest extends DataObject
try { try {
$client = $this->_adyenHelper->initializeAdyenClient($storeId); $client = $this->_adyenHelper->initializeAdyenClient($storeId);
$service = $this->_adyenHelper->createAdyenCheckoutService($client); $service = $this->_adyenHelper->createAdyenCheckoutService($client);
$result = $service->paymentsDetails($request); $requestOptions['idempotencyKey'] = $order->getIncrementId();
$result = $service->paymentsDetails($request, $requestOptions);
} catch (\Adyen\AdyenException $e) { } catch (\Adyen\AdyenException $e) {
throw new \Magento\Framework\Exception\LocalizedException(__('3D secure failed')); throw new \Magento\Framework\Exception\LocalizedException(__('3D secure failed'));
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "adyen/module-payment", "name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.", "description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module", "type": "magento2-module",
"version": "4.5.2", "version": "4.5.3",
"license": [ "license": [
"OSL-3.0", "OSL-3.0",
"AFL-3.0" "AFL-3.0"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
} }
], ],
"require": { "require": {
"adyen/php-api-library": "~2.1", "adyen/php-api-library": "~4.1",
"magento/framework": ">=101.0.8 <102 || >=102.0.1", "magento/framework": ">=101.0.8 <102 || >=102.0.1",
"magento/module-vault": "101.*" "magento/module-vault": "101.*"
}, },
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
--> -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Adyen_Payment" setup_version="4.5.2"> <module name="Adyen_Payment" setup_version="4.5.3">
<sequence> <sequence>
<module name="Magento_Sales"/> <module name="Magento_Sales"/>
<module name="Magento_Quote"/> <module name="Magento_Quote"/>
......
...@@ -33,5 +33,5 @@ $_info = $this->getInfo(); ...@@ -33,5 +33,5 @@ $_info = $this->getInfo();
<dt class="title"><?php echo $_info->getAdditionalInformation('boleto_type'); ?></dt> <dt class="title"><?php echo $_info->getAdditionalInformation('boleto_type'); ?></dt>
<dt class="title"><?php echo $_info->getAdditionalInformation('firstname'); ?></dt> <dt class="title"><?php echo $_info->getAdditionalInformation('firstname'); ?></dt>
<dt class="title"><?php echo $_info->getAdditionalInformation('lastname'); ?></dt> <dt class="title"><?php echo $_info->getAdditionalInformation('lastname'); ?></dt>
<dt class="title">><a target="_blank" href="<?php echo $this->getMethod()->getInfoInstance()->getAdditionalInformation('url'); ?>"><?php echo __("Click here to download Boleto PDF."); ?></a></dt> <dt class="title"><a target="_blank" href="<?php echo $this->getMethod()->getInfoInstance()->getAdditionalInformation('url'); ?>"><?php echo __("Click here to download Boleto PDF."); ?></a></dt>
</dl> </dl>
...@@ -145,16 +145,19 @@ define( ...@@ -145,16 +145,19 @@ define(
isApplePayAllowed: function () { isApplePayAllowed: function () {
var self = this; var self = this;
// validate if applepay is allowed, it will be picked up by the isApplePayVisible method if (!!window.ApplePaySession) {
var promise = window.ApplePaySession.canMakePaymentsWithActiveCard(self.getMerchantIdentifier()); // validate if applepay is allowed, it will be picked up by the isApplePayVisible method
promise.then(function (canMakePayments) { var promise = window.ApplePaySession.canMakePaymentsWithActiveCard(self.getMerchantIdentifier());
if (canMakePayments) promise.then(function (canMakePayments) {
canMakeApplePayPayments(true); if (canMakePayments)
}); canMakeApplePayPayments(true);
});
if (window.ApplePaySession && window.ApplePaySession.supportsVersion(applePayVersion) ) { if (window.ApplePaySession && window.ApplePaySession.supportsVersion(applePayVersion)) {
return true; return true;
}
} }
return false; return false;
}, },
performValidation: function (validationURL) { performValidation: function (validationURL) {
...@@ -191,10 +194,10 @@ define( ...@@ -191,10 +194,10 @@ define(
} }
); );
}, },
isApplePayVisible: function() { isApplePayVisible: function () {
return canMakeApplePayPayments(); return canMakeApplePayPayments();
}, },
getMerchantIdentifier: function() { getMerchantIdentifier: function () {
return window.checkoutConfig.payment.adyen_apple_pay.merchant_identifier; return window.checkoutConfig.payment.adyen_apple_pay.merchant_identifier;
} }
}); });
......
...@@ -518,13 +518,6 @@ define( ...@@ -518,13 +518,6 @@ define(
} }
}); });
}, },
/** Redirect to adyen */
continueToAdyen: function () {
if (this.validate() && additionalValidators.validate()) {
this.placeRedirectOrder(this.getData());
return false;
}
},
continueToAdyenBrandCode: function () { continueToAdyenBrandCode: function () {
// set payment method to adyen_hpp // set payment method to adyen_hpp
var self = this; var self = this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment