phacility/phabricator · warning · Exception
This order can not be refunded because it has not been place
Error message
This order can not be refunded because it has not been placed.
What it means
assertCanRefundOrder() throws when the cart is STATUS_READY: the order exists but was never placed or paid, so a refund is meaningless. Only carts that have actually been charged can be refunded. Use canRefundOrder() to test the condition without the exception.
Source
Thrown at src/applications/phortune/storage/PhortuneCart.php:535
'finished building it yet.'));
case self::STATUS_READY:
throw new Exception(
pht(
'This order can not be cancelled because it has not been placed.'));
}
return $this->getImplementation()->assertCanCancelOrder($this);
}
public function assertCanRefundOrder() {
switch ($this->getStatus()) {
case self::STATUS_BUILDING:
throw new Exception(
pht(
'This order can not be refunded because the application has not '.
'finished building it yet.'));
case self::STATUS_READY:
throw new Exception(
pht(
'This order can not be refunded because it has not been placed.'));
}
return $this->getImplementation()->assertCanRefundOrder($this);
}
public function assertCanVoidOrder() {
if (!$this->getIsInvoice()) {
throw new Exception(
pht(
'This order can not be voided because it is not an invoice.'));
}
switch ($this->getStatus()) {
case self::STATUS_READY:
break;
default:View on GitHub (pinned to 5720a38cfe)
Solutions
- Check $cart->canRefundOrder() before showing or executing refund actions.
- Treat unplaced READY orders as cancellable/ignorable rather than refundable.
- Ensure order lists distinguish placed from unplaced carts.
Defensive patterns
Strategy: validation
Validate before calling
if ($cart->getStatus() === PhortuneCart::STATUS_READY) {
// never placed: use cancel/abandon semantics, not refund
}
if (!$cart->canRefundOrder()) {
return $this->newDialog()->setTitle(pht('Unable to Refund Order'));
} Type guard
function isPlacedCart(PhortuneCart $cart) {
return !in_array(
$cart->getStatus(),
array(PhortuneCart::STATUS_BUILDING, PhortuneCart::STATUS_READY));
} Prevention
- Check canRefundOrder() before offering refunds.
- Distinguish placed from unplaced orders in UI labels.
- Train support flows: unpaid orders are abandoned, not refunded.
When it happens
Trigger: Calling assertCanRefundOrder() on a cart in PhortuneCart::STATUS_READY, such as an abandoned checkout that was never completed.
Common situations: Support staff trying to 'undo' an unpaid order; refund UI shown uniformly across all order statuses; stale order links.
Related errors
- This order can not be refunded because the application has n
- This order can not be cancelled because the application has
- This order can not be cancelled because it has not been plac
- This order can not be voided because it is not an invoice.
- This order can not be voided because it is not ready for pay
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/f359aea54a2b3129.
Report an issue: GitHub.