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 55792411 authored by rikterbeek's avatar rikterbeek

code optimalizations

parent 73d9097d
...@@ -189,6 +189,7 @@ class Json extends \Magento\Framework\App\Action\Action ...@@ -189,6 +189,7 @@ class Json extends \Magento\Framework\App\Action\Action
} else { } else {
return "401"; return "401";
} }
return true;
} }
......
...@@ -147,7 +147,7 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -147,7 +147,7 @@ class Result extends \Magento\Framework\App\Action\Action
'adyen_response' => $response 'adyen_response' => $response
]); ]);
if (isset($response['handled'])) { if (isset($response['handled'])) {
return; return $response['handled_response'];
} }
// set StoreId for retrieving debug log setting // set StoreId for retrieving debug log setting
......
...@@ -277,6 +277,8 @@ class AdyenHppConfigProvider implements ConfigProviderInterface ...@@ -277,6 +277,8 @@ class AdyenHppConfigProvider implements ConfigProviderInterface
if($defaultCountry) { if($defaultCountry) {
return $defaultCountry; return $defaultCountry;
} }
return "";
} }
/** /**
......
...@@ -544,7 +544,7 @@ class Cron ...@@ -544,7 +544,7 @@ class Cron
case Notification::PENDING: case Notification::PENDING:
if($this->_getConfigData('send_email_bank_sepa_on_pending', 'adyen_abstract', $this->_order->getStoreId())) { if($this->_getConfigData('send_email_bank_sepa_on_pending', 'adyen_abstract', $this->_order->getStoreId())) {
// Check if payment is banktransfer or sepa if true then send out order confirmation email // Check if payment is banktransfer or sepa if true then send out order confirmation email
$isBankTransfer = $this->_isBankTransfer($this->_paymentMethod); $isBankTransfer = $this->_isBankTransfer();
if($isBankTransfer || $this->_paymentMethod == 'sepadirectdebit') { if($isBankTransfer || $this->_paymentMethod == 'sepadirectdebit') {
// $this->_order->sendNewOrderEmail(); // send order email // $this->_order->sendNewOrderEmail(); // send order email
$this->_orderSender->send($this->_order); $this->_orderSender->send($this->_order);
...@@ -581,7 +581,7 @@ class Cron ...@@ -581,7 +581,7 @@ class Cron
// $this->_uncancelOrder($this->_order); // $this->_uncancelOrder($this->_order);
// FOR POS authorize the payment on the CAPTURE notification // FOR POS authorize the payment on the CAPTURE notification
$this->_authorizePayment($this->_order, $this->_paymentMethod); $this->_authorizePayment();
} }
break; break;
case Notification::CAPTURE_FAILED: case Notification::CAPTURE_FAILED:
...@@ -603,7 +603,7 @@ class Cron ...@@ -603,7 +603,7 @@ class Cron
$this->_debugData['_processNotification info'] = 'Order is already cancelled or holded so do nothing'; $this->_debugData['_processNotification info'] = 'Order is already cancelled or holded so do nothing';
} else if ($this->_order->canCancel() || $this->_order->canHold()) { } else if ($this->_order->canCancel() || $this->_order->canHold()) {
$this->_debugData['_processNotification info'] = 'try to cancel the order'; $this->_debugData['_processNotification info'] = 'try to cancel the order';
$this->_holdCancelOrder($this->_order, true); $this->_holdCancelOrder(true);
} else { } else {
$this->_debugData['_processNotification info'] = 'try to refund the order'; $this->_debugData['_processNotification info'] = 'try to refund the order';
// refund // refund
...@@ -1107,7 +1107,7 @@ class Cron ...@@ -1107,7 +1107,7 @@ class Cron
// create invoice for the capture notification if you are on manual capture // create invoice for the capture notification if you are on manual capture
if($createInvoice == true && $amount == $orderAmount) { if($createInvoice == true && $amount == $orderAmount) {
$this->_debugData['_setPaymentAuthorized amount'] = 'amount notification:'.$amount . ' amount order:'.$orderAmount; $this->_debugData['_setPaymentAuthorized amount'] = 'amount notification:'.$amount . ' amount order:'.$orderAmount;
$this->_createInvoice($this->_order); $this->_createInvoice();
} }
// if you have capture on shipment enabled don't set update the status of the payment // if you have capture on shipment enabled don't set update the status of the payment
...@@ -1126,7 +1126,7 @@ class Cron ...@@ -1126,7 +1126,7 @@ class Cron
} }
// check for boleto if payment is totally paid // check for boleto if payment is totally paid
if($this->_paymentMethodCode($this->_order) == "adyen_boleto") { if($this->_paymentMethodCode() == "adyen_boleto") {
// check if paid amount is the same as orginal amount // check if paid amount is the same as orginal amount
$orginalAmount = $this->_boletoOriginalAmount; $orginalAmount = $this->_boletoOriginalAmount;
......
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