Skip to content

Instantly share code, notes, and snippets.

@vanbo
Created August 18, 2020 12:24
Show Gist options
  • Select an option

  • Save vanbo/55ba463219326ebeffa61d518f3c30b0 to your computer and use it in GitHub Desktop.

Select an option

Save vanbo/55ba463219326ebeffa61d518f3c30b0 to your computer and use it in GitHub Desktop.
WooCommerce TrustCommerce add operator ID to requests
/**
* IMPORTANT: Add the code to your "child-theme/functions.php" file
*/
add_filter( 'wc_trustcommerce_process_single_payment_request', 'vanbo_tc_add_operator_to_requests', 10 );
add_filter( 'wc_trustcommerce_process_profile_payment_request_request', 'vanbo_tc_add_operator_to_requests', 10 );
add_filter( 'wc_trustcommerce_create_customer_profile_request', 'vanbo_tc_add_operator_to_requests', 10 );
add_filter( 'wc_trustcommerce_update_customer_profile_request', 'vanbo_tc_add_operator_to_requests', 10 );
add_filter( 'wc_refund_payment_request_trustcommerce', 'vanbo_tc_add_operator_to_requests', 10 );
add_filter( 'wc_capture_payment_request_trustcommerce', 'vanbo_tc_add_operator_to_requests', 10 );
/**
* Adds the operator parameter to the TrustCommerce requests
*
* @param $request
*
* @return mixed
*/
function vanbo_tc_add_operator_to_requests( $request ) {
$request['operator'] = 'operator_id';
return $request;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment