Upgrade the Refund module
Edit on GitHubUpgrading from version 4.* to version 5.*
Version 4 of the Refund module no longer uses SalesAggregatorFacade
, it was replaced with SalesFacade
.
The RefundCalculator
business class must now replace RefundToSalesAggregatorInterface
with the RefundToSalesInterface
bridge.
To learn more see Upgrade the Calculation module.
Upgrading from version 2.* to version 3.*
To migrate the Refund module from version 2 to version 3, follow these steps:
Version 3 of the Refund module was completely rebuilt; the SalesAggregator
is used to get a calculated OrderTransfer
and plugins are used to change the refundable amount calculation behaviour.
The RefundFacade
has completely changed and exposes only two methods.
Check your code and where you make use of the RefundFacade
change your implementation to use the new methods from the RefundFacade
.
These methods are:
RefundFacade::calculateRefund(array $salesOrderItems
, SpySalesOrder $salesOrderEntity)`RefundFacade::saveRefund(RefundTransfer $refundTransfer)
You need to:
- Rename method
RefundFacade::calculateRefundableAmount()
toRefundFacade::calculateRefund()
and pass needed arguments to it.calculateRefund()
will return aRefundTransfer
which holds the refundable amount. - When refund process of payment provider is done and accepted, pass the
RefundTransfer
toRefundFacade::saveRefund()
. - Refund view in sales order detail page can be activated by adding
'refund' => '/refund/sales/list'
toSalesConfig::getSalesDetailExternalBlocksUrls()
.
Thank you!
For submitting the form