Created
August 20, 2019 15:14
-
-
Save vanbo/72f3c707e35722a71db5647009c008a0 to your computer and use it in GitHub Desktop.
WooCommerce TrustCommerce Modify Token Payment Request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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