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, ELINK_DO_LIVE";
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"} &&
26 : ( skip_all => $runinfo )
31 "merchantcustservnum" => "8005551212",
35 login => $ENV{"ELINK_ACH_ACCOUNT"},
36 password => $ENV{"ELINK_ACH_PASSWORD"},
37 action => "Normal Authorization",
39 description => "Business::OnlinePayment::TransFirsteLink live test",
40 routing_code => $ENV{"ELINK_ROUTING_CODE"},
41 account_number => $ENV{"ELINK_BANK_ACCOUNT"},
44 invoice_number => "LiveTest",
45 customer_id => "LiveTestCust",
46 account_name => $ENV{"ELINK_ACH_NAME"},
47 address => $ENV{"ELINK_ACH_ADDRESS"},
48 city => $ENV{"ELINK_ACH_CITY"},
49 state => $ENV{"ELINK_ACH_STATE"},
50 zip => $ENV{"ELINK_ACH_ZIP"},
51 phone => $ENV{"ELINK_ACH_PHONE"},
54 { # valid account test
55 my $tx = new Business::OnlinePayment( "TransFirsteLink", %opts );
56 $tx->content(%content);
59 desc => "valid account",
65 SKIP: { # invalid account test
67 skip "invalid account tests broken", 4;
69 my $tx = new Business::OnlinePayment( "TransFirsteLink", %opts );
70 $tx->content( %content, routing_code => "052000113",
71 account_number => "000000000001",
76 desc => "invalid account",
82 { # credit/refund test
84 my $tx = new Business::OnlinePayment( "TransFirsteLink", %opts );
85 $tx->content( %content, action => "Credit");
89 desc => "credit/refund",
91 result_code => "ACCEPTED",
101 is( $tx->is_success, $o{is_success}, "$o{desc}: " . tx_info($tx) );
102 is( $tx->result_code, $o{result_code}, "result_code(): RESULT" );
103 is( scalar(@{$tx->junk}), 0, "junk() / JUNK " );
104 like( $tx->order_number, qr/^(\d{9}|)$/, "order_number() / PNREF" );
110 no warnings 'uninitialized';
114 "is_success(", $tx->is_success, ")",
115 " order_number(", $tx->order_number, ")",
116 " result_code(", $tx->result_code, ")",
117 $tx->junk ? " junk(". join('|', @{$tx->junk}). ")" : '',