Recently, we have received some requests to support Cash on Delivery orders. Some merchants need to receive payments when the fulfillment system delivers products to the customer. This is not feasible when orders are marked as "Paid".
By default, when Mergify creates a merged order, it marks it as "Paid". Merged orders are only considered for shipping purposes, and all financial transactions take place on the original orders. In other words, if you want to refund a merged order, you should refer to the original orders and use them. Normally, this flow works, unless the merged orders are COD. Merchants can't receive payments on the original orders, because they won't get fulfilled, and the merged order is marked as "Paid" too. To specify which orders comprised the combined order, Mergify can automatically add tags and notes to the merged orders, but the process should be more clearly defined. Now that the last update has been applied, Mergify detects COD orders among selected orders. If all orders are COD ones, Mergify creates the merged orders as "Pending". If some of the orders are COD, the total outstanding amounts of them are transferred to the merged order, and it's marked as "Partially paid". The fulfillment services are then able to receive payment when they deliver the goods to customers. In addition, Mergify marks all original orders as "Paid" once the merged order is marked as paid by the fulfillment service. This allows the admin panel and store analytics to reflect these events correctly.