Skip to content
Docs
Get RestroPress

Action

rpress_pre_complete_purchase

Updated
On this page

Fires before the sale and earnings records are updated for a payment moving to a completed status.

Runs in rpress_complete_purchase, which is attached to rpress_update_payment_status. It fires when a payment changes to the publish or processing status from any other status, before sale logs, customer stats and discount usage are updated.

Parameters#

ParameterTypeDescription
$payment_idintID of the payment being completed.

Example#

function my_before_complete( $payment_id ) {
	rpress_get_payment( $payment_id )->add_note( 'Completion started' );
}
add_action( 'rpress_pre_complete_purchase', 'my_before_complete' );

Notes#

Unlike rpress_complete_purchase, this action is not limited to the first completion of a payment.

Source#

Fired from:

  • includes/payments/actions.php (line 41), in rpress_complete_purchase()

See also#

Was this page helpful?