Created
December 21, 2017 10:11
-
-
Save vanbo/04167c49503a485da703f7e93acb6085 to your computer and use it in GitHub Desktop.
WC Paytrace, Add parameters to transaction 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_paytrace_transaction_request', 'prefix_filter_paytrace_transaction_request', 10, 5 ); | |
/** | |
* @param array $request_parameters | |
* @param WC_Order $order The order to be charged | |
* @param float $amount Amount to be charged | |
* @param bool $is_subscription Is this a subscription | |
* @param bool $is_paid_with_profile Is this a profile payment(true) or new card is used(false) | |
* | |
* @return array | |
*/ | |
function prefix_filter_paytrace_transaction_request( $request_parameters, $order, $amount, $is_subscription, $is_paid_with_profile ) { | |
// To add a parameter just add the key => value to the $request_parameters | |
$request_parameters['myParameter'] = 'myParameterValue'; | |
return $request_parameters; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment