Skip to content
Docs
Get RestroPress

Action

rpress_update_payment_status

Updated
On this page

Fires after a payment's status has been changed.

Runs at the end of RPRESS_Payment::update_status, after the post was updated and the refund, failure or pending processing for the new status has run. RestroPress hooks its own completion, status logging and cache handling to this action.

Parameters#

ParameterTypeDescription
$payment_idintID of the payment.
$statusstringThe new status.
$old_statusstring|falseThe previous status.

Example#

function my_on_payment_status( $payment_id, $status, $old_status ) {
	if ( 'publish' === $status ) {
		update_post_meta( $payment_id, '_my_paid_at', time() );
	}
}
add_action( 'rpress_update_payment_status', 'my_on_payment_status', 10, 3 );

Notes#

The paid status is stored as publish. rpress_complete_purchase is attached to this action at priority 100.

Source#

Fired from:

  • includes/payments/class-rpress-payment.php (line 1481), in RPRESS_Payment::update_status()

See also#

Was this page helpful?