This is on fly-notes for RWC-109 or github issue #53. This very much lightly explains parts of the flow for refunding in the aftershop features.
* Moved getProperArticleNumber out from ResursDefault into the WooCommerce-model to make article numbers global fetchable.
* Fixed bug: Making sure $orderDataArray is an array before looking up metadata in what is expected to be an array (if this is something else, we've done something wrong).
* Added mocking feature: Refund exceptions.
* Finalized the primary refunding.
* Finalized the primary aftershop features.
* Prepared for removeOrderItemFromResurs, eventually (which is a non refunding feature, but instead for annulments in paused orders).
* Added isFullAfterShopRequest, which is a controller for if we can make full debit/annul/crediting.
* Added control method hasCustomAfterShopOrderLines to make sure we considering custom orderlines that is normally not included in the regular items list.
* Centralized getPositiveValueFromNegative instead of adding preg_replaces all over the codebase, when we have negative amounts or values somewhere.
* Added method for where we add shipping as orderlines (addShippingOrderLine)
* Added method to discover discounts and add them as orderlines.
* Added method to discover shipping and/or if it is refunded.
* Centralized refunding in refundResursOrder. If discounts are found during this process, keying for using getPayment-based refunds are changed and validation gets disabled.
* Moved the API request for refunding into refundPaymentRequest.
* Added addRefundRow, which makes the dirty work with addOrderLine, preparing for refunding.
* Renamed WordPress in utils to wpHelper since we need to utilized mocking in the default WordPress-class.