Created
November 12, 2013 22:39
-
-
Save justinstern/7440122 to your computer and use it in GitHub Desktop.
Sample code for adding a custom parameter to the WooCommerce Elavon VM Payment Gateway transaction request. This is most useful when a custom field is required on an account. Simply add the following to the bottom of your theme's functions.php, including whatever custom parameters your account setup requires
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
<?php | |
add_filter( 'wc_payment_gateway_elavon_vm_request_xml', 'wc_payment_gateway_elavon_vm_add_custom_fields', 10, 2 ); | |
function wc_payment_gateway_elavon_vm_add_custom_fields( $request_xml, $request ) { | |
$request_xml->addChild( 'ssl_name_on_card', str_replace( array( '&', '<', '>' ), '', $request->ssl_first_name . ' ' . $request->ssl_last_name ) ); | |
return $request_xml; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment