Skip to content
Docs
Get RestroPress

Filter

rpress_paypal_refund_body_args

Updated
On this page

Filters the body fields sent to PayPal when refunding a payment.

Runs in rpress_refund_paypal_purchase after the credentials are resolved. The body is the NVP parameter array: USER, PWD, SIGNATURE, VERSION, METHOD (RefundTransaction), TRANSACTIONID and REFUNDTYPE (Full). Add or change fields to send extra data with the refund request.

Parameters#

ParameterTypeDescription
$bodyarrayNVP request fields keyed by parameter name.
$paymentRPRESS_PaymentThe payment being refunded.

Return value#

array. The request body to send.

Example#

function my_paypal_refund_body( $body, $payment ) {
	$body['NOTE'] = 'Refund for order ' . $payment->ID;
	return $body;
}
add_filter( 'rpress_paypal_refund_body_args', 'my_paypal_refund_body', 10, 2 );

Source#

Applied in:

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

See also#

Was this page helpful?