+ tx_check(
+ $tx,
+ desc => "invalid card_number",
+ is_success => 0,
+ result_code => 23,
+ error_message => "Invalid account number",
+ authorization => undef,
+ avs_code => undef,
+ cvv2_code => undef,
+ );
+}
+
+{ # avs_code() / AVSZIP and AVSADDR tests
+ my $tx = new Business::OnlinePayment( "PayflowPro", %opts );
+
+ # IF first 3 chars of STREET <= 334 and >= 666 THEN AVSADDR == "N"
+ $tx->content( %content, "address" => "500 Any street" );
+ tx_check(
+ $tx,
+ desc => "AVSADDR=N,AVSZIP=Y",
+ is_success => 0,
+ result_code => 126,
+ error_message => "Under review by Fraud Service",
+ authorization => "010101",
+ avs_code => "Z",
+ cvv2_code => "Y",
+ );
+
+ # IF first 3 chars of STREET >= 667 THEN AVSADDR == "X" (and AVSZIP="X")
+ $tx->content( %content, "address" => "700 Any street" );
+ tx_check(
+ $tx,
+ desc => "AVSADDR=X,AVSZIP=X",
+ is_success => 1,
+ result_code => 0,
+ error_message => "Approved",
+ authorization => "010101",
+ avs_code => "",
+ cvv2_code => "Y",
+ );
+
+ # IF ZIP <= 50001 and >= 99999 THEN AVSZIP == "N"
+ $tx->content( %content, "zip" => "99999" );
+ tx_check(
+ $tx,
+ desc => "AVSADDR=Y,AVSZIP=N",
+ is_success => 0,
+ result_code => 126,
+ error_message => "Under review by Fraud Service",
+ authorization => "010101",
+ avs_code => "A",
+ cvv2_code => "Y",
+ );
+
+ # Both AVSADDR and AVSZIP == "N"
+ $tx->content( %content, "address" => "500 Any street", "zip" => "99999" );
+ tx_check(
+ $tx,
+ desc => "AVSADDR=N,AVSZIP=N",
+ is_success => 0,
+ result_code => 126,
+ error_message => "Under review by Fraud Service",
+ authorization => "010101",
+ avs_code => "N",
+ cvv2_code => "Y",
+ );
+}
+
+{ # cvv2_code() / CVV2MATCH
+ my $tx = new Business::OnlinePayment( "PayflowPro", %opts );
+
+ # IF CVV2 >= 301 and <= 600 THEN CVV2MATCH == "N"
+ $tx->content( %content, "cvv2" => "301" );
+ tx_check(
+ $tx,
+ desc => "cvv2(301)",
+ is_success => 0,
+ result_code => 126,
+ error_message => "Under review by Fraud Service",
+ authorization => "010101",
+ avs_code => "Y",
+ cvv2_code => "N",
+ );
+
+ # IF CVV2 >= 601 THEN CVV2MATCH == "X"
+ $tx->content( %content, "cvv2" => "601" );
+ tx_check(
+ $tx,
+ desc => "cvv2(601)",
+ is_success => 0,
+ result_code => 126,
+ error_message => "Under review by Fraud Service",
+ authorization => "010101",
+ avs_code => "Y",
+ cvv2_code => "X",
+ );
+}
+
+sub tx_check {
+ my $tx = shift;
+ my %o = @_;
+