Skip to content
Docs
Get RestroPress

Filter

rpress_straight_to_gateway_purchase_data

Updated
On this page

Filters the purchase data built for a straight-to-gateway purchase.

Runs at the end of rpress_build_straight_to_gateway_data. The array describes a single menu item order sent directly to PayPal, with keys such as fooditems, fees, subtotal, price, purchase_key, user_email, user_info, cart_details, gateway (set to paypal) and buy_now (set to true). It is sent to the gateway by rpress_process_straight_to_gateway.

Parameters#

ParameterTypeDescription
$purchase_dataarrayPurchase data for the straight-to-gateway order.

Return value#

array. The purchase data.

Example#

function my_straight_to_gateway_data( $purchase_data ) {
	$purchase_data['post_data']['my_source'] = 'buy-now-button';
	return $purchase_data;
}
add_filter( 'rpress_straight_to_gateway_purchase_data', 'my_straight_to_gateway_data', 10, 1 );

Source#

Applied in:

  • includes/gateways/functions.php (line 276), in rpress_build_straight_to_gateway_data()

See also#

Was this page helpful?