Action
rpress_complete_purchase
On this page
Fires when a payment is marked as complete.
Runs in rpress_complete_purchase after the payment's completed date has been saved. It fires once per payment, because the surrounding block only runs while the payment has no completed date. The customer object is the customer attached to the payment.
Available since RestroPress 1.0.0.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$payment_id | int | Payment ID. |
$payment | RPRESS_Payment | Payment object containing all payment data. |
$customer | RPRESS_Customer | Customer object containing all customer data. |
Example#
function my_on_purchase_complete( $payment_id, $payment, $customer ) {
$payment->add_note( 'Completed for ' . $customer->email );
}
add_action( 'rpress_complete_purchase', 'my_on_purchase_complete', 10, 3 );
Notes#
The docblock in the source describes the 3-argument signature as added in 1.0.0. By default rpress_schedule_after_payment_action also runs on this hook to schedule the delayed rpress_after_payment_actions.
Source#
Fired from:
includes/payments/actions.php(line 128), inrpress_complete_purchase()
See also#
Was this page helpful?
