Sylius / Sylius/RefundPlugin

Cancelling a partially refunded order triggers fatal exception

Open
#418 4 comments 0 reactions 1 assignee View on GitHub

@Rafikooo is already working on this.

Since Oct 9, 2025.

Dominant language
PHP
Stars
73
Forks
76
PR merge metrics
No merged PRs in 30d

Description

Sylius version affected: 1.7 and appears unfixed in master

Description
If you partially refund an order and then attempt to cancel it (for example you refunded the items but not the shipping) you get InvalidArgumentException "Not enough units to decrease on hold quantity from the inventory of a variant". But it should not be attempting to release the hold, because the hold was already released when the order was paid.

Steps to reproduce

  • Place an order with a tracked product
  • Complete the payment
  • View the order in admin, refund part of the payment
  • Cancel the order, get exception

Possible Solution
Account for OrderPaymentStates::STATE_PARTIALLY_REFUNDED in OrderInventoryOperator::cancel()

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.