We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit 5b395168 authored by alexandros's avatar alexandros

Cancel order if it is alipay and result code RECEIVED

parent d0930801
...@@ -245,6 +245,9 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -245,6 +245,9 @@ class Result extends \Magento\Framework\App\Action\Action
break; break;
case Notification::RECEIVED: case Notification::RECEIVED:
$result = true; $result = true;
if (strpos($paymentMethod, "alipay_hk_web") !== false) {
$result = false;
}
$this->_adyenLogger->addAdyenResult('Do nothing wait for the notification'); $this->_adyenLogger->addAdyenResult('Do nothing wait for the notification');
break; break;
case Notification::PENDING: case Notification::PENDING:
......
...@@ -867,7 +867,13 @@ class Cron ...@@ -867,7 +867,13 @@ class Cron
break; break;
case Notification::HANDLED_EXTERNALLY: case Notification::HANDLED_EXTERNALLY:
case Notification::AUTHORISATION: case Notification::AUTHORISATION:
if ($this->_paymentMethod == 'alipay_hk_web'
&& $this->_order->getStatus() == $this->_adyenHelper->getAdyenAbstractConfigData('payment_cancelled')) {
$this->_authorizePayment(); $this->_authorizePayment();
$this->_refundOrder();
} else {
$this->_authorizePayment();
}
break; break;
case Notification::MANUAL_REVIEW_REJECT: case Notification::MANUAL_REVIEW_REJECT:
// don't do anything it will send a CANCEL_OR_REFUND notification when this payment is captured // don't do anything it will send a CANCEL_OR_REFUND notification when this payment is captured
......
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