LLMS_Transaction::can_be_refunded()
Determines if the transaction can be refunded.
Description Description
Status must not be "failed" and total refunded amount must be less than order amount.
Return Return
(boolean)
Source Source
File: includes/models/model.llms.transaction.php
public function can_be_refunded() {
$can_be_refunded = true;
if ( in_array( $this->get( 'status' ), array( 'llms-txn-failed', 'llms-txn-pending' ), true ) ) {
$can_be_refunded = false;
} elseif ( $this->get_refundable_amount( array(), 'float' ) <= 0 ) {
$can_be_refunded = false;
}
/**
* Filters whether or not a transaction can be refunded.
*
* @since 7.0.0
*
* @param boolean $can_be_refunded Whether the transaction can be refunded.
* @param LLMS_Transaction $transaction The transaction object.
*/
return apply_filters( 'llms_transaction_can_be_refunded', $can_be_refunded, $this );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 7.0.0 | Made the return value filterable via the llms_transaction_can_be_refunded hook. |
| 3.0.0 | Introduced. |