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 2dce8d69 authored by Alessio Zampatti's avatar Alessio Zampatti Committed by GitHub

Merge pull request #319 from Adyen/creditmemo-fix

PW-642: Creating credit memos after notification from BO
parents d00f0689 81a07478
...@@ -1076,19 +1076,15 @@ class Cron ...@@ -1076,19 +1076,15 @@ class Cron
$lastTransactionId = $this->_order->getPayment()->getLastTransId(); $lastTransactionId = $this->_order->getPayment()->getLastTransId();
if ($lastTransactionId != $this->_pspReference) { if ($lastTransactionId != $this->_pspReference) {
// refund is done through adyen backoffice so create an invoice // refund is done through adyen backoffice so create a credit memo
$order = $this->_order; $order = $this->_order;
if ($order->canCreditmemo()) { if ($order->canCreditmemo()) {
// there is a bug in this function of Magento see #2656 magento\magento2 repo
// Invalid method Magento\Sales\Model\Order\Creditmemo::register
/*
$currency = $this->_order->getOrderCurrencyCode(); $currency = $this->_order->getOrderCurrencyCode();
$amount = $this->_adyenHelper->originalAmount($this->_value, $currency); $amount = $this->_adyenHelper->originalAmount($this->_value, $currency);
$order->getPayment()->registerRefundNotification($amount); $order->getPayment()->registerRefundNotification($amount);
*/
$this->_adyenLogger->addAdyenNotificationCronjob('Please create your credit memo inside magento'); $this->_adyenLogger->addAdyenNotificationCronjob('Created credit memo for order');
} else { } else {
$this->_adyenLogger->addAdyenNotificationCronjob('Could not create a credit memo for order'); $this->_adyenLogger->addAdyenNotificationCronjob('Could not create a credit memo for order');
} }
......
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