Index: openacs-4/packages/ezic-gateway/lib/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ezic-gateway/lib/one.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ezic-gateway/lib/one.adp 2 Sep 2008 06:40:01 -0000 1.1 +++ openacs-4/packages/ezic-gateway/lib/one.adp 9 Sep 2008 08:39:12 -0000 1.2 @@ -1 +1 @@ -@response_reason_text@ @avs_text@ +@response_reason_text@ @avs_text@ @code_text@ Index: openacs-4/packages/ezic-gateway/lib/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ezic-gateway/lib/one.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ezic-gateway/lib/one.tcl 2 Sep 2008 06:40:01 -0000 1.1 +++ openacs-4/packages/ezic-gateway/lib/one.tcl 9 Sep 2008 08:39:12 -0000 1.2 @@ -10,6 +10,17 @@ # get transaction log comments. db_1row get_transaction_comments "select response_reason_text, avs_code from ezic_gateway_result_log - where transaction_id = :transaction_id and amount = :amount and (substr(txn_attempted_type,1,9) = 'AUTH_ONLY' or substr(txn_attempted_type,1,12) = 'AUTH_CAPTURE')" + where transaction_id = :transaction_id and amount = :amount and (substr(txn_attempted_type,1,9) = 'AUTH_ONLY' or substr(txn_attempted_type,1,12) = 'AUTH_CAPTURE') and response_reason_text is not null and avs_code is not null order by txn_attempted_time desc limit 1" -set avs_text [ezic_gateway.expand_avs $avs_code] +if { [info exists response_reason_text] && [info exists avs_code] } { + # decode left most avs_code. Second character is card CVV2/CVC2/CID code response + set avs_text [ezic_gateway.expand_avs [string range $avs_code 0 0]] + set code_text "CID: [string range $avs_code 1 1]" +} else { + set response_reason_text "" + set avs_text "" + set code_text "" +} + + +