Skip to content

Commit

Permalink
Merge pull request #533 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 4.5.3
  • Loading branch information
rikterbeek authored Oct 2, 2019
2 parents a3238d7 + 342a4f3 commit bcbba30
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 24 deletions.
4 changes: 3 additions & 1 deletion Gateway/Http/Client/TransactionAuthorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ public function __construct(
public function placeRequest(\Magento\Payment\Gateway\Http\TransferInterface $transferObject)
{
$request = $transferObject->getBody();

$requestOptions['idempotencyKey'] = $request['reference'];

// call lib
$service = new \Adyen\Service\Payment($this->_client);

try {
$response = $service->authorise($request);
$response = $service->authorise($request, $requestOptions);
} catch (\Adyen\AdyenException $e) {
$response['error'] = $e->getMessage();
}
Expand Down
3 changes: 2 additions & 1 deletion Gateway/Http/Client/TransactionPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ public function placeRequest(\Magento\Payment\Gateway\Http\TransferInterface $tr
$client = $this->adyenHelper->initializeAdyenClient();

$service = new \Adyen\Service\Checkout($client);
$requestOptions['idempotencyKey'] = $request['reference'];

try {
$response = $service->payments($request);
$response = $service->payments($request, $requestOptions);
} catch (\Adyen\AdyenException $e) {
$response['error'] = $e->getMessage();
}
Expand Down
2 changes: 2 additions & 0 deletions Model/AdyenThreeDS2Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public function initiate($payload)
try {
$client = $this->adyenHelper->initializeAdyenClient($quote->getStoreId());
$service = $this->adyenHelper->createAdyenCheckoutService($client);
$requestOptions['idempotencyKey'] = $quote->reserveOrderId()->getReservedOrderId();

$result = $service->paymentsDetails($request);
} catch (\Adyen\AdyenException $e) {
throw new \Magento\Framework\Exception\LocalizedException(__('3D secure 2.0 failed'));
Expand Down
3 changes: 2 additions & 1 deletion Model/Api/PaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ public function authorise3d($payment)
try {
$client = $this->_adyenHelper->initializeAdyenClient($storeId);
$service = $this->_adyenHelper->createAdyenCheckoutService($client);
$result = $service->paymentsDetails($request);
$requestOptions['idempotencyKey'] = $order->getIncrementId();
$result = $service->paymentsDetails($request, $requestOptions);
} catch (\Adyen\AdyenException $e) {
throw new \Magento\Framework\Exception\LocalizedException(__('3D secure failed'));
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module",
"version": "4.5.2",
"version": "4.5.3",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand All @@ -14,7 +14,7 @@
}
],
"require": {
"adyen/php-api-library": "~2.1",
"adyen/php-api-library": "~4.1",
"magento/framework": ">=101.0.8 <102 || >=102.0.1",
"magento/module-vault": "101.*"
},
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
-->
<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>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/templates/info/adyen_boleto.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ $_info = $this->getInfo();
<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('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>
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,19 @@ define(
isApplePayAllowed: function () {
var self = this;

// validate if applepay is allowed, it will be picked up by the isApplePayVisible method
var promise = window.ApplePaySession.canMakePaymentsWithActiveCard(self.getMerchantIdentifier());
promise.then(function (canMakePayments) {
if (canMakePayments)
canMakeApplePayPayments(true);
});
if (!!window.ApplePaySession) {
// validate if applepay is allowed, it will be picked up by the isApplePayVisible method
var promise = window.ApplePaySession.canMakePaymentsWithActiveCard(self.getMerchantIdentifier());
promise.then(function (canMakePayments) {
if (canMakePayments)
canMakeApplePayPayments(true);
});

if (window.ApplePaySession && window.ApplePaySession.supportsVersion(applePayVersion) ) {
return true;
if (window.ApplePaySession && window.ApplePaySession.supportsVersion(applePayVersion)) {
return true;
}
}

return false;
},
performValidation: function (validationURL) {
Expand Down Expand Up @@ -191,10 +194,10 @@ define(
}
);
},
isApplePayVisible: function() {
isApplePayVisible: function () {
return canMakeApplePayPayments();
},
getMerchantIdentifier: function() {
getMerchantIdentifier: function () {
return window.checkoutConfig.payment.adyen_apple_pay.merchant_identifier;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,6 @@ define(
}
});
},
/** Redirect to adyen */
continueToAdyen: function () {
if (this.validate() && additionalValidators.validate()) {
this.placeRedirectOrder(this.getData());
return false;
}
},
continueToAdyenBrandCode: function () {
// set payment method to adyen_hpp
var self = this;
Expand Down

0 comments on commit bcbba30

Please sign in to comment.