Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanbo/72f3c707e35722a71db5647009c008a0 to your computer and use it in GitHub Desktop.
Save vanbo/72f3c707e35722a71db5647009c008a0 to your computer and use it in GitHub Desktop.
WooCommerce TrustCommerce Modify Token Payment Request
add_filter( 'wc_trustcommerce_process_profile_payment_request_request', 'prefix_modify_token_payment_request', 10, 3 );
/**
* @param array $request
* @param WC_Order $order
* @param $gateway
*
* @return mixed
*/
function prefix_modify_token_payment_request( $request, $order, $gateway ) {
// You have access to all request properties right before a payment request is sent.
// Examples:
// Change customer name
$request['name'] = $order->get_formatted_billing_full_name();
// Always return the parameters
return $request;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment