Skip to content
Docs
Get RestroPress

Action

rpress_paypal_refund_purchase

Updated
On this page

Fires after a PayPal refund has been attempted for a payment.

Runs at the end of rpress_refund_paypal_purchase, after the request has been sent and a note recording the outcome has been added to the payment. The _rpress_paypal_refunded payment meta is set only when PayPal accepted the refund.

Parameters#

ParameterTypeDescription
$paymentRPRESS_PaymentThe payment that was refunded or whose refund was attempted.

Example#

function my_after_paypal_refund( $payment ) {
	if ( $payment->get_meta( '_rpress_paypal_refunded', true ) ) {
		error_log( 'PayPal refund completed for payment ' . $payment->ID );
	}
}
add_action( 'rpress_paypal_refund_purchase', 'my_after_paypal_refund' );

Notes#

Fires whether or not the refund succeeded, so check the meta value before assuming success.

Source#

Fired from:

  • includes/gateways/paypal-standard.php (line 2234), in rpress_refund_paypal_purchase()

See also#

Was this page helpful?