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 4b406cef authored by Rik ter Beek's avatar Rik ter Beek Committed by GitHub

Merge pull request #361 from Adyen/develop

Release 2.4.2
parents e82908bd eb2dd086
...@@ -80,7 +80,6 @@ class CronMessage implements \Magento\Framework\Notification\MessageInterface ...@@ -80,7 +80,6 @@ class CronMessage implements \Magento\Framework\Notification\MessageInterface
} else { } else {
return false; return false;
} }
} }
/** /**
...@@ -93,8 +92,11 @@ class CronMessage implements \Magento\Framework\Notification\MessageInterface ...@@ -93,8 +92,11 @@ class CronMessage implements \Magento\Framework\Notification\MessageInterface
$message = __('You have ' . $this->_cronCheck . ' unprocessed notification(s). Please check your Cron'); $message = __('You have ' . $this->_cronCheck . ' unprocessed notification(s). Please check your Cron');
$urlMagento = "http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html"; $urlMagento = "http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html";
$urlAdyen = "https://docs.adyen.com/developers/plug-ins-and-partners/magento/magento-2/configuring-the-adyen-plug-in"; $urlAdyen = "https://docs.adyen.com/developers/plug-ins-and-partners/magento/magento-2/configuring-the-adyen-plug-in";
$message .= __(' and visit <a href="%1">Magento DevDocs</a> and <a href="%2">Adyen Docs</a> on how to configure Cron.', $message .= __(
$urlMagento, $urlAdyen); ' and visit <a href="%1">Magento DevDocs</a> and <a href="%2">Adyen Docs</a> on how to configure Cron.',
$urlMagento,
$urlAdyen
);
$message .= __('<i> Last cron check was: %1</i> ', $this->_dateChecked->format('d/m/Y H:i:s')); $message .= __('<i> Last cron check was: %1</i> ', $this->_dateChecked->format('d/m/Y H:i:s'));
return __($message); return __($message);
} }
...@@ -125,4 +127,3 @@ class CronMessage implements \Magento\Framework\Notification\MessageInterface ...@@ -125,4 +127,3 @@ class CronMessage implements \Magento\Framework\Notification\MessageInterface
return $this->_authSession->getData($key, $remove); return $this->_authSession->getData($key, $remove);
} }
} }
...@@ -64,18 +64,17 @@ class VersionMessage implements \Magento\Framework\Notification\MessageInterface ...@@ -64,18 +64,17 @@ class VersionMessage implements \Magento\Framework\Notification\MessageInterface
{ {
// Only execute the query the first time you access the Admin page // Only execute the query the first time you access the Admin page
if ($this->_authSession->isFirstPageAfterLogin()) { if ($this->_authSession->isFirstPageAfterLogin()) {
try { try {
$githubContent = $this->getDecodedContentFromGithub(); $githubContent = $this->getDecodedContentFromGithub();
$this->setSessionData("AdyenGithubVersion", $githubContent); $this->setSessionData("AdyenGithubVersion", $githubContent);
$title = "Adyen extension version " . $githubContent['tag_name'] . " available!"; $title = "Adyen extension version " . $githubContent['tag_name'] . " available!";
$versionData[] = array( $versionData[] = [
'severity' => self::SEVERITY_NOTICE, 'severity' => self::SEVERITY_NOTICE,
'date_added' => $githubContent['published_at'], 'date_added' => $githubContent['published_at'],
'title' => $title, 'title' => $title,
'description' => $githubContent['body'], 'description' => $githubContent['body'],
'url' => $githubContent['html_url'], 'url' => $githubContent['html_url'],
); ];
/* /*
* The parse function checks if the $versionData message exists in the inbox, * The parse function checks if the $versionData message exists in the inbox,
...@@ -95,7 +94,6 @@ class VersionMessage implements \Magento\Framework\Notification\MessageInterface ...@@ -95,7 +94,6 @@ class VersionMessage implements \Magento\Framework\Notification\MessageInterface
} }
} }
return false; return false;
} }
/** /**
...@@ -150,6 +148,4 @@ class VersionMessage implements \Magento\Framework\Notification\MessageInterface ...@@ -150,6 +148,4 @@ class VersionMessage implements \Magento\Framework\Notification\MessageInterface
{ {
return $this->_authSession->getData($key, $remove); return $this->_authSession->getData($key, $remove);
} }
} }
...@@ -40,5 +40,4 @@ interface AdyenPaymentMethodManagementInterface ...@@ -40,5 +40,4 @@ interface AdyenPaymentMethodManagementInterface
* @return \Magento\Checkout\Api\Data\PaymentDetailsInterface * @return \Magento\Checkout\Api\Data\PaymentDetailsInterface
*/ */
public function getPaymentMethods($cartId, \Magento\Quote\Api\Data\AddressInterface $shippingAddress = null); public function getPaymentMethods($cartId, \Magento\Quote\Api\Data\AddressInterface $shippingAddress = null);
} }
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
namespace Adyen\Payment\Api; namespace Adyen\Payment\Api;
interface AdyenRequestMerchantSessionInterface interface AdyenRequestMerchantSessionInterface
{ {
...@@ -32,5 +31,4 @@ interface AdyenRequestMerchantSessionInterface ...@@ -32,5 +31,4 @@ interface AdyenRequestMerchantSessionInterface
* @return mixed * @return mixed
*/ */
public function getMerchantSession(); public function getMerchantSession();
}
}
\ No newline at end of file
...@@ -121,5 +121,4 @@ interface InvoiceInterface ...@@ -121,5 +121,4 @@ interface InvoiceInterface
* @return $this * @return $this
*/ */
public function setInvoiceId($invoiceId); public function setInvoiceId($invoiceId);
}
}
\ No newline at end of file
...@@ -301,4 +301,4 @@ interface NotificationInterface ...@@ -301,4 +301,4 @@ interface NotificationInterface
* @return $this * @return $this
*/ */
public function setUpdatedAt($timestamp); public function setUpdatedAt($timestamp);
} }
\ No newline at end of file
...@@ -201,5 +201,4 @@ interface OrderPaymentInterface ...@@ -201,5 +201,4 @@ interface OrderPaymentInterface
* @return $this * @return $this
*/ */
public function setUpdatedAt($timestamp); public function setUpdatedAt($timestamp);
}
}
\ No newline at end of file
...@@ -40,5 +40,4 @@ interface GuestAdyenPaymentMethodManagementInterface ...@@ -40,5 +40,4 @@ interface GuestAdyenPaymentMethodManagementInterface
* @return \Magento\Checkout\Api\Data\PaymentDetailsInterface * @return \Magento\Checkout\Api\Data\PaymentDetailsInterface
*/ */
public function getPaymentMethods($cartId, \Magento\Quote\Api\Data\AddressInterface $shippingAddress = null); public function getPaymentMethods($cartId, \Magento\Quote\Api\Data\AddressInterface $shippingAddress = null);
} }
...@@ -56,7 +56,7 @@ class Installments extends \Magento\Config\Block\System\Config\Form\Field\FieldA ...@@ -56,7 +56,7 @@ class Installments extends \Magento\Config\Block\System\Config\Form\Field\FieldA
/** /**
* Returns renderer for country element * Returns renderer for country element
* *
* @return \Magento\Braintree\Block\Adminhtml\Form\Field\Cctypes * @return \Magento\Braintree\Block\Adminhtml\Form\Field\Cctypes
*/ */
protected function getCcTypesRenderer() protected function getCcTypesRenderer()
...@@ -114,7 +114,6 @@ class Installments extends \Magento\Config\Block\System\Config\Form\Field\FieldA ...@@ -114,7 +114,6 @@ class Installments extends \Magento\Config\Block\System\Config\Form\Field\FieldA
$options = []; $options = [];
if ($installlments) { if ($installlments) {
$options['option_' . $this->getNumberOfInstallmentsRenderer()->calcOptionHash($installlments)] $options['option_' . $this->getNumberOfInstallmentsRenderer()->calcOptionHash($installlments)]
= 'selected="selected"'; = 'selected="selected"';
......
...@@ -58,4 +58,4 @@ class Version extends \Magento\Config\Block\System\Config\Form\Field ...@@ -58,4 +58,4 @@ class Version extends \Magento\Config\Block\System\Config\Form\Field
{ {
return $this->_adyenHelper->getModuleVersion(); return $this->_adyenHelper->getModuleVersion();
} }
} }
\ No newline at end of file
...@@ -115,4 +115,4 @@ class Success extends \Magento\Framework\View\Element\Template ...@@ -115,4 +115,4 @@ class Success extends \Magento\Framework\View\Element\Template
} }
return $this->_order; return $this->_order;
} }
} }
\ No newline at end of file
...@@ -42,8 +42,7 @@ class ApplePay extends \Magento\Payment\Block\Form ...@@ -42,8 +42,7 @@ class ApplePay extends \Magento\Payment\Block\Form
\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\View\Element\Template\Context $context,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
array $data = [] array $data = []
) ) {
{
parent::__construct($context, $data); parent::__construct($context, $data);
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
} }
...@@ -60,5 +59,4 @@ class ApplePay extends \Magento\Payment\Block\Form ...@@ -60,5 +59,4 @@ class ApplePay extends \Magento\Payment\Block\Form
} }
return $types; return $types;
} }
}
}
\ No newline at end of file
...@@ -64,5 +64,4 @@ class Boleto extends \Magento\Payment\Block\Form ...@@ -64,5 +64,4 @@ class Boleto extends \Magento\Payment\Block\Form
} }
return $types; return $types;
} }
}
}
\ No newline at end of file
...@@ -67,8 +67,7 @@ class Cc extends \Magento\Payment\Block\Form\Cc ...@@ -67,8 +67,7 @@ class Cc extends \Magento\Payment\Block\Form\Cc
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Magento\Checkout\Model\Session $checkoutSession, \Magento\Checkout\Model\Session $checkoutSession,
array $data = [] array $data = []
) ) {
{
parent::__construct($context, $paymentConfig); parent::__construct($context, $paymentConfig);
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
...@@ -110,4 +109,4 @@ class Cc extends \Magento\Payment\Block\Form\Cc ...@@ -110,4 +109,4 @@ class Cc extends \Magento\Payment\Block\Form\Cc
} }
return true; return true;
} }
} }
\ No newline at end of file
...@@ -72,6 +72,4 @@ class Oneclick extends \Adyen\Payment\Block\Form\Cc ...@@ -72,6 +72,4 @@ class Oneclick extends \Adyen\Payment\Block\Form\Cc
return $cards; return $cards;
} }
}
}
\ No newline at end of file
...@@ -30,6 +30,4 @@ class PayByMail extends \Magento\Payment\Block\Form ...@@ -30,6 +30,4 @@ class PayByMail extends \Magento\Payment\Block\Form
* @var string * @var string
*/ */
protected $_template = 'Adyen_Payment::form/pay_by_mail.phtml'; protected $_template = 'Adyen_Payment::form/pay_by_mail.phtml';
}
}
\ No newline at end of file
...@@ -30,5 +30,4 @@ class PosCloud extends \Magento\Payment\Block\Form ...@@ -30,5 +30,4 @@ class PosCloud extends \Magento\Payment\Block\Form
* @var string * @var string
*/ */
protected $_template = 'Adyen_Payment::form/pos_cloud.phtml'; protected $_template = 'Adyen_Payment::form/pos_cloud.phtml';
} }
...@@ -59,4 +59,4 @@ class Sepa extends \Magento\Payment\Block\Form ...@@ -59,4 +59,4 @@ class Sepa extends \Magento\Payment\Block\Form
{ {
return $this->_adyenHelper->getSepaCountries(); return $this->_adyenHelper->getSepaCountries();
} }
} }
\ No newline at end of file
...@@ -51,8 +51,7 @@ class AbstractInfo extends \Magento\Payment\Block\Info ...@@ -51,8 +51,7 @@ class AbstractInfo extends \Magento\Payment\Block\Info
\Adyen\Payment\Model\ResourceModel\Order\Payment\CollectionFactory $adyenOrderPaymentCollectionFactory, \Adyen\Payment\Model\ResourceModel\Order\Payment\CollectionFactory $adyenOrderPaymentCollectionFactory,
Template\Context $context, Template\Context $context,
array $data = [] array $data = []
) ) {
{
parent::__construct($context, $data); parent::__construct($context, $data);
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_adyenOrderPaymentCollectionFactory = $adyenOrderPaymentCollectionFactory; $this->_adyenOrderPaymentCollectionFactory = $adyenOrderPaymentCollectionFactory;
...@@ -76,4 +75,4 @@ class AbstractInfo extends \Magento\Payment\Block\Info ...@@ -76,4 +75,4 @@ class AbstractInfo extends \Magento\Payment\Block\Info
$storeId = $this->getInfo()->getOrder()->getStoreId(); $storeId = $this->getInfo()->getOrder()->getStoreId();
return $this->_adyenHelper->getAdyenAbstractConfigDataFlag('demo_mode', $storeId); return $this->_adyenHelper->getAdyenAbstractConfigDataFlag('demo_mode', $storeId);
} }
} }
\ No newline at end of file
...@@ -26,4 +26,4 @@ namespace Adyen\Payment\Block\Info; ...@@ -26,4 +26,4 @@ namespace Adyen\Payment\Block\Info;
class ApplePay extends Cc class ApplePay extends Cc
{ {
} }
\ No newline at end of file
...@@ -29,5 +29,4 @@ class Boleto extends AbstractInfo ...@@ -29,5 +29,4 @@ class Boleto extends AbstractInfo
* @var string * @var string
*/ */
protected $_template = 'Adyen_Payment::info/adyen_boleto.phtml'; protected $_template = 'Adyen_Payment::info/adyen_boleto.phtml';
} }
...@@ -29,5 +29,4 @@ class PayByMail extends AbstractInfo ...@@ -29,5 +29,4 @@ class PayByMail extends AbstractInfo
* @var string * @var string
*/ */
protected $_template = 'Adyen_Payment::info/adyen_pay_by_mail.phtml'; protected $_template = 'Adyen_Payment::info/adyen_pay_by_mail.phtml';
} }
...@@ -29,5 +29,4 @@ class Pos extends AbstractInfo ...@@ -29,5 +29,4 @@ class Pos extends AbstractInfo
* @var string * @var string
*/ */
protected $_template = 'Adyen_Payment::info/adyen_pos.phtml'; protected $_template = 'Adyen_Payment::info/adyen_pos.phtml';
} }
...@@ -30,5 +30,4 @@ class PosCloud extends AbstractInfo ...@@ -30,5 +30,4 @@ class PosCloud extends AbstractInfo
* @var string * @var string
*/ */
protected $_template = 'Adyen_Payment::info/adyen_pos_cloud.phtml'; protected $_template = 'Adyen_Payment::info/adyen_pos_cloud.phtml';
} }
...@@ -29,5 +29,4 @@ class Sepa extends AbstractInfo ...@@ -29,5 +29,4 @@ class Sepa extends AbstractInfo
* @var string * @var string
*/ */
protected $_template = 'Adyen_Payment::info/adyen_sepa.phtml'; protected $_template = 'Adyen_Payment::info/adyen_sepa.phtml';
} }
...@@ -105,18 +105,19 @@ class Pos extends \Magento\Payment\Block\Form ...@@ -105,18 +105,19 @@ class Pos extends \Magento\Payment\Block\Form
{ {
$launchlink = ""; $launchlink = "";
try { try {
if ($this->_order->getPayment()) if ($this->_order->getPayment()) {
{
$realOrderId = $this->_order->getRealOrderId(); $realOrderId = $this->_order->getRealOrderId();
$orderCurrencyCode = $this->_order->getOrderCurrencyCode(); $orderCurrencyCode = $this->_order->getOrderCurrencyCode();
$amount = $this->_adyenHelper->formatAmount( $amount = $this->_adyenHelper->formatAmount(
$this->_order->getGrandTotal(), $orderCurrencyCode $this->_order->getGrandTotal(),
$orderCurrencyCode
); );
$shopperEmail = $this->_order->getCustomerEmail(); $shopperEmail = $this->_order->getCustomerEmail();
$customerId = $this->_order->getCustomerId(); $customerId = $this->_order->getCustomerId();
$callbackUrl = $this->_urlBuilder->getUrl('adyen/process/resultpos', $callbackUrl = $this->_urlBuilder->getUrl(
['_secure' => $this->_getRequest()->isSecure()]); 'adyen/process/resultpos',
['_secure' => $this->_getRequest()->isSecure()]
);
$addReceiptOrderLines = $this->_adyenHelper->getAdyenPosConfigData("add_receipt_order_lines"); $addReceiptOrderLines = $this->_adyenHelper->getAdyenPosConfigData("add_receipt_order_lines");
$recurringContract = $this->_adyenHelper->getAdyenPosConfigData('recurring_type'); $recurringContract = $this->_adyenHelper->getAdyenPosConfigData('recurring_type');
$currencyCode = $orderCurrencyCode; $currencyCode = $orderCurrencyCode;
...@@ -153,7 +154,7 @@ class Pos extends \Magento\Payment\Block\Form ...@@ -153,7 +154,7 @@ class Pos extends \Magento\Payment\Block\Form
$this->_adyenLogger->addAdyenDebug(print_r($launchlink, true)); $this->_adyenLogger->addAdyenDebug(print_r($launchlink, true));
} }
} catch(Exception $e) { } catch (Exception $e) {
// do nothing for now // do nothing for now
throw($e); throw($e);
} }
...@@ -232,7 +233,6 @@ class Pos extends \Magento\Payment\Block\Form ...@@ -232,7 +233,6 @@ class Pos extends \Magento\Payment\Block\Form
); );
$myReceiptOrderLines .= " " . 1 . " " . $order->getShippingDescription() . "| " . $myReceiptOrderLines .= " " . 1 . " " . $order->getShippingDescription() . "| " .
$currency . " " . $shippingAmountFormat ."|\n"; $currency . " " . $shippingAmountFormat ."|\n";
} }
if ($order->getPaymentFeeAmount() > 0) { if ($order->getPaymentFeeAmount() > 0) {
...@@ -243,7 +243,6 @@ class Pos extends \Magento\Payment\Block\Form ...@@ -243,7 +243,6 @@ class Pos extends \Magento\Payment\Block\Form
); );
$myReceiptOrderLines .= " " . 1 . " " . $this->__('Payment Fee') . "| " . $myReceiptOrderLines .= " " . 1 . " " . $this->__('Payment Fee') . "| " .
$currency . " " . $paymentFeeAmount ."|\n"; $currency . " " . $paymentFeeAmount ."|\n";
} }
$myReceiptOrderLines .= "|--------|\n". $myReceiptOrderLines .= "|--------|\n".
...@@ -282,4 +281,4 @@ class Pos extends \Magento\Payment\Block\Form ...@@ -282,4 +281,4 @@ class Pos extends \Magento\Payment\Block\Form
{ {
return $this->_request; return $this->_request;
} }
} }
\ No newline at end of file
...@@ -84,8 +84,7 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -84,8 +84,7 @@ class Redirect extends \Magento\Payment\Block\Form
\Adyen\Payment\Logger\AdyenLogger $adyenLogger, \Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Magento\Tax\Model\Config $taxConfig, \Magento\Tax\Model\Config $taxConfig,
\Magento\Tax\Model\Calculation $taxCalculation \Magento\Tax\Model\Calculation $taxCalculation
) ) {
{
$this->_orderFactory = $orderFactory; $this->_orderFactory = $orderFactory;
$this->_checkoutSession = $checkoutSession; $this->_checkoutSession = $checkoutSession;
parent::__construct($context, $data); parent::__construct($context, $data);
...@@ -126,20 +125,19 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -126,20 +125,19 @@ class Redirect extends \Magento\Payment\Block\Form
if ($paymentRoutine == 'single' && $this->getPaymentMethodSelectionOnAdyen()) { if ($paymentRoutine == 'single' && $this->getPaymentMethodSelectionOnAdyen()) {
$url = 'https://test.adyen.com/hpp/pay.shtml'; $url = 'https://test.adyen.com/hpp/pay.shtml';
} else { } else {
if ($this->getPaymentMethodSelectionOnAdyen()) { if ($this->getPaymentMethodSelectionOnAdyen()) {
$url = 'https://test.adyen.com/hpp/select.shtml'; $url = 'https://test.adyen.com/hpp/select.shtml';
} else { } else {
if ($this->_adyenHelper->isPaymentMethodOpenInvoiceMethod( if ($this->_adyenHelper->isPaymentMethodOpenInvoiceMethod(
$this->_order->getPayment()->getAdditionalInformation('brand_code') $this->_order->getPayment()->getAdditionalInformation('brand_code')
) || $this->_adyenHelper->isPaymentMethodMolpayMethod( ) || $this->_adyenHelper->isPaymentMethodMolpayMethod(
$this->_order->getPayment()->getAdditionalInformation('brand_code') $this->_order->getPayment()->getAdditionalInformation('brand_code')
) )
) { ) {
$url = "https://test.adyen.com/hpp/skipDetails.shtml"; $url = "https://test.adyen.com/hpp/skipDetails.shtml";
} else { } else {
$url = "https://test.adyen.com/hpp/details.shtml"; $url = "https://test.adyen.com/hpp/details.shtml";
} }
} }
} }
break; break;
...@@ -150,16 +148,16 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -150,16 +148,16 @@ class Redirect extends \Magento\Payment\Block\Form
if ($this->getPaymentMethodSelectionOnAdyen()) { if ($this->getPaymentMethodSelectionOnAdyen()) {
$url = 'https://live.adyen.com/hpp/select.shtml'; $url = 'https://live.adyen.com/hpp/select.shtml';
} else { } else {
if ($this->_adyenHelper->isPaymentMethodOpenInvoiceMethod( if ($this->_adyenHelper->isPaymentMethodOpenInvoiceMethod(
$this->_order->getPayment()->getAdditionalInformation('brand_code') $this->_order->getPayment()->getAdditionalInformation('brand_code')
) || $this->_adyenHelper->isPaymentMethodMolpayMethod( ) || $this->_adyenHelper->isPaymentMethodMolpayMethod(
$this->_order->getPayment()->getAdditionalInformation('brand_code') $this->_order->getPayment()->getAdditionalInformation('brand_code')
) )
) { ) {
$url = "https://live.adyen.com/hpp/skipDetails.shtml"; $url = "https://live.adyen.com/hpp/skipDetails.shtml";
} else { } else {
$url = "https://live.adyen.com/hpp/details.shtml"; $url = "https://live.adyen.com/hpp/details.shtml";
} }
} }
} }
break; break;
...@@ -189,12 +187,12 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -189,12 +187,12 @@ class Redirect extends \Magento\Payment\Block\Form
$formFields = []; $formFields = [];
try { try {
if ($this->_order->getPayment()) { if ($this->_order->getPayment()) {
$realOrderId = $this->_order->getRealOrderId(); $realOrderId = $this->_order->getRealOrderId();
$orderCurrencyCode = $this->_order->getOrderCurrencyCode(); $orderCurrencyCode = $this->_order->getOrderCurrencyCode();
$skinCode = trim($this->_adyenHelper->getAdyenHppConfigData('skin_code')); $skinCode = trim($this->_adyenHelper->getAdyenHppConfigData('skin_code'));
$amount = $this->_adyenHelper->formatAmount( $amount = $this->_adyenHelper->formatAmount(
$this->_order->getGrandTotal(), $orderCurrencyCode $this->_order->getGrandTotal(),
$orderCurrencyCode
); );
$merchantAccount = trim($this->_adyenHelper->getAdyenAbstractConfigData('merchant_account')); $merchantAccount = trim($this->_adyenHelper->getAdyenAbstractConfigData('merchant_account'));
$shopperEmail = $this->_order->getCustomerEmail(); $shopperEmail = $this->_order->getCustomerEmail();
...@@ -238,8 +236,8 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -238,8 +236,8 @@ class Redirect extends \Magento\Payment\Block\Form
$formFields['shopperEmail'] = $shopperEmail; $formFields['shopperEmail'] = $shopperEmail;
// recurring // recurring
$recurringType = trim($this->_adyenHelper->getAdyenAbstractConfigData( $recurringType = trim($this->_adyenHelper->getAdyenAbstractConfigData(
'recurring_type') 'recurring_type'
); ));
$brandCode = $this->_order->getPayment()->getAdditionalInformation( $brandCode = $this->_order->getPayment()->getAdditionalInformation(
\Adyen\Payment\Observer\AdyenHppDataAssignObserver::BRAND_CODE \Adyen\Payment\Observer\AdyenHppDataAssignObserver::BRAND_CODE
); );
...@@ -316,7 +314,6 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -316,7 +314,6 @@ class Redirect extends \Magento\Payment\Block\Form
$this->_adyenLogger->addAdyenDebug(print_r($formFields, true)); $this->_adyenLogger->addAdyenDebug(print_r($formFields, true));
} }
} catch (Exception $e) { } catch (Exception $e) {
// do nothing for now // do nothing for now
} }
...@@ -389,7 +386,6 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -389,7 +386,6 @@ class Redirect extends \Magento\Payment\Block\Form
$shippingAddress = $this->_order->getShippingAddress(); $shippingAddress = $this->_order->getShippingAddress();
if ($shippingAddress) { if ($shippingAddress) {
$street = $this->_adyenHelper->getStreet($shippingAddress); $street = $this->_adyenHelper->getStreet($shippingAddress);
if (isset($street['name']) && $street['name'] != "") { if (isset($street['name']) && $street['name'] != "") {
...@@ -439,7 +435,6 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -439,7 +435,6 @@ class Redirect extends \Magento\Payment\Block\Form
$currency = $this->_order->getOrderCurrencyCode(); $currency = $this->_order->getOrderCurrencyCode();
foreach ($this->_order->getAllVisibleItems() as $item) { foreach ($this->_order->getAllVisibleItems() as $item) {
++$count; ++$count;
$numberOfItems = (int)$item->getQtyOrdered(); $numberOfItems = (int)$item->getQtyOrdered();
...@@ -467,13 +462,21 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -467,13 +462,21 @@ class Redirect extends \Magento\Payment\Block\Form
$itemVatPercentage = "0"; $itemVatPercentage = "0";
$numberOfItems = 1; $numberOfItems = 1;
$formFields = $this->_adyenHelper->getOpenInvoiceLineData($formFields, $count, $currency, $description, $itemAmount, $formFields = $this->_adyenHelper->getOpenInvoiceLineData(
$itemVatAmount, $itemVatPercentage, $numberOfItems, $this->_order->getPayment()); $formFields,
$count,
$currency,
$description,
$itemAmount,
$itemVatAmount,
$itemVatPercentage,
$numberOfItems,
$this->_order->getPayment()
);
} }
// Shipping cost // Shipping cost
if ($this->_order->getShippingAmount() > 0 || $this->_order->getShippingTaxAmount() > 0) { if ($this->_order->getShippingAmount() > 0 || $this->_order->getShippingTaxAmount() > 0) {
++$count; ++$count;
$formFields = $this->_adyenHelper->createOpenInvoiceLineShipping( $formFields = $this->_adyenHelper->createOpenInvoiceLineShipping(
$formFields, $formFields,
......
...@@ -120,8 +120,10 @@ class Validate3d extends \Magento\Payment\Block\Form ...@@ -120,8 +120,10 @@ class Validate3d extends \Magento\Payment\Block\Form
*/ */
public function getTermUrl() public function getTermUrl()
{ {
return $this->getUrl('adyen/process/validate3d', return $this->getUrl(
['_secure' => $this->_getRequest()->isSecure()]); 'adyen/process/validate3d',
['_secure' => $this->_getRequest()->isSecure()]
);
} }
/** /**
...@@ -133,5 +135,4 @@ class Validate3d extends \Magento\Payment\Block\Form ...@@ -133,5 +135,4 @@ class Validate3d extends \Magento\Payment\Block\Form
{ {
return $this->_request; return $this->_request;
} }
} }
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
namespace Adyen\Payment\Controller\Process; namespace Adyen\Payment\Controller\Process;
use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Config\Definition\Exception\Exception;
use Magento\Framework\App\Request\Http as HttpRequest;
/** /**
* Class Json * Class Json
...@@ -62,13 +63,20 @@ class Json extends \Magento\Framework\App\Action\Action ...@@ -62,13 +63,20 @@ class Json extends \Magento\Framework\App\Action\Action
\Magento\Framework\App\Action\Context $context, \Magento\Framework\App\Action\Context $context,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger \Adyen\Payment\Logger\AdyenLogger $adyenLogger
) ) {
{
parent::__construct($context); parent::__construct($context);
$this->_objectManager = $context->getObjectManager(); $this->_objectManager = $context->getObjectManager();
$this->_resultFactory = $context->getResultFactory(); $this->_resultFactory = $context->getResultFactory();
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger; $this->_adyenLogger = $adyenLogger;
// Fix for Magento2.3 adding isAjax to the request params
if(interface_exists("\Magento\Framework\App\CsrfAwareActionInterface")) {
$request = $this->getRequest();
if ($request instanceof HttpRequest && $request->isPost()) {
$request->setParam('isAjax', true);
}
}
} }
/** /**
...@@ -80,7 +88,6 @@ class Json extends \Magento\Framework\App\Action\Action ...@@ -80,7 +88,6 @@ class Json extends \Magento\Framework\App\Action\Action
// if version is in the notification string show the module version // if version is in the notification string show the module version
$response = $this->getRequest()->getParams(); $response = $this->getRequest()->getParams();
if (isset($response['version'])) { if (isset($response['version'])) {
$this->getResponse() $this->getResponse()
->clearHeader('Content-Type') ->clearHeader('Content-Type')
->setHeader('Content-Type', 'text/html') ->setHeader('Content-Type', 'text/html')
...@@ -101,10 +108,9 @@ class Json extends \Magento\Framework\App\Action\Action ...@@ -101,10 +108,9 @@ class Json extends \Magento\Framework\App\Action\Action
if ($notificationMode !== "" && $this->_validateNotificationMode($notificationMode)) { if ($notificationMode !== "" && $this->_validateNotificationMode($notificationMode)) {
foreach ($notificationItems['notificationItems'] as $notificationItem) { foreach ($notificationItems['notificationItems'] as $notificationItem) {
$status = $this->_processNotification( $status = $this->_processNotification(
$notificationItem['NotificationRequestItem'], $notificationMode $notificationItem['NotificationRequestItem'],
$notificationMode
); );
if ($status != true) { if ($status != true) {
...@@ -113,7 +119,6 @@ class Json extends \Magento\Framework\App\Action\Action ...@@ -113,7 +119,6 @@ class Json extends \Magento\Framework\App\Action\Action
} }
$acceptedMessage = "[accepted]"; $acceptedMessage = "[accepted]";
} }
$cronCheckTest = $notificationItems['notificationItems'][0]['NotificationRequestItem']['pspReference']; $cronCheckTest = $notificationItems['notificationItems'][0]['NotificationRequestItem']['pspReference'];
...@@ -173,7 +178,6 @@ class Json extends \Magento\Framework\App\Action\Action ...@@ -173,7 +178,6 @@ class Json extends \Magento\Framework\App\Action\Action
{ {
// validate the notification // validate the notification
if ($this->authorised($response)) { if ($this->authorised($response)) {
// check if notification already exists // check if notification already exists
if (!$this->_isDuplicate($response)) { if (!$this->_isDuplicate($response)) {
try { try {
...@@ -369,4 +373,4 @@ class Json extends \Magento\Framework\App\Action\Action ...@@ -369,4 +373,4 @@ class Json extends \Magento\Framework\App\Action\Action
->setBody($message); ->setBody($message);
return; return;
} }
} }
\ No newline at end of file
...@@ -113,4 +113,4 @@ class Redirect extends \Magento\Framework\App\Action\Action ...@@ -113,4 +113,4 @@ class Redirect extends \Magento\Framework\App\Action\Action
{ {
return $this->_objectManager->get('\Magento\Quote\Model\QuoteManagement'); return $this->_objectManager->get('\Magento\Quote\Model\QuoteManagement');
} }
} }
\ No newline at end of file
...@@ -111,4 +111,4 @@ class RedirectPos extends \Magento\Framework\App\Action\Action ...@@ -111,4 +111,4 @@ class RedirectPos extends \Magento\Framework\App\Action\Action
{ {
return $this->_objectManager->get('\Magento\Quote\Model\QuoteManagement'); return $this->_objectManager->get('\Magento\Quote\Model\QuoteManagement');
} }
} }
\ No newline at end of file
...@@ -163,7 +163,6 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -163,7 +163,6 @@ class Result extends \Magento\Framework\App\Action\Action
if ($incrementId) { if ($incrementId) {
$order = $this->_getOrder($incrementId); $order = $this->_getOrder($incrementId);
if ($order->getId()) { if ($order->getId()) {
$this->_eventManager->dispatch('adyen_payment_process_resulturl_before', [ $this->_eventManager->dispatch('adyen_payment_process_resulturl_before', [
'order' => $order, 'order' => $order,
'adyen_response' => $response 'adyen_response' => $response
...@@ -179,7 +178,6 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -179,7 +178,6 @@ class Result extends \Magento\Framework\App\Action\Action
'order' => $order, 'order' => $order,
'adyen_response' => $response 'adyen_response' => $response
]); ]);
} else { } else {
throw new \Magento\Framework\Exception\LocalizedException( throw new \Magento\Framework\Exception\LocalizedException(
__('Order does not exists with increment_id: %1', $incrementId) __('Order does not exists with increment_id: %1', $incrementId)
...@@ -209,8 +207,12 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -209,8 +207,12 @@ class Result extends \Magento\Framework\App\Action\Action
$pspReference = isset($response['pspReference']) ? trim($response['pspReference']) : ''; $pspReference = isset($response['pspReference']) ? trim($response['pspReference']) : '';
$type = 'Adyen Result URL response:'; $type = 'Adyen Result URL response:';
$comment = __('%1 <br /> authResult: %2 <br /> pspReference: %3 <br /> paymentMethod: %4', $comment = __(
$type, $authResult, $pspReference, $paymentMethod '%1 <br /> authResult: %2 <br /> pspReference: %3 <br /> paymentMethod: %4',
$type,
$authResult,
$pspReference,
$paymentMethod
); );
...@@ -225,13 +227,11 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -225,13 +227,11 @@ class Result extends \Magento\Framework\App\Action\Action
case Notification::PENDING: case Notification::PENDING:
// do nothing wait for the notification // do nothing wait for the notification
$result = true; $result = true;
if (strpos($paymentMethod,"bankTransfer") !== false){ if (strpos($paymentMethod, "bankTransfer") !== false) {
$comment .= "<br /><br />Waiting for the customer to transfer the money."; $comment .= "<br /><br />Waiting for the customer to transfer the money.";
} } elseif ($paymentMethod == "sepadirectdebit") {
elseif($paymentMethod == "sepadirectdebit"){
$comment .= "<br /><br />This request will be send to the bank at the end of the day."; $comment .= "<br /><br />This request will be send to the bank at the end of the day.";
} } else {
else {
$comment .= "<br /><br />The payment result is not confirmed (yet). $comment .= "<br /><br />The payment result is not confirmed (yet).
<br />Once the payment is authorised, the order status will be updated accordingly. <br />Once the payment is authorised, the order status will be updated accordingly.
<br />If the order is stuck on this status, the payment can be seen as unsuccessful. <br />If the order is stuck on this status, the payment can be seen as unsuccessful.
...@@ -263,8 +263,7 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -263,8 +263,7 @@ class Result extends \Magento\Framework\App\Action\Action
//->setStatus($status) //->setStatus($status)
->setComment($comment) ->setComment($comment)
->setEntityName('order') ->setEntityName('order')
->setOrder($order) ->setOrder($order);
;
$history->save(); $history->save();
...@@ -277,7 +276,8 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -277,7 +276,8 @@ class Result extends \Magento\Framework\App\Action\Action
* @param $response * @param $response
* @return bool * @return bool
*/ */
protected function _authenticate($response) { protected function _authenticate($response)
{
$merchantSigNotification = $response['merchantSig']; $merchantSigNotification = $response['merchantSig'];
...@@ -314,7 +314,7 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -314,7 +314,7 @@ class Result extends \Magento\Framework\App\Action\Action
*/ */
protected function escapeString($val) protected function escapeString($val)
{ {
return str_replace(':','\\:',str_replace('\\','\\\\',$val)); return str_replace(':', '\\:', str_replace('\\', '\\\\', $val));
} }
/** /**
...@@ -330,4 +330,4 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -330,4 +330,4 @@ class Result extends \Magento\Framework\App\Action\Action
} }
return $this->_order; return $this->_order;
} }
} }
\ No newline at end of file
...@@ -111,27 +111,27 @@ class ResultPos extends \Magento\Framework\App\Action\Action ...@@ -111,27 +111,27 @@ class ResultPos extends \Magento\Framework\App\Action\Action
$result = false; $result = false;
if ($response != null && $response['result'] != "" && $this->_validateChecksum($response)) { if ($response != null && $response['result'] != "" && $this->_validateChecksum($response)) {
$incrementId = $response['merchantReference']; $incrementId = $response['merchantReference'];
$responseResult = $response['result']; $responseResult = $response['result'];
if ($incrementId) { if ($incrementId) {
$order = $this->_getOrder($incrementId); $order = $this->_getOrder($incrementId);
if ($order->getId()) { if ($order->getId()) {
$comment = __(
$comment = __('%1 <br /> Result: %2 <br /> paymentMethod: %3', '%1 <br /> Result: %2 <br /> paymentMethod: %3',
'Adyen App Result URL Notification:', $responseResult, 'POS'); 'Adyen App Result URL Notification:',
$responseResult,
'POS'
);
if ($responseResult == 'APPROVED') { if ($responseResult == 'APPROVED') {
$this->_adyenLogger->addAdyenResult('Result is approved'); $this->_adyenLogger->addAdyenResult('Result is approved');
$history = $this->_orderHistoryFactory->create() $history = $this->_orderHistoryFactory->create()
//->setStatus($status) //->setStatus($status)
->setComment($comment) ->setComment($comment)
->setEntityName('order') ->setEntityName('order')
->setOrder($order) ->setOrder($order);
;
$history->save(); $history->save();
// needed becuase then we need to save $order objects // needed becuase then we need to save $order objects
...@@ -148,8 +148,7 @@ class ResultPos extends \Magento\Framework\App\Action\Action ...@@ -148,8 +148,7 @@ class ResultPos extends \Magento\Framework\App\Action\Action
//->setStatus($status) //->setStatus($status)
->setComment($comment) ->setComment($comment)
->setEntityName('order') ->setEntityName('order')
->setOrder($order) ->setOrder($order);
;
$history->save(); $history->save();
// cancel the order // cancel the order
...@@ -282,4 +281,4 @@ class ResultPos extends \Magento\Framework\App\Action\Action ...@@ -282,4 +281,4 @@ class ResultPos extends \Magento\Framework\App\Action\Action
} }
} }
} }
} }
\ No newline at end of file
...@@ -94,19 +94,16 @@ class Validate3d extends \Magento\Framework\App\Action\Action ...@@ -94,19 +94,16 @@ class Validate3d extends \Magento\Framework\App\Action\Action
// check if 3D secure is active. If not just go to success page // check if 3D secure is active. If not just go to success page
if ($active && $success != true) { if ($active && $success != true) {
$this->_adyenLogger->addAdyenResult("3D secure is active"); $this->_adyenLogger->addAdyenResult("3D secure is active");
// check if it is already processed // check if it is already processed
if ($this->getRequest()->isPost()) { if ($this->getRequest()->isPost()) {
$this->_adyenLogger->addAdyenResult("Process 3D secure payment"); $this->_adyenLogger->addAdyenResult("Process 3D secure payment");
$requestMD = $this->getRequest()->getPost('MD'); $requestMD = $this->getRequest()->getPost('MD');
$requestPaRes = $this->getRequest()->getPost('PaRes'); $requestPaRes = $this->getRequest()->getPost('PaRes');
$md = $order->getPayment()->getAdditionalInformation('md'); $md = $order->getPayment()->getAdditionalInformation('md');
if ($requestMD == $md) { if ($requestMD == $md) {
$order->getPayment()->setAdditionalInformation('paResponse', $requestPaRes); $order->getPayment()->setAdditionalInformation('paResponse', $requestPaRes);
try { try {
...@@ -159,7 +156,8 @@ class Validate3d extends \Magento\Framework\App\Action\Action ...@@ -159,7 +156,8 @@ class Validate3d extends \Magento\Framework\App\Action\Action
__('Customer was redirected to bank for 3D-secure validation. Once the shopper authenticated, the order status will be updated accordingly. __('Customer was redirected to bank for 3D-secure validation. Once the shopper authenticated, the order status will be updated accordingly.
<br />Make sure that your notifications are being processed! <br />Make sure that your notifications are being processed!
<br />If the order is stuck on this status, the shopper abandoned the session. The payment can be seen as unsuccessful. <br />If the order is stuck on this status, the shopper abandoned the session. The payment can be seen as unsuccessful.
<br />The order can be automatically cancelled based on the OFFER_CLOSED notification. Please contact Adyen Support to enable this.'))->save(); <br />The order can be automatically cancelled based on the OFFER_CLOSED notification. Please contact Adyen Support to enable this.')
)->save();
$this->_view->loadLayout(); $this->_view->loadLayout();
$this->_view->getLayout()->initMessages(); $this->_view->getLayout()->initMessages();
$this->_view->renderLayout(); $this->_view->renderLayout();
...@@ -180,7 +178,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action ...@@ -180,7 +178,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action
{ {
try { try {
$response = $this->_paymentRequest->authorise3d($payment); $response = $this->_paymentRequest->authorise3d($payment);
} catch(\Exception $e) { } catch (\Exception $e) {
throw $e; throw $e;
} }
$responseCode = $response['resultCode']; $responseCode = $response['resultCode'];
......
...@@ -61,8 +61,8 @@ class HppCommand implements CommandInterface ...@@ -61,8 +61,8 @@ class HppCommand implements CommandInterface
// update customer based on additionalFields // update customer based on additionalFields
if ($payment->getAdditionalInformation("gender")) { if ($payment->getAdditionalInformation("gender")) {
$order->setCustomerGender(\Adyen\Payment\Model\Gender::getMagentoGenderFromAdyenGender( $order->setCustomerGender(\Adyen\Payment\Model\Gender::getMagentoGenderFromAdyenGender(
$payment->getAdditionalInformation("gender")) $payment->getAdditionalInformation("gender")
); ));
} }
if ($payment->getAdditionalInformation("dob")) { if ($payment->getAdditionalInformation("dob")) {
...@@ -80,4 +80,4 @@ class HppCommand implements CommandInterface ...@@ -80,4 +80,4 @@ class HppCommand implements CommandInterface
return $this; return $this;
} }
} }
\ No newline at end of file
...@@ -26,7 +26,6 @@ namespace Adyen\Payment\Gateway\Command; ...@@ -26,7 +26,6 @@ namespace Adyen\Payment\Gateway\Command;
use Magento\Payment\Gateway\Command; use Magento\Payment\Gateway\Command;
use Magento\Payment\Gateway\CommandInterface; use Magento\Payment\Gateway\CommandInterface;
class PayByMailCommand implements CommandInterface class PayByMailCommand implements CommandInterface
{ {
......
...@@ -63,4 +63,4 @@ class PosCommand implements CommandInterface ...@@ -63,4 +63,4 @@ class PosCommand implements CommandInterface
return $this; return $this;
} }
} }
\ No newline at end of file
...@@ -60,7 +60,7 @@ class TransactionAuthorization implements ClientInterface ...@@ -60,7 +60,7 @@ class TransactionAuthorization implements ClientInterface
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
$this->_client = $this->_adyenHelper->initializeAdyenClient(); $this->_client = $this->_adyenHelper->initializeAdyenClient();
} }
/** /**
...@@ -77,7 +77,7 @@ class TransactionAuthorization implements ClientInterface ...@@ -77,7 +77,7 @@ class TransactionAuthorization implements ClientInterface
try { try {
$response = $service->authorise($request); $response = $service->authorise($request);
} catch(\Adyen\AdyenException $e) { } catch (\Adyen\AdyenException $e) {
$response['error'] = $e->getMessage(); $response['error'] = $e->getMessage();
} }
return $response; return $response;
......
...@@ -55,7 +55,7 @@ class TransactionCancel implements ClientInterface ...@@ -55,7 +55,7 @@ class TransactionCancel implements ClientInterface
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
$this->_client = $this->_adyenHelper->initializeAdyenClient(); $this->_client = $this->_adyenHelper->initializeAdyenClient();
} }
/** /**
...@@ -71,10 +71,10 @@ class TransactionCancel implements ClientInterface ...@@ -71,10 +71,10 @@ class TransactionCancel implements ClientInterface
try { try {
$response = $service->cancel($request); $response = $service->cancel($request);
} catch(\Adyen\AdyenException $e) { } catch (\Adyen\AdyenException $e) {
$response = null; $response = null;
} }
return $response; return $response;
} }
} }
\ No newline at end of file
...@@ -55,7 +55,7 @@ class TransactionCapture implements ClientInterface ...@@ -55,7 +55,7 @@ class TransactionCapture implements ClientInterface
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
$this->_client = $this->_adyenHelper->initializeAdyenClient(); $this->_client = $this->_adyenHelper->initializeAdyenClient();
} }
/** /**
...@@ -71,11 +71,11 @@ class TransactionCapture implements ClientInterface ...@@ -71,11 +71,11 @@ class TransactionCapture implements ClientInterface
try { try {
$response = $service->capture($request); $response = $service->capture($request);
} catch(\Adyen\AdyenException $e) { } catch (\Adyen\AdyenException $e) {
$this->_adyenLogger->error($e); // add this for now not in the lib yet $this->_adyenLogger->error($e); // add this for now not in the lib yet
$response = null; $response = null;
} }
return $response; return $response;
} }
} }
\ No newline at end of file
...@@ -35,19 +35,19 @@ class TransactionPosCloudSync implements ClientInterface ...@@ -35,19 +35,19 @@ class TransactionPosCloudSync implements ClientInterface
*/ */
protected $storeId; protected $storeId;
/** /**
* @var \Adyen\Client * @var \Adyen\Client
*/ */
protected $client; protected $client;
/** /**
* @var \Adyen\Payment\Helper\Data * @var \Adyen\Payment\Helper\Data
*/ */
protected $adyenHelper; protected $adyenHelper;
/** /**
* @var \Adyen\Payment\Logger\AdyenLogger * @var \Adyen\Payment\Logger\AdyenLogger
*/ */
protected $adyenLogger; protected $adyenLogger;
public function __construct( public function __construct(
...@@ -60,7 +60,7 @@ class TransactionPosCloudSync implements ClientInterface ...@@ -60,7 +60,7 @@ class TransactionPosCloudSync implements ClientInterface
$this->adyenLogger = $adyenLogger; $this->adyenLogger = $adyenLogger;
$this->storeId = $storeManager->getStore()->getId(); $this->storeId = $storeManager->getStore()->getId();
$apiKey = $this->adyenHelper->getPosApiKey($this->storeId); $apiKey = $this->adyenHelper->getPosApiKey($this->storeId);
// initialize client // initialize client
$client = $this->adyenHelper->initializeAdyenClient($this->storeId, $apiKey); $client = $this->adyenHelper->initializeAdyenClient($this->storeId, $apiKey);
...@@ -72,7 +72,6 @@ class TransactionPosCloudSync implements ClientInterface ...@@ -72,7 +72,6 @@ class TransactionPosCloudSync implements ClientInterface
} }
$this->client = $client; $this->client = $client;
} }
/** /**
......
...@@ -55,7 +55,7 @@ class TransactionRefund implements ClientInterface ...@@ -55,7 +55,7 @@ class TransactionRefund implements ClientInterface
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
$this->_client = $this->_adyenHelper->initializeAdyenClient(); $this->_client = $this->_adyenHelper->initializeAdyenClient();
} }
/** /**
...@@ -68,16 +68,15 @@ class TransactionRefund implements ClientInterface ...@@ -68,16 +68,15 @@ class TransactionRefund implements ClientInterface
$responses = []; $responses = [];
foreach ($requests as $request) { foreach ($requests as $request) {
// call lib // call lib
$service = new \Adyen\Service\Modification($this->_client); $service = new \Adyen\Service\Modification($this->_client);
try { try {
$responses[] = $service->refund($request); $responses[] = $service->refund($request);
} catch(\Adyen\AdyenException $e) { } catch (\Adyen\AdyenException $e) {
$responses[] = null; $responses[] = null;
} }
} }
return $responses; return $responses;
} }
} }
\ No newline at end of file
...@@ -56,4 +56,4 @@ class TransferFactory implements TransferFactoryInterface ...@@ -56,4 +56,4 @@ class TransferFactory implements TransferFactoryInterface
->setBody($request) ->setBody($request)
->build(); ->build();
} }
} }
\ No newline at end of file
...@@ -47,7 +47,7 @@ class AddressDataBuilder implements BuilderInterface ...@@ -47,7 +47,7 @@ class AddressDataBuilder implements BuilderInterface
/** /**
* Add delivery\billing details into request * Add delivery\billing details into request
* *
* @param array $buildSubject * @param array $buildSubject
* @return array * @return array
*/ */
...@@ -61,7 +61,6 @@ class AddressDataBuilder implements BuilderInterface ...@@ -61,7 +61,6 @@ class AddressDataBuilder implements BuilderInterface
$billingAddress = $order->getBillingAddress(); $billingAddress = $order->getBillingAddress();
if ($billingAddress) { if ($billingAddress) {
$requestBilling = ["street" => "N/A", $requestBilling = ["street" => "N/A",
"postalCode" => '', "postalCode" => '',
"city" => "N/A", "city" => "N/A",
...@@ -95,7 +94,6 @@ class AddressDataBuilder implements BuilderInterface ...@@ -95,7 +94,6 @@ class AddressDataBuilder implements BuilderInterface
$shippingAddress = $order->getShippingAddress(); $shippingAddress = $order->getShippingAddress();
if ($shippingAddress) { if ($shippingAddress) {
// filter housenumber from streetLine1 // filter housenumber from streetLine1
$requestDelivery = ["street" => $shippingAddress->getStreetLine1(), $requestDelivery = ["street" => $shippingAddress->getStreetLine1(),
"postalCode" => $shippingAddress->getPostcode(), "postalCode" => $shippingAddress->getPostcode(),
......
...@@ -48,8 +48,7 @@ class ApplePayAuthorizationDataBuilder implements BuilderInterface ...@@ -48,8 +48,7 @@ class ApplePayAuthorizationDataBuilder implements BuilderInterface
public function __construct( public function __construct(
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger \Adyen\Payment\Logger\AdyenLogger $adyenLogger
) ) {
{
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger; $this->_adyenLogger = $adyenLogger;
} }
...@@ -77,5 +76,4 @@ class ApplePayAuthorizationDataBuilder implements BuilderInterface ...@@ -77,5 +76,4 @@ class ApplePayAuthorizationDataBuilder implements BuilderInterface
return $request; return $request;
} }
}
}
\ No newline at end of file
...@@ -61,4 +61,4 @@ class Authorize3DSecureDataBuilder implements BuilderInterface ...@@ -61,4 +61,4 @@ class Authorize3DSecureDataBuilder implements BuilderInterface
"paResponse" => $paResponse, "paResponse" => $paResponse,
]; ];
} }
} }
\ No newline at end of file
...@@ -81,16 +81,18 @@ class BoletoAuthorizationDataBuilder implements BuilderInterface ...@@ -81,16 +81,18 @@ class BoletoAuthorizationDataBuilder implements BuilderInterface
$deliveryDays = (!empty($deliveryDays)) ? $deliveryDays : 5; $deliveryDays = (!empty($deliveryDays)) ? $deliveryDays : 5;
$deliveryDate = date( $deliveryDate = date(
"Y-m-d\TH:i:s ", "Y-m-d\TH:i:s ",
mktime(date("H"), mktime(
date("H"),
date("i"), date("i"),
date("s"), date("s"),
date("m"), date("m"),
date("j") + $deliveryDays, date("j") + $deliveryDays,
date("Y")) date("Y")
)
); );
$request['deliveryDate'] = $deliveryDate; $request['deliveryDate'] = $deliveryDate;
return $request; return $request;
} }
} }
\ No newline at end of file
...@@ -43,4 +43,4 @@ class BrowserInfoDataBuilder implements BuilderInterface ...@@ -43,4 +43,4 @@ class BrowserInfoDataBuilder implements BuilderInterface
] ]
]; ];
} }
} }
\ No newline at end of file
...@@ -48,7 +48,7 @@ class CancelDataBuilder implements BuilderInterface ...@@ -48,7 +48,7 @@ class CancelDataBuilder implements BuilderInterface
/** /**
* Create cancel_or_refund request * Create cancel_or_refund request
* *
* @param array $buildSubject * @param array $buildSubject
* @return array * @return array
*/ */
...@@ -65,4 +65,4 @@ class CancelDataBuilder implements BuilderInterface ...@@ -65,4 +65,4 @@ class CancelDataBuilder implements BuilderInterface
"originalReference" => $pspReference "originalReference" => $pspReference
]; ];
} }
} }
\ No newline at end of file
...@@ -137,4 +137,4 @@ class CaptureDataBuilder implements BuilderInterface ...@@ -137,4 +137,4 @@ class CaptureDataBuilder implements BuilderInterface
return $formFields; return $formFields;
} }
} }
\ No newline at end of file
...@@ -47,8 +47,7 @@ class CcAuthorizationDataBuilder implements BuilderInterface ...@@ -47,8 +47,7 @@ class CcAuthorizationDataBuilder implements BuilderInterface
public function __construct( public function __construct(
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Magento\Framework\Model\Context $context \Magento\Framework\Model\Context $context
) ) {
{
$this->adyenHelper = $adyenHelper; $this->adyenHelper = $adyenHelper;
$this->appState = $context->getAppState(); $this->appState = $context->getAppState();
} }
...@@ -92,4 +91,4 @@ class CcAuthorizationDataBuilder implements BuilderInterface ...@@ -92,4 +91,4 @@ class CcAuthorizationDataBuilder implements BuilderInterface
return $request; return $request;
} }
} }
\ No newline at end of file
...@@ -32,7 +32,7 @@ class CustomerDataBuilder implements BuilderInterface ...@@ -32,7 +32,7 @@ class CustomerDataBuilder implements BuilderInterface
/** /**
* Add shopper data into request * Add shopper data into request
* *
* @param array $buildSubject * @param array $buildSubject
* @return array * @return array
*/ */
......
...@@ -60,4 +60,4 @@ class MerchantAccountDataBuilder implements BuilderInterface ...@@ -60,4 +60,4 @@ class MerchantAccountDataBuilder implements BuilderInterface
return ["merchantAccount" => $merchantAccount]; return ["merchantAccount" => $merchantAccount];
} }
} }
\ No newline at end of file
...@@ -81,4 +81,4 @@ class OneclickAuthorizationDataBuilder implements BuilderInterface ...@@ -81,4 +81,4 @@ class OneclickAuthorizationDataBuilder implements BuilderInterface
return $request; return $request;
} }
} }
\ No newline at end of file
...@@ -37,7 +37,7 @@ class PaymentDataBuilder implements BuilderInterface ...@@ -37,7 +37,7 @@ class PaymentDataBuilder implements BuilderInterface
/** /**
* PaymentDataBuilder constructor. * PaymentDataBuilder constructor.
* *
* @param \Adyen\Payment\Helper\Data $adyenHelper * @param \Adyen\Payment\Helper\Data $adyenHelper
*/ */
public function __construct(\Adyen\Payment\Helper\Data $adyenHelper) public function __construct(\Adyen\Payment\Helper\Data $adyenHelper)
...@@ -70,4 +70,4 @@ class PaymentDataBuilder implements BuilderInterface ...@@ -70,4 +70,4 @@ class PaymentDataBuilder implements BuilderInterface
"fraudOffset" => "0" "fraudOffset" => "0"
]; ];
} }
} }
\ No newline at end of file
...@@ -84,7 +84,7 @@ class RecurringDataBuilder implements BuilderInterface ...@@ -84,7 +84,7 @@ class RecurringDataBuilder implements BuilderInterface
} else { } else {
$recurringContractType = \Adyen\Payment\Model\RecurringType::RECURRING; $recurringContractType = \Adyen\Payment\Model\RecurringType::RECURRING;
} }
} else if ($paymentMethodCode == \Adyen\Payment\Model\Ui\AdyenCcConfigProvider::CODE) { } elseif ($paymentMethodCode == \Adyen\Payment\Model\Ui\AdyenCcConfigProvider::CODE) {
if ($payment->getAdditionalInformation("store_cc") == "" && if ($payment->getAdditionalInformation("store_cc") == "" &&
($recurringType == "ONECLICK,RECURRING" || $recurringType == "RECURRING")) { ($recurringType == "ONECLICK,RECURRING" || $recurringType == "RECURRING")) {
$recurringContractType = \Adyen\Payment\Model\RecurringType::RECURRING; $recurringContractType = \Adyen\Payment\Model\RecurringType::RECURRING;
...@@ -104,4 +104,4 @@ class RecurringDataBuilder implements BuilderInterface ...@@ -104,4 +104,4 @@ class RecurringDataBuilder implements BuilderInterface
return $result; return $result;
} }
} }
\ No newline at end of file
...@@ -88,7 +88,6 @@ class RefundDataBuilder implements BuilderInterface ...@@ -88,7 +88,6 @@ class RefundDataBuilder implements BuilderInterface
// partial refund if multiple payments check refund strategy // partial refund if multiple payments check refund strategy
if ($orderPaymentCollection->getSize() > 1) { if ($orderPaymentCollection->getSize() > 1) {
$refundStrategy = $this->adyenHelper->getAdyenAbstractConfigData( $refundStrategy = $this->adyenHelper->getAdyenAbstractConfigData(
'split_payments_refund_strategy', 'split_payments_refund_strategy',
$order->getStoreId() $order->getStoreId()
...@@ -173,7 +172,6 @@ class RefundDataBuilder implements BuilderInterface ...@@ -173,7 +172,6 @@ class RefundDataBuilder implements BuilderInterface
//There is only one payment, so we add the fields to the first(and only) result //There is only one payment, so we add the fields to the first(and only) result
$result[0]["additionalData"] = $openInvoiceFields; $result[0]["additionalData"] = $openInvoiceFields;
} }
} }
return $result; return $result;
...@@ -207,7 +205,6 @@ class RefundDataBuilder implements BuilderInterface ...@@ -207,7 +205,6 @@ class RefundDataBuilder implements BuilderInterface
$numberOfItems, $numberOfItems,
$payment $payment
); );
} }
// Shipping cost // Shipping cost
...@@ -233,10 +230,10 @@ class RefundDataBuilder implements BuilderInterface ...@@ -233,10 +230,10 @@ class RefundDataBuilder implements BuilderInterface
$invoice = $invoices->getFirstItem(); $invoice = $invoices->getFirstItem();
if($invoice) { if ($invoice) {
$formFields['acquirerReference'] = $invoice->getAcquirerReference(); $formFields['acquirerReference'] = $invoice->getAcquirerReference();
} }
return $formFields; return $formFields;
} }
} }
\ No newline at end of file
...@@ -52,4 +52,4 @@ class SepaAuthorizationDataBuilder implements BuilderInterface ...@@ -52,4 +52,4 @@ class SepaAuthorizationDataBuilder implements BuilderInterface
return $request; return $request;
} }
} }
\ No newline at end of file
...@@ -54,6 +54,5 @@ class PaymentAuthorisationDetailsHandler implements HandlerInterface ...@@ -54,6 +54,5 @@ class PaymentAuthorisationDetailsHandler implements HandlerInterface
// do not close transaction so you can do a cancel() and void // do not close transaction so you can do a cancel() and void
$payment->setIsTransactionClosed(false); $payment->setIsTransactionClosed(false);
$payment->setShouldCloseParentTransaction(false); $payment->setShouldCloseParentTransaction(false);
} }
} }
\ No newline at end of file
...@@ -45,4 +45,4 @@ class PaymentCancelDetailsHandler implements HandlerInterface ...@@ -45,4 +45,4 @@ class PaymentCancelDetailsHandler implements HandlerInterface
$payment->setIsTransactionClosed(true); $payment->setIsTransactionClosed(true);
$payment->setShouldCloseParentTransaction(true); $payment->setShouldCloseParentTransaction(true);
} }
} }
\ No newline at end of file
...@@ -48,4 +48,4 @@ class PaymentCaptureDetailsHandler implements HandlerInterface ...@@ -48,4 +48,4 @@ class PaymentCaptureDetailsHandler implements HandlerInterface
$payment->setIsTransactionClosed(true); $payment->setIsTransactionClosed(true);
$payment->setShouldCloseParentTransaction(false); $payment->setShouldCloseParentTransaction(false);
} }
} }
\ No newline at end of file
...@@ -43,7 +43,6 @@ class PaymentCommentHistoryHandler implements HandlerInterface ...@@ -43,7 +43,6 @@ class PaymentCommentHistoryHandler implements HandlerInterface
if (isset($response['resultCode'])) { if (isset($response['resultCode'])) {
$responseCode = $response['resultCode']; $responseCode = $response['resultCode'];
} else { } else {
// try to get response from response key (used for modifications // try to get response from response key (used for modifications
if (isset($response['response'])) { if (isset($response['response'])) {
$responseCode = $response['response']; $responseCode = $response['response'];
...@@ -59,8 +58,12 @@ class PaymentCommentHistoryHandler implements HandlerInterface ...@@ -59,8 +58,12 @@ class PaymentCommentHistoryHandler implements HandlerInterface
} }
$type = 'Adyen Result response:'; $type = 'Adyen Result response:';
$comment = __('%1 <br /> authResult: %2 <br /> pspReference: %3 ', $comment = __(
$type, $responseCode, $pspReference); '%1 <br /> authResult: %2 <br /> pspReference: %3 ',
$type,
$responseCode,
$pspReference
);
if ($responseCode) { if ($responseCode) {
$payment->getOrder()->setAdyenResulturlEventCode($responseCode); $payment->getOrder()->setAdyenResulturlEventCode($responseCode);
...@@ -71,4 +74,3 @@ class PaymentCommentHistoryHandler implements HandlerInterface ...@@ -71,4 +74,3 @@ class PaymentCommentHistoryHandler implements HandlerInterface
return $this; return $this;
} }
} }
...@@ -44,7 +44,6 @@ class PaymentCommentHistoryRefundHandler implements HandlerInterface ...@@ -44,7 +44,6 @@ class PaymentCommentHistoryRefundHandler implements HandlerInterface
if (isset($singleResponse['resultCode'])) { if (isset($singleResponse['resultCode'])) {
$responseCode = $singleResponse['resultCode']; $responseCode = $singleResponse['resultCode'];
} else { } else {
// try to get response from response key (used for modifications // try to get response from response key (used for modifications
if (isset($singleResponse['response'])) { if (isset($singleResponse['response'])) {
$responseCode = $singleResponse['response']; $responseCode = $singleResponse['response'];
...@@ -60,8 +59,12 @@ class PaymentCommentHistoryRefundHandler implements HandlerInterface ...@@ -60,8 +59,12 @@ class PaymentCommentHistoryRefundHandler implements HandlerInterface
} }
$type = 'Adyen Result response:'; $type = 'Adyen Result response:';
$comment = __('%1 <br /> authResult: %2 <br /> pspReference: %3 ', $comment = __(
$type, $responseCode, $pspReference); '%1 <br /> authResult: %2 <br /> pspReference: %3 ',
$type,
$responseCode,
$pspReference
);
if ($responseCode) { if ($responseCode) {
$payment->getOrder()->setAdyenResulturlEventCode($responseCode); $payment->getOrder()->setAdyenResulturlEventCode($responseCode);
...@@ -73,4 +76,3 @@ class PaymentCommentHistoryRefundHandler implements HandlerInterface ...@@ -73,4 +76,3 @@ class PaymentCommentHistoryRefundHandler implements HandlerInterface
return $this; return $this;
} }
} }
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
namespace Adyen\Payment\Gateway\Response; namespace Adyen\Payment\Gateway\Response;
use Magento\Payment\Gateway\Response\HandlerInterface; use Magento\Payment\Gateway\Response\HandlerInterface;
use Magento\Setup\Exception; use Magento\Setup\Exception;
...@@ -35,9 +34,9 @@ class PaymentPosCloudHandler implements HandlerInterface ...@@ -35,9 +34,9 @@ class PaymentPosCloudHandler implements HandlerInterface
*/ */
private $adyenHelper; private $adyenHelper;
/** /**
* @var \Adyen\Payment\Logger\AdyenLogger * @var \Adyen\Payment\Logger\AdyenLogger
*/ */
private $adyenLogger; private $adyenLogger;
/** /**
...@@ -64,7 +63,7 @@ class PaymentPosCloudHandler implements HandlerInterface ...@@ -64,7 +63,7 @@ class PaymentPosCloudHandler implements HandlerInterface
*/ */
public function handle(array $handlingSubject, array $paymentResponse) public function handle(array $handlingSubject, array $paymentResponse)
{ {
$paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($handlingSubject); $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($handlingSubject);
/** @var OrderPaymentInterface $payment */ /** @var OrderPaymentInterface $payment */
$payment = $paymentDataObject->getPayment(); $payment = $paymentDataObject->getPayment();
......
...@@ -51,4 +51,4 @@ class PaymentRefundDetailsHandler implements HandlerInterface ...@@ -51,4 +51,4 @@ class PaymentRefundDetailsHandler implements HandlerInterface
$closeParent = !(bool)$payment->getCreditmemo()->getInvoice()->canRefund(); $closeParent = !(bool)$payment->getCreditmemo()->getInvoice()->canRefund();
$payment->setShouldCloseParentTransaction($closeParent); $payment->setShouldCloseParentTransaction($closeParent);
} }
} }
\ No newline at end of file
...@@ -66,4 +66,4 @@ class CancelResponseValidator extends AbstractValidator ...@@ -66,4 +66,4 @@ class CancelResponseValidator extends AbstractValidator
return $this->createResult($isValid, $errorMessages); return $this->createResult($isValid, $errorMessages);
} }
} }
\ No newline at end of file
...@@ -66,4 +66,4 @@ class CaptureResponseValidator extends AbstractValidator ...@@ -66,4 +66,4 @@ class CaptureResponseValidator extends AbstractValidator
return $this->createResult($isValid, $errorMessages); return $this->createResult($isValid, $errorMessages);
} }
} }
\ No newline at end of file
...@@ -70,7 +70,6 @@ class GeneralResponseValidator extends AbstractValidator ...@@ -70,7 +70,6 @@ class GeneralResponseValidator extends AbstractValidator
$payment->setAdditionalInformation('pspReference', $response['pspReference']); $payment->setAdditionalInformation('pspReference', $response['pspReference']);
// set additionalData // set additionalData
if (isset($response['additionalData']) && is_array($response['additionalData'])) { if (isset($response['additionalData']) && is_array($response['additionalData'])) {
$additionalData = $response['additionalData']; $additionalData = $response['additionalData'];
if (isset($additionalData['boletobancario.dueDate'])) { if (isset($additionalData['boletobancario.dueDate'])) {
$payment->setAdditionalInformation( $payment->setAdditionalInformation(
...@@ -109,7 +108,7 @@ class GeneralResponseValidator extends AbstractValidator ...@@ -109,7 +108,7 @@ class GeneralResponseValidator extends AbstractValidator
} else { } else {
$isValid = false; $isValid = false;
$errorMsg = __('3D secure is not valid.'); $errorMsg = __('3D secure is not valid.');
$this->adyenLogger->error($errorMsg);; $this->adyenLogger->error($errorMsg);
$errorMessages[] = $errorMsg; $errorMessages[] = $errorMsg;
} }
break; break;
...@@ -130,4 +129,4 @@ class GeneralResponseValidator extends AbstractValidator ...@@ -130,4 +129,4 @@ class GeneralResponseValidator extends AbstractValidator
return $this->createResult($isValid, $errorMessages); return $this->createResult($isValid, $errorMessages);
} }
} }
\ No newline at end of file
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
namespace Adyen\Payment\Gateway\Validator; namespace Adyen\Payment\Gateway\Validator;
use Magento\Payment\Gateway\Validator\AbstractValidator; use Magento\Payment\Gateway\Validator\AbstractValidator;
class InstallmentValidator extends AbstractValidator class InstallmentValidator extends AbstractValidator
......
...@@ -24,10 +24,8 @@ ...@@ -24,10 +24,8 @@
namespace Adyen\Payment\Gateway\Validator; namespace Adyen\Payment\Gateway\Validator;
use Magento\Payment\Gateway\Validator\AbstractValidator; use Magento\Payment\Gateway\Validator\AbstractValidator;
class PosCloudResponseValidator extends AbstractValidator class PosCloudResponseValidator extends AbstractValidator
{ {
/** /**
...@@ -40,13 +38,13 @@ class PosCloudResponseValidator extends AbstractValidator ...@@ -40,13 +38,13 @@ class PosCloudResponseValidator extends AbstractValidator
*/ */
private $adyenHelper; private $adyenHelper;
/** /**
* PosCloudResponseValidator constructor. * PosCloudResponseValidator constructor.
* *
* @param \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory * @param \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger * @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Helper\Data $adyenHelper * @param \Adyen\Payment\Helper\Data $adyenHelper
*/ */
public function __construct( public function __construct(
\Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory, \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger, \Adyen\Payment\Logger\AdyenLogger $adyenLogger,
......
...@@ -68,4 +68,4 @@ class RefundResponseValidator extends AbstractValidator ...@@ -68,4 +68,4 @@ class RefundResponseValidator extends AbstractValidator
return $this->createResult($isValid, $errorMessages); return $this->createResult($isValid, $errorMessages);
} }
} }
\ No newline at end of file
...@@ -74,12 +74,11 @@ class SepaValidator extends AbstractValidator ...@@ -74,12 +74,11 @@ class SepaValidator extends AbstractValidator
if (isset($countries[substr($iban, 0, 2)]) && if (isset($countries[substr($iban, 0, 2)]) &&
strlen($iban) == $countries[substr($iban, 0, 2)]) { strlen($iban) == $countries[substr($iban, 0, 2)]) {
$movedChar = substr($iban, 4).substr($iban, 0, 4); $movedChar = substr($iban, 4).substr($iban, 0, 4);
$movedCharArray = str_split($movedChar); $movedCharArray = str_split($movedChar);
$newString = ""; $newString = "";
foreach ($movedCharArray AS $key => $value) { foreach ($movedCharArray as $key => $value) {
if (!is_numeric($movedCharArray[$key])) { if (!is_numeric($movedCharArray[$key])) {
$movedCharArray[$key] = $chars[$movedCharArray[$key]]; $movedCharArray[$key] = $chars[$movedCharArray[$key]];
} }
...@@ -110,4 +109,4 @@ class SepaValidator extends AbstractValidator ...@@ -110,4 +109,4 @@ class SepaValidator extends AbstractValidator
return false; return false;
} }
} }
} }
\ No newline at end of file
This diff is collapsed.
...@@ -426,14 +426,14 @@ class PaymentMethods extends AbstractHelper ...@@ -426,14 +426,14 @@ class PaymentMethods extends AbstractHelper
/** /**
* @var array * @var array
*/ */
protected $_cacheParams = array( protected $_cacheParams = [
'currencyCode', 'currencyCode',
'merchantReference', 'merchantReference',
'skinCode', 'skinCode',
'merchantAccount', 'merchantAccount',
'countryCode', 'countryCode',
'shopperLocale', 'shopperLocale',
); ];
/** /**
* @param $requestParams * @param $requestParams
...@@ -460,4 +460,4 @@ class PaymentMethods extends AbstractHelper ...@@ -460,4 +460,4 @@ class PaymentMethods extends AbstractHelper
{ {
return $this->_session->getQuote(); return $this->_session->getQuote();
} }
} }
\ No newline at end of file
...@@ -66,22 +66,22 @@ class AdyenLogger extends Logger ...@@ -66,22 +66,22 @@ class AdyenLogger extends Logger
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return Boolean Whether the record has been processed
*/ */
public function addAdyenNotification($message, array $context = array()) public function addAdyenNotification($message, array $context = [])
{ {
return $this->addRecord(static::ADYEN_NOTIFICATION, $message, $context); return $this->addRecord(static::ADYEN_NOTIFICATION, $message, $context);
} }
public function addAdyenDebug($message, array $context = array()) public function addAdyenDebug($message, array $context = [])
{ {
return $this->addRecord(static::ADYEN_DEBUG, $message, $context); return $this->addRecord(static::ADYEN_DEBUG, $message, $context);
} }
public function addAdyenResult($message, array $context = array()) public function addAdyenResult($message, array $context = [])
{ {
return $this->addRecord(static::ADYEN_RESULT, $message, $context); return $this->addRecord(static::ADYEN_RESULT, $message, $context);
} }
public function addAdyenNotificationCronjob($message, array $context = array()) public function addAdyenNotificationCronjob($message, array $context = [])
{ {
return $this->addRecord(static::ADYEN_NOTIFICATION_CRONJOB, $message, $context); return $this->addRecord(static::ADYEN_NOTIFICATION_CRONJOB, $message, $context);
} }
...@@ -109,8 +109,8 @@ class AdyenLogger extends Logger ...@@ -109,8 +109,8 @@ class AdyenLogger extends Logger
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return Boolean Whether the record has been processed
*/ */
public function addNotificationLog($message, array $context = array()) public function addNotificationLog($message, array $context = [])
{ {
return $this->addRecord(static::INFO, $message, $context); return $this->addRecord(static::INFO, $message, $context);
} }
} }
\ No newline at end of file
...@@ -36,4 +36,4 @@ class AdyenBase extends Base ...@@ -36,4 +36,4 @@ class AdyenBase extends Base
{ {
return $record['level'] == $this->level; return $record['level'] == $this->level;
} }
} }
\ No newline at end of file
...@@ -39,5 +39,4 @@ class AdyenCronjob extends AdyenBase ...@@ -39,5 +39,4 @@ class AdyenCronjob extends AdyenBase
protected $loggerType = AdyenLogger::ADYEN_NOTIFICATION_CRONJOB; protected $loggerType = AdyenLogger::ADYEN_NOTIFICATION_CRONJOB;
protected $level = AdyenLogger::ADYEN_NOTIFICATION_CRONJOB; protected $level = AdyenLogger::ADYEN_NOTIFICATION_CRONJOB;
} }
...@@ -39,5 +39,4 @@ class AdyenDebug extends AdyenBase ...@@ -39,5 +39,4 @@ class AdyenDebug extends AdyenBase
protected $loggerType = AdyenLogger::ADYEN_DEBUG; protected $loggerType = AdyenLogger::ADYEN_DEBUG;
protected $level = AdyenLogger::ADYEN_DEBUG; protected $level = AdyenLogger::ADYEN_DEBUG;
} }
...@@ -42,5 +42,4 @@ class AdyenError extends AdyenBase ...@@ -42,5 +42,4 @@ class AdyenError extends AdyenBase
* @var * @var
*/ */
protected $level = AdyenLogger::ERROR; protected $level = AdyenLogger::ERROR;
} }
...@@ -39,5 +39,4 @@ class AdyenInfo extends AdyenBase ...@@ -39,5 +39,4 @@ class AdyenInfo extends AdyenBase
protected $loggerType = AdyenLogger::INFO; protected $loggerType = AdyenLogger::INFO;
protected $level = AdyenLogger::INFO; protected $level = AdyenLogger::INFO;
} }
...@@ -39,5 +39,4 @@ class AdyenNotification extends AdyenBase ...@@ -39,5 +39,4 @@ class AdyenNotification extends AdyenBase
protected $loggerType = AdyenLogger::ADYEN_NOTIFICATION; protected $loggerType = AdyenLogger::ADYEN_NOTIFICATION;
protected $level = AdyenLogger::ADYEN_NOTIFICATION; protected $level = AdyenLogger::ADYEN_NOTIFICATION;
} }
...@@ -39,5 +39,4 @@ class AdyenResult extends AdyenBase ...@@ -39,5 +39,4 @@ class AdyenResult extends AdyenBase
protected $loggerType = AdyenLogger::ADYEN_RESULT; protected $loggerType = AdyenLogger::ADYEN_RESULT;
protected $level = AdyenLogger::ADYEN_RESULT; protected $level = AdyenLogger::ADYEN_RESULT;
}
}
\ No newline at end of file
...@@ -30,20 +30,20 @@ use Adyen\Util\Util; ...@@ -30,20 +30,20 @@ use Adyen\Util\Util;
class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
{ {
/** /**
* @var \Adyen\Payment\Helper\Data * @var \Adyen\Payment\Helper\Data
*/ */
private $adyenHelper; private $adyenHelper;
/** /**
* @var \Adyen\Payment\Logger\AdyenLogger * @var \Adyen\Payment\Logger\AdyenLogger
*/ */
private $adyenLogger; private $adyenLogger;
/** /**
* @var \Adyen\Client * @var \Adyen\Client
*/ */
protected $client; protected $client;
/** /**
* @var int * @var int
...@@ -68,15 +68,14 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface ...@@ -68,15 +68,14 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
\Magento\Checkout\Model\Session $checkoutSession, \Magento\Checkout\Model\Session $checkoutSession,
\Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = [] array $data = []
) ) {
{
$this->adyenHelper = $adyenHelper; $this->adyenHelper = $adyenHelper;
$this->adyenLogger = $adyenLogger; $this->adyenLogger = $adyenLogger;
$this->checkoutSession = $checkoutSession; $this->checkoutSession = $checkoutSession;
$this->storeId = $storeManager->getStore()->getId(); $this->storeId = $storeManager->getStore()->getId();
// initialize client // initialize client
$apiKey = $this->adyenHelper->getPosApiKey($this->storeId); $apiKey = $this->adyenHelper->getPosApiKey($this->storeId);
$client = $this->adyenHelper->initializeAdyenClient($this->storeId, $apiKey); $client = $this->adyenHelper->initializeAdyenClient($this->storeId, $apiKey);
//Set configurable option in M2 //Set configurable option in M2
...@@ -163,10 +162,14 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface ...@@ -163,10 +162,14 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
} }
} }
$quote->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalInformation('serviceID', $quote->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalInformation(
$serviceID); 'serviceID',
$quote->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalInformation('initiateDate', $serviceID
$initiateDate); );
$quote->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalInformation(
'initiateDate',
$initiateDate
);
try { try {
$response = $service->runTenderSync($request); $response = $service->runTenderSync($request);
...@@ -176,14 +179,18 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface ...@@ -176,14 +179,18 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
$response['error'] = $e->getMessage(); $response['error'] = $e->getMessage();
} catch (\Exception $e) { } catch (\Exception $e) {
//Probably timeout //Probably timeout
$quote->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalInformation('terminalResponse', $quote->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalInformation(
null); 'terminalResponse',
null
);
$quote->save(); $quote->save();
$response['error'] = $e->getMessage(); $response['error'] = $e->getMessage();
throw $e; throw $e;
} }
$quote->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalInformation('terminalResponse', $quote->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalInformation(
$response); 'terminalResponse',
$response
);
$quote->save(); $quote->save();
return $response; return $response;
......
...@@ -54,5 +54,4 @@ class AdyenPaymentMethodManagement implements \Adyen\Payment\Api\AdyenPaymentMet ...@@ -54,5 +54,4 @@ class AdyenPaymentMethodManagement implements \Adyen\Payment\Api\AdyenPaymentMet
return $this->_paymentMethodsHelper->getPaymentMethods($cartId, $country); return $this->_paymentMethodsHelper->getPaymentMethods($cartId, $country);
} }
}
}
\ No newline at end of file
...@@ -81,7 +81,7 @@ class AdyenRequestMerchantSession implements AdyenRequestMerchantSessionInterfac ...@@ -81,7 +81,7 @@ class AdyenRequestMerchantSession implements AdyenRequestMerchantSessionInterfac
"displayName":"' . $displayName . '" "displayName":"' . $displayName . '"
}'; }';
$this->_adyenLogger->addAdyenDebug("JSON Requesst is: " . print_r($data,true)); $this->_adyenLogger->addAdyenDebug("JSON Requesst is: " . print_r($data, true));
curl_setopt($ch, CURLOPT_URL, $validationUrl); curl_setopt($ch, CURLOPT_URL, $validationUrl);
...@@ -92,11 +92,10 @@ class AdyenRequestMerchantSession implements AdyenRequestMerchantSessionInterfac ...@@ -92,11 +92,10 @@ class AdyenRequestMerchantSession implements AdyenRequestMerchantSessionInterfac
curl_setopt($ch, CURLOPT_SSLCERT, $fullPathLocationPEMFile); curl_setopt($ch, CURLOPT_SSLCERT, $fullPathLocationPEMFile);
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json', 'Content-Type: application/json',
'Content-Length: ' . strlen($data) 'Content-Length: ' . strlen($data)
) ]);
);
$result = curl_exec($ch); $result = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
...@@ -107,7 +106,7 @@ class AdyenRequestMerchantSession implements AdyenRequestMerchantSessionInterfac ...@@ -107,7 +106,7 @@ class AdyenRequestMerchantSession implements AdyenRequestMerchantSessionInterfac
// result not 200 throw error // result not 200 throw error
if ($httpStatus != 200 && $result) { if ($httpStatus != 200 && $result) {
$this->_adyenLogger->addAdyenDebug("Error Apple, API HTTP Status is: " . $httpStatus . " result is:" . $result); $this->_adyenLogger->addAdyenDebug("Error Apple, API HTTP Status is: " . $httpStatus . " result is:" . $result);
} elseif(!$result) { } elseif (!$result) {
$errno = curl_errno($ch); $errno = curl_errno($ch);
$message = curl_error($ch); $message = curl_error($ch);
$msg = "(Network error [errno $errno]: $message)"; $msg = "(Network error [errno $errno]: $message)";
...@@ -117,4 +116,4 @@ class AdyenRequestMerchantSession implements AdyenRequestMerchantSessionInterfac ...@@ -117,4 +116,4 @@ class AdyenRequestMerchantSession implements AdyenRequestMerchantSessionInterfac
curl_close($ch); curl_close($ch);
return $result; return $result;
} }
} }
\ No newline at end of file
...@@ -78,13 +78,14 @@ class PaymentRequest extends DataObject ...@@ -78,13 +78,14 @@ class PaymentRequest extends DataObject
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
} }
/** /**
* @param $storeId * @param $storeId
* @return mixed * @return mixed
* @throws \Adyen\AdyenException * @throws \Adyen\AdyenException
*/ */
private function createClient($storeId) { private function createClient($storeId)
$client = $this->_adyenHelper->initializeAdyenClient($storeId); {
$client = $this->_adyenHelper->initializeAdyenClient($storeId);
return $client; return $client;
} }
...@@ -116,7 +117,7 @@ class PaymentRequest extends DataObject ...@@ -116,7 +117,7 @@ class PaymentRequest extends DataObject
$client = $this->createClient($storeId); $client = $this->createClient($storeId);
$service = new \Adyen\Service\Payment($client); $service = new \Adyen\Service\Payment($client);
$result = $service->authorise3D($request); $result = $service->authorise3D($request);
} 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'));
} }
...@@ -135,7 +136,6 @@ class PaymentRequest extends DataObject ...@@ -135,7 +136,6 @@ class PaymentRequest extends DataObject
$recurringTypes = $this->_recurringType->getAllowedRecurringTypesForListRecurringCall(); $recurringTypes = $this->_recurringType->getAllowedRecurringTypesForListRecurringCall();
foreach ($recurringTypes as $recurringType) { foreach ($recurringTypes as $recurringType) {
try { try {
// merge ONECLICK and RECURRING into one record with recurringType ONECLICK,RECURRING // merge ONECLICK and RECURRING into one record with recurringType ONECLICK,RECURRING
$listRecurringContractByType = $listRecurringContractByType =
...@@ -221,7 +221,7 @@ class PaymentRequest extends DataObject ...@@ -221,7 +221,7 @@ class PaymentRequest extends DataObject
try { try {
$result = $service->disable($request); $result = $service->disable($request);
} catch(\Exception $e) { } catch (\Exception $e) {
$this->_adyenLogger->info($e->getMessage()); $this->_adyenLogger->info($e->getMessage());
} }
...@@ -231,4 +231,4 @@ class PaymentRequest extends DataObject ...@@ -231,4 +231,4 @@ class PaymentRequest extends DataObject
throw new \Magento\Framework\Exception\LocalizedException(__('Failed to disable this contract')); throw new \Magento\Framework\Exception\LocalizedException(__('Failed to disable this contract'));
} }
} }
} }
\ No newline at end of file
...@@ -33,7 +33,7 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -33,7 +33,7 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
/** /**
* Agreement constructor. * Agreement constructor.
* *
* @param \Adyen\Payment\Helper\Data $adyenHelper * @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry * @param \Magento\Framework\Registry $registry
...@@ -55,14 +55,16 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -55,14 +55,16 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = [] array $data = []
) { ) {
parent::__construct($context, parent::__construct(
$registry, $context,
$paymentData, $registry,
$billingAgreementFactory, $paymentData,
$dateFactory, $billingAgreementFactory,
$resource, $dateFactory,
$resourceCollection, $resource,
$data); $resourceCollection,
$data
);
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
} }
...@@ -93,7 +95,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -93,7 +95,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
//Billing agreement SEPA //Billing agreement SEPA
if (isset($data['bank']['iban'])) { if (isset($data['bank']['iban'])) {
$this->setAgreementLabel(__('%1, %2', $this->setAgreementLabel(__(
'%1, %2',
$data['bank']['iban'], $data['bank']['iban'],
$data['bank']['ownerName'] $data['bank']['ownerName']
)); ));
...@@ -108,7 +111,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -108,7 +111,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
$ccType = $ccTypes[$ccType]['name']; $ccType = $ccTypes[$ccType]['name'];
} }
$label = __('%1, %2, **** %3', $label = __(
'%1, %2, **** %3',
$ccType, $ccType,
$data['card']['holderName'], $data['card']['holderName'],
$data['card']['number'], $data['card']['number'],
...@@ -119,7 +123,6 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -119,7 +123,6 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
} }
if ($data['variant'] == 'paypal') { if ($data['variant'] == 'paypal') {
$email = ""; $email = "";
if (isset($data['tokenDetails']['tokenData']['EmailId'])) { if (isset($data['tokenDetails']['tokenData']['EmailId'])) {
...@@ -128,7 +131,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -128,7 +131,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
$email = $data['lastKnownShopperEmail']; $email = $data['lastKnownShopperEmail'];
} }
$label = __('PayPal %1', $label = __(
'PayPal %1',
$email $email
); );
$this->setAgreementLabel($label); $this->setAgreementLabel($label);
......
...@@ -127,7 +127,6 @@ class Installments extends \Magento\Framework\App\Config\Value ...@@ -127,7 +127,6 @@ class Installments extends \Magento\Framework\App\Config\Value
// first combine the ccTypes together // first combine the ccTypes together
$list = []; $list = [];
foreach ($value as $ccType => $items) { foreach ($value as $ccType => $items) {
// sort on amount // sort on amount
ksort($items); ksort($items);
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
namespace Adyen\Payment\Model\Config\Source; namespace Adyen\Payment\Model\Config\Source;
class ApplePayShippingType implements \Magento\Framework\Option\ArrayInterface class ApplePayShippingType implements \Magento\Framework\Option\ArrayInterface
{ {
/** /**
...@@ -46,7 +45,8 @@ class ApplePayShippingType implements \Magento\Framework\Option\ArrayInterface ...@@ -46,7 +45,8 @@ class ApplePayShippingType implements \Magento\Framework\Option\ArrayInterface
/** /**
* @return array * @return array
*/ */
public function toOptionArray() { public function toOptionArray()
{
return $this->_adyenHelper->getApplePayShippingTypes(); return $this->_adyenHelper->getApplePayShippingTypes();
} }
} }
\ No newline at end of file
...@@ -34,7 +34,7 @@ class CaptureMode implements \Magento\Framework\Option\ArrayInterface ...@@ -34,7 +34,7 @@ class CaptureMode implements \Magento\Framework\Option\ArrayInterface
/** /**
* CaptureMode constructor. * CaptureMode constructor.
* *
* @param \Adyen\Payment\Helper\Data $adyenHelper * @param \Adyen\Payment\Helper\Data $adyenHelper
*/ */
public function __construct( public function __construct(
......
...@@ -33,7 +33,7 @@ class DemoMode implements \Magento\Framework\Option\ArrayInterface ...@@ -33,7 +33,7 @@ class DemoMode implements \Magento\Framework\Option\ArrayInterface
/** /**
* DemoMode constructor. * DemoMode constructor.
* *
* @param \Adyen\Payment\Helper\Data $adyenHelper * @param \Adyen\Payment\Helper\Data $adyenHelper
*/ */
public function __construct( public function __construct(
......
...@@ -39,8 +39,7 @@ class RecurringType implements \Magento\Framework\Option\ArrayInterface ...@@ -39,8 +39,7 @@ class RecurringType implements \Magento\Framework\Option\ArrayInterface
*/ */
public function __construct( public function __construct(
\Adyen\Payment\Helper\Data $adyenHelper \Adyen\Payment\Helper\Data $adyenHelper
) ) {
{
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
} }
......
...@@ -38,5 +38,4 @@ class SepaFlow implements \Magento\Framework\Option\ArrayInterface ...@@ -38,5 +38,4 @@ class SepaFlow implements \Magento\Framework\Option\ArrayInterface
['value' => self::SEPA_FLOW_AUTHCAP, 'label' => __('Auth/Cap')], ['value' => self::SEPA_FLOW_AUTHCAP, 'label' => __('Auth/Cap')],
]; ];
} }
}
}
\ No newline at end of file
...@@ -48,5 +48,4 @@ class SplitPaymentRefundStrategy implements \Magento\Framework\Option\ArrayInter ...@@ -48,5 +48,4 @@ class SplitPaymentRefundStrategy implements \Magento\Framework\Option\ArrayInter
self::REFUND_ON_RATIO => __('refund based on ratio') self::REFUND_ON_RATIO => __('refund based on ratio')
]; ];
} }
} }
This diff is collapsed.
...@@ -72,4 +72,4 @@ class Gender ...@@ -72,4 +72,4 @@ class Gender
} }
return $gender; return $gender;
} }
} }
\ No newline at end of file
...@@ -65,4 +65,4 @@ class GuestAdyenPaymentMethodManagement implements \Adyen\Payment\Api\GuestAdyen ...@@ -65,4 +65,4 @@ class GuestAdyenPaymentMethodManagement implements \Adyen\Payment\Api\GuestAdyen
return $this->_paymentMethodsHelper->getPaymentMethods($quoteId, $country); return $this->_paymentMethodsHelper->getPaymentMethods($quoteId, $country);
} }
} }
\ No newline at end of file
...@@ -26,8 +26,7 @@ namespace Adyen\Payment\Model; ...@@ -26,8 +26,7 @@ namespace Adyen\Payment\Model;
use Adyen\Payment\Api\Data\InvoiceInterface; use Adyen\Payment\Api\Data\InvoiceInterface;
class Invoice extends \Magento\Framework\Model\AbstractModel class Invoice extends \Magento\Framework\Model\AbstractModel implements InvoiceInterface
implements InvoiceInterface
{ {
/** /**
* Notification constructor. * Notification constructor.
...@@ -139,5 +138,4 @@ class Invoice extends \Magento\Framework\Model\AbstractModel ...@@ -139,5 +138,4 @@ class Invoice extends \Magento\Framework\Model\AbstractModel
{ {
return $this->setData(self::INVOICE_ID, $invoiceId); return $this->setData(self::INVOICE_ID, $invoiceId);
} }
}
}
\ No newline at end of file
...@@ -96,11 +96,10 @@ class Adapter extends Method\Adapter ...@@ -96,11 +96,10 @@ class Adapter extends Method\Adapter
$agreement->getCustomerReference(), $agreement->getCustomerReference(),
$agreement->getStoreId() $agreement->getStoreId()
); );
} catch(\Exception $e) { } catch (\Exception $e) {
throw new \Magento\Framework\Exception\LocalizedException(__('Failed to disable this contract')); throw new \Magento\Framework\Exception\LocalizedException(__('Failed to disable this contract'));
} }
} }
return $this; return $this;
} }
} }
...@@ -25,8 +25,7 @@ namespace Adyen\Payment\Model; ...@@ -25,8 +25,7 @@ namespace Adyen\Payment\Model;
use Adyen\Payment\Api\Data\NotificationInterface; use Adyen\Payment\Api\Data\NotificationInterface;
class Notification extends \Magento\Framework\Model\AbstractModel class Notification extends \Magento\Framework\Model\AbstractModel implements NotificationInterface
implements NotificationInterface
{ {
const AUTHORISATION = 'AUTHORISATION'; const AUTHORISATION = 'AUTHORISATION';
...@@ -400,4 +399,4 @@ class Notification extends \Magento\Framework\Model\AbstractModel ...@@ -400,4 +399,4 @@ class Notification extends \Magento\Framework\Model\AbstractModel
{ {
return $this->setData(self::UPDATED_AT, $timestamp); return $this->setData(self::UPDATED_AT, $timestamp);
} }
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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