hipay / hipay-fullservice-sdk-magento2

Official repository of the HiPay Fullservice extension for Magento v2.
https://developer.hipay.com/doc/hipay-fullservice-sdk-magento2/
Apache License 2.0
10 stars 16 forks source link

Store credit not refunded to customer when order is cancelled by cron (Magento Commerce) #141

Closed AymericJoubert closed 2 years ago

AymericJoubert commented 2 years ago

Preconditions :

Bug : The cron "CleanPendingOrders" with cancel the order, but will not refund store credit to customer.

Context : There is an event on order cancellation in magento commerce to refund store credit, but there is this condition a the beginning :

if (!$order->getCustomerId() || !$order->getBaseCustomerBalanceAmount()) {
    return $this;
}

Store credit is not refunded because customer_id is not loaded within the order collection.

Fix : Simply add 'customer_id' to the order collection selected fields in CleanPendingOrders and the process works well.

pi-ecommerce commented 2 years ago

Fixed in 1.14.3

Thanks