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 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
break;
case Notification::RECEIVED:
$result = true;
if (strpos($paymentMethod, "alipay_hk_web") !== false) {
$result = false;
}
$this->_adyenLogger->addAdyenResult('Do nothing wait for the notification');
break;
case Notification::PENDING:
......
......@@ -867,7 +867,13 @@ class Cron
break;
case Notification::HANDLED_EXTERNALLY:
case Notification::AUTHORISATION:
if ($this->_paymentMethod == 'alipay_hk_web'
&& $this->_order->getStatus() == $this->_adyenHelper->getAdyenAbstractConfigData('payment_cancelled')) {
$this->_authorizePayment();
$this->_refundOrder();
} else {
$this->_authorizePayment();
}
break;
case Notification::MANUAL_REVIEW_REJECT:
// 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