Last active
February 1, 2021 07:58
-
-
Save vanbo/16b154dbfa4ef28333d043e2c6d5c69f to your computer and use it in GitHub Desktop.
WooCommerce TrustCommerce Modify Payment Request
This file contains hidden or 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
/** | |
* NOTЕ: Add the code to your "themes\child-theme\functions.php" file | |
*/ | |
add_filter( 'wc_trustcommerce_process_single_payment_request', 'prefix_modify_payment_request', 10, 3 ); | |
function prefix_modify_payment_request( $request, $order, $gateway ) { | |
// You have access to all request properties right before a payment request is sent. | |
// Disable the AVS | |
if ( isset( $request['avs'] ) ) { | |
$request['avs'] = 'n'; | |
} | |
// Remove IP address from the request | |
if ( isset( $request['ip'] ) ) { | |
unset( $request['ip'] ); | |
} | |
// Always return the parameters | |
return $request; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment