5 use POSIX qw(strftime);
8 use Business::OnlinePayment;
11 "to test set environment variables:"
12 . " (required) ELINK_ACH_ACCOUNT and ELINK_ACH_PASSWORD";
15 ( $ENV{"ELINK_ACH_ACCOUNT"} && $ENV{"ELINK_ACH_PASSWORD"} )
17 : ( skip_all => $runinfo )
22 "merchantcustservnum" => "8005551212",
26 login => $ENV{"ELINK_ACH_ACCOUNT"},
27 password => $ENV{"ELINK_ACH_PASSWORD"},
28 action => "Normal Authorization",
30 description => "Business::OnlinePayment::TransFirsteLink test",
31 routing_code => "052000113",
32 account_number => "000000000001",
33 check_number => "100",
35 expiration => "12/" . strftime( "%y", localtime ),
37 invoice_number => "1999",
38 account_name => "Tofu Beast",
39 customer_id => "TB01",
40 email => 'transfirst@weasellips.com',
41 address => "123 Anystreet",
46 phone => "4045551212",
49 { # valid account test
50 my $tx = new Business::OnlinePayment( "TransFirsteLink", %opts );
51 $tx->content(%content);
54 desc => "valid account",
60 SKIP: { # invalid account test
62 skip "invalid account tests broken", 4;
64 my $tx = new Business::OnlinePayment( "TransFirsteLink", %opts );
65 $tx->content( %content, routing_code => "052000113",
66 account_number => "000000000001",
71 desc => "invalid account",
77 SKIP: { # credit/refund test
79 skip "credit/refund tests broken", 4;
81 my $tx = new Business::OnlinePayment( "TransFirsteLink", %opts );
82 $tx->content( %content, action => "Credit");
86 desc => "credit/refund",
96 $tx->test_transaction(1);
99 is( $tx->is_success, $o{is_success}, "$o{desc}: " . tx_info($tx) );
100 is( $tx->result_code, $o{result_code}, "result_code(): RESULT" );
101 is( scalar(@{$tx->junk}), 0, "junk() / JUNK " );
102 like( $tx->order_number, qr/^(\d{9}|)$/, "order_number() / PNREF" );
108 no warnings 'uninitialized';
112 "is_success(", $tx->is_success, ")",
113 " order_number(", $tx->order_number, ")",
114 " result_code(", $tx->result_code, ")",
115 $tx->junk ? " junk(". join('|', @{$tx->junk}). ")" : '',