0.02
[Business-OnlinePayment-PayConnect.git] / t / bad_lec.t
1 #BEGIN { $| = 1; print "1..4\n"; }
2 BEGIN { $| = 1; print "1..3\n"; }
3
4 use Business::OnlinePayment;
5
6 my %phone2error = (
7   '2033500000' => '0130',
8   '2012179746' => '0150',
9   '4083624100' => '0160',
10   #got 0416 (expected 0141)?? #'9044270189' => '0141',
11 );
12
13 foreach my $phone (keys %phone2error) {
14
15   my $tx = new Business::OnlinePayment("PayConnect",
16     partner => 's9Te1',
17   );
18   $tx->content(
19       type           => 'LEC',
20       login          => '7001',
21       password       => '9PIci',
22       action         => 'Authorization Only',
23       description    => 'Business::OnlinePayment LEC test',
24       amount         => '1.01',
25       invoice_number => '100100',
26       customer_id    => 'jsk',
27       first_name     => 'Tofu',
28       last_name      => 'Beast',
29       address        => '123 Anystreet',
30       city           => 'Anywhere',
31       state          => 'UT',
32       zip            => '84058',
33       phone          => $phone,
34   );
35   $tx->test_transaction(1); # test, dont really charge (NOP for this gateway)
36   $tx->submit();
37   
38   $num++;
39   if($tx->is_success() || $tx->result_code ne $phone2error{$phone} ) {
40       warn "**** got ". $tx->result_code. " (expected $phone2error{$phone}): ".
41            $tx->error_message. " ****\n";
42       print "not ok $num\n";
43   } else {
44       print "ok $num\n";
45   }
46
47 }