Filter
rpress_paypal_redirect_args
On this page
Filters the arguments sent to PayPal when redirecting the buyer.
Runs in rpress_process_paypal_purchase after the pending order is created. The array holds keys such as business, cmd, invoice, currency_code, custom (the order ID), return, cancel_return, notify_url, item_name, amount, quantity, bn and optionally image_url. The array is converted to a query string with http_build_query and appended to the PayPal URL.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$paypal_args | array | Query arguments for the PayPal redirect. |
$purchase_data | array | Purchase data for the order. |
Return value#
array. The PayPal redirect arguments.
Example#
function my_paypal_redirect_args( $paypal_args, $purchase_data ) {
$paypal_args['item_name'] = get_bloginfo( 'name' ) . ' food order';
return $paypal_args;
}
add_filter( 'rpress_paypal_redirect_args', 'my_paypal_redirect_args', 10, 2 );
Notes#
Changing amount or currency_code can cause the IPN verification to fail against the stored order.
Source#
Applied in:
includes/gateways/paypal-standard.php(line 1462), inrpress_process_paypal_purchase()
See also#
Was this page helpful?
