Commit dbd8a60a authored by attilak's avatar attilak

Merge branch 'develop' into generic-component

parents 26ed6556 6fadad65
...@@ -67,9 +67,10 @@ class CheckoutResponseValidator extends AbstractValidator ...@@ -67,9 +67,10 @@ class CheckoutResponseValidator extends AbstractValidator
$payment->setAdditionalInformation('3dActive', false); $payment->setAdditionalInformation('3dActive', false);
$isValid = true; $isValid = true;
$errorMessages = []; $errorMessages = [];
$resultCode = $response['resultCode'];
// validate result // validate result
if (!empty($response['resultCode'])) { if (!empty($resultCode)) {
$payment->setAdditionalInformation('resultCode', $response['resultCode']); $payment->setAdditionalInformation('resultCode', $resultCode);
if (!empty($response['action'])) { if (!empty($response['action'])) {
$payment->setAdditionalInformation('action', $response['action']); $payment->setAdditionalInformation('action', $response['action']);
...@@ -87,7 +88,7 @@ class CheckoutResponseValidator extends AbstractValidator ...@@ -87,7 +88,7 @@ class CheckoutResponseValidator extends AbstractValidator
$payment->setAdditionalInformation('adyenPaymentData', $response['paymentData']); $payment->setAdditionalInformation('adyenPaymentData', $response['paymentData']);
} }
switch ($response['resultCode']) { switch ($resultCode) {
case "Authorised": case "Authorised":
case "Received": case "Received":
// TODO refactor since the full additionalData is stored in additionalInformation already // TODO refactor since the full additionalData is stored in additionalInformation already
......
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2019 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Plugin;
use Magento\Quote\Api\CartRepositoryInterface;
class GuestPaymentInformationResetOrderId
{
/**
* Quote repository.
*
* @var \Magento\Quote\Api\CartRepositoryInterface
*/
protected $quoteRepository;
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
protected $adyenLogger;
/**
* @var \Magento\Quote\Model\QuoteIdMaskFactory
*/
protected $quoteIdMaskFactory;
/**
* GuestPaymentInformationResetOrderId constructor.
* @param CartRepositoryInterface $quoteRepository
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory
*/
public function __construct(
CartRepositoryInterface $quoteRepository,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory
)
{
$this->quoteRepository = $quoteRepository;
$this->adyenLogger = $adyenLogger;
$this->quoteIdMaskFactory = $quoteIdMaskFactory;
}
/**
* @param \Magento\Checkout\Api\GuestPaymentInformationManagementInterface $subject
* @param $cartId
* @return null
*/
public function beforeSavePaymentInformationAndPlaceOrder(
\Magento\Checkout\Api\GuestPaymentInformationManagementInterface $subject,
$cartId
) {
try {
$quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
$quoteId = $quoteIdMask->getQuoteId();
$this->quoteRepository->get($quoteId)->setReservedOrderId(null);
} catch (\Exception $e) {
$this->adyenLogger->error("Failed to reset reservedOrderId for guest shopper" . $e->getMessage());
}
return null;
}
}
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2019 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Plugin;
use Magento\Quote\Api\CartRepositoryInterface;
class PaymentInformationResetOrderId
{
/**
* Quote repository.
*
* @var \Magento\Quote\Api\CartRepositoryInterface
*/
protected $quoteRepository;
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
protected $adyenLogger;
/**
* PaymentInformationResetOrderId constructor.
* @param CartRepositoryInterface $quoteRepository
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
*/
public function __construct(
CartRepositoryInterface $quoteRepository,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger
)
{
$this->quoteRepository = $quoteRepository;
$this->adyenLogger = $adyenLogger;
}
/**
* @param \Magento\Checkout\Api\PaymentInformationManagementInterface $subject
* @param $cartId
*/
public function beforeSavePaymentInformationAndPlaceOrder(
\Magento\Checkout\Api\PaymentInformationManagementInterface $subject,
$cartId
) {
try {
$this->quoteRepository->get($cartId)->setReservedOrderId(null);
} catch (\Exception $e) {
$this->adyenLogger->error("Failed to reset reservedOrderId " . $e->getMessage());
}
return null;
}
}
...@@ -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": "6.6.0", "version": "6.6.1",
"license": [ "license": [
"OSL-3.0", "OSL-3.0",
"AFL-3.0" "AFL-3.0"
......
...@@ -230,17 +230,5 @@ ...@@ -230,17 +230,5 @@
<group>adyen</group> <group>adyen</group>
</adyen_google_pay> </adyen_google_pay>
</payment> </payment>
<dev>
<js>
<minify_exclude>
<adyen_payment>adyen.com/checkoutshopper</adyen_payment>
</minify_exclude>
</js>
<css>
<minify_exclude>
<adyen_payment>adyen.com/checkoutshopper</adyen_payment>
</minify_exclude>
</css>
</dev>
</default> </default>
</config> </config>
...@@ -1020,6 +1020,14 @@ ...@@ -1020,6 +1020,14 @@
<type name="Magento\Vault\Api\PaymentTokenRepositoryInterface"> <type name="Magento\Vault\Api\PaymentTokenRepositoryInterface">
<plugin name="AdyenPaymentVaultDeleteToken" type="Adyen\Payment\Plugin\PaymentVaultDeleteToken" sortOrder="10"/> <plugin name="AdyenPaymentVaultDeleteToken" type="Adyen\Payment\Plugin\PaymentVaultDeleteToken" sortOrder="10"/>
</type> </type>
<type name="Magento\Checkout\Api\PaymentInformationManagementInterface">
<plugin name="AdyenPaymentInformationResetOrderId" type="Adyen\Payment\Plugin\PaymentInformationResetOrderId"
sortOrder="10"/>
</type>
<type name="Magento\Checkout\Api\GuestPaymentInformationManagementInterface">
<plugin name="GuestAdyenPaymentInformationResetOrderId" type="Adyen\Payment\Plugin\GuestPaymentInformationResetOrderId"
sortOrder="10"/>
</type>
<!--Notifications overview--> <!--Notifications overview-->
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory"> <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
......
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