Filter
rpress_payment_is_recoverable
On this page
Filters whether a payment can be resumed by the buyer.
Applied by RPRESS_Payment::is_recoverable(). The default is true when the status is one of the recoverable statuses (pending, abandoned or failed unless filtered) and there is no transaction ID. It affects checkout resume, recovery links and other places that call the method. A gateway can return false while a charge is unresolved.
Available since RestroPress 3.5.1.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$recoverable | bool | Default decision. |
$payment | RPRESS_Payment | The payment. |
Return value#
bool. Whether the payment is recoverable.
Example#
add_filter( 'rpress_payment_is_recoverable', 'my_payment_is_recoverable', 10, 2 );
function my_payment_is_recoverable( $recoverable, $payment ) {
if ( 'processing' === $payment->get_meta( '_my_gateway_charge_state' ) ) {
return false;
}
return $recoverable;
}
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 1636), inRPRESS_Payment::is_recoverable()
See also#
Was this page helpful?
