Created
July 3, 2020 01:24
-
-
Save ChaseWiseman/ce82a680cfe192c9b5bc882addf0e371 to your computer and use it in GitHub Desktop.
Adds an order note with the returned AVS results for Elavon Credit Card transactions
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 // only include this if needed | |
add_action( 'wc_payment_gateway_elavon_converge_credit_card_add_transaction_data', function( $order, $response ) { | |
if ( $order instanceof \WC_Order && $response instanceof \WC_Elavon_Converge_API_Credit_Card_Transaction_Response ) { | |
$message = sprintf( | |
'Elavon Fraud Results:<br />AVS Result: %s<br />CSC Result: %s', | |
esc_html( $response->get_avs_result() ), | |
esc_html( $response->get_csc_result() ) | |
); | |
$order->add_order_note( $message ); | |
} | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment