5 use POSIX qw(strftime);
8 use Business::OnlinePayment;
11 "to test set environment variables:"
12 . " (required) ELINK_ACH_ACCOUNT, ELINK_ACH_PASSWORD"
13 . " ELINK_ROUTING_CODE, ELINK_BANK_ACCOUNT, ELINK_ACH_NAME"
14 . " ELINK_ACH_ADDRESS, ELINK_ACH_CITY, ELINK_ACH_STATE"
15 . " ELINK_ACH_ZIP, ELINK_ACH_PHONE";
18 ( $ENV{"ELINK_ACH_ACCOUNT"} && $ENV{"ELINK_ACH_PASSWORD"} &&
19 $ENV{"ELINK_ROUTING_CODE"} && $ENV{"ELINK_BANK_ACCOUNT"} &&
20 $ENV{"ELINK_ACH_NAME"} && $ENV{"ELINK_ACH_ADDRESS"} &&
21 $ENV{"ELINK_ACH_CITY"} && $ENV{"ELINK_ACH_STATE"} &&
22 $ENV{"ELINK_ACH_ZIP"} && $ENV{"ELINK_ACH_PHONE"}
25 : ( skip_all => $runinfo )
30 "merchantcustservnum" => "8005551212",
34 login => $ENV{"ELINK_ACH_ACCOUNT"},
35 password => $ENV{"ELINK_ACH_PASSWORD"},
36 action => "Normal Authorization",
38 description => "Business::OnlinePayment::TransFirsteLink live test",
39 routing_code => $ENV{"ELINK_ROUTING_CODE"},
40 account_number => $ENV{"ELINK_BANK_ACCOUNT"},
43 invoice_number => "LiveTest",
44 customer_id => "LiveTestCust",
45 account_name => $ENV{"ELINK_ACH_NAME"},
46 address => $ENV{"ELINK_ACH_ADDRESS"},
47 city => $ENV{"ELINK_ACH_CITY"},
48 state => $ENV{"ELINK_ACH_STATE"},
49 zip => $ENV{"ELINK_ACH_ZIP"},
50 phone => $ENV{"ELINK_ACH_PHONE"},
53 { # valid account test
54 my $tx = new Business::OnlinePayment( "TransFirsteLink", %opts );
55 $tx->content(%content);
58 desc => "valid account",
64 { # invalid account test
66 my $tx = new Business::OnlinePayment( "TransFirsteLink", %opts );
67 $tx->content( %content, routing_code => "052000113",
68 account_number => "000000000001",
73 desc => "invalid account",
79 { # credit/refund test
81 my $tx = new Business::OnlinePayment( "TransFirsteLink", %opts );
82 $tx->content( %content, action => "Credit");
86 desc => "credit/refund",
88 result_code => "ACCEPTED",
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}). ")" : '',