Skip to content

Modifying an order with an outstanding (partial) balance will refund the customer even if there isn't money due back #4013

@taxilian

Description

@taxilian

Describe the bug

If I edit an order and add an item it goes into "arranging additional payment"; if I then edit it and remove that item (customer changed their mind, payment processing didn't work, whatever) it will try to refund the original order even though the refund amount would be the same as the amount due on the order.

To Reproduce
Steps to reproduce the behavior:

  1. Go to an existing order in Payment Settled state
  2. Edit the order
  3. Add an item, save. The order should go to "Arranging additional payment"
  4. Without adding any new payments, edit the order
  5. Remove the item, restoring the total price to the original (paid) price

Expected behavior
It should be happy and return the order to the original state, Payment Settled

Actual behavior
If you go through with it a refund will be created and processed for the amount of the item you removed, thus requiring another additional payment to fix it.

Screenshots/Videos

Image Image Image Image Image

Environment (please complete the following information):

  • @vendure/core version: 3.4.4
  • Nodejs version: 22
  • Database (mysql/postgres etc): postgres
  • Operating System (Windows/macOS/Linux): Linux
  • Browser (if applicable): Any
  • Package manager (npm/yarn/pnpm): npm

Additional context

It is possible this is related to customizations that I've made, but I've been digging through and if so I don't know where to start looking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions