mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
As is, `payment_total` is only increased after successfully processing a payment and never updated. This inconsistency breaks `CustomerWithBalance` which relies on it. Needless to say that if we keep this denormalized column, we better make it consistent. I investigated current Spree's master branch (709e686cc0) and they also realized it was broken. Now `Payment` runs the following from the `after_save` `update_order` callback. ```rb order.updater.update_payment_total if completed? || void? ``` I also took the chance to rearrange tests a bit.