Skip to content
Docs
Get RestroPress

Action

rpress_customer_post_attach_payment

Updated
On this page

Fires after a payment is attached to a customer.

Fires at the end of RPRESS_Customer::attach_payment(), after the payment_ids update and the stat increments. The first argument tells whether the update succeeded.

Parameters#

ParameterTypeDescription
$payment_addedboolWhether the payment IDs were updated successfully.
$payment_idintThe payment ID.
$customer_idintThe customer ID.
$customerRPRESS_CustomerThe customer object.

Example#

function my_customer_post_attach_payment( $payment_added, $payment_id, $customer_id, $customer ) {
	if ( $payment_added ) {
		update_post_meta( $payment_id, '_my_customer_id', $customer_id );
	}
}
add_action( 'rpress_customer_post_attach_payment', 'my_customer_post_attach_payment', 10, 4 );

Source#

Fired from:

  • includes/class-rpress-customer.php (line 394), in RPRESS_Customer::attach_payment()

See also#

Was this page helpful?