initial import
[Business-OnlinePayment-VirtualNet.git] / t / bad_auth.t
1 BEGIN { $| = 1; print "1..1\n"; }
2
3 use Business::OnlinePayment;
4
5 $DEBUG = 0;
6 $Business::OnlinePayment::VirtualNet::DEBUG = $DEBUG;
7
8 #     Use this merchant information for testing only. 
9 #  
10 #     Bin= 999995 Agent = 000000 Chain = 111111 Merchant = 888000002200
11 # Store = 5999 Terminal = 1515
12 #      Mcc = 5999 .
13 #    If you are doing AVS (address Ver ) use this address  8320 zip 85284.
14
15 my $tx = new Business::OnlinePayment("VirtualNet",,
16     'merchant_id' => '888000002200',
17     'store'       => '5999',
18     'terminal'    => '1515',
19     'mcc'         => '5999', #merchant category code
20     'bin'         => '999995', #acquirer BIN
21     'zip'         => '543211420', #merchant zip (US) or assigned city code
22
23     'agent'       => '000000',
24     'v'           => '00000001',
25
26     'merchant_name'  => 'Internet Service Provider', #25 char max
27     'merchant_city'  => 'Gloucester', #13 char max
28     'merchant_state' => 'VA', #2 char
29
30     'seq_file'    => '/tmp/bop-virtualnet-sequence',
31     'batchnum_file' => '/tmp/bop-virtualnet-batchnum', # :/  0-999 in 5 days
32 );
33 $tx->content(
34     type           => 'CC',
35     action         => 'Authorization only',
36     description    => 'Business::OnlinePayment visa test',
37     amount         => '999910.00',
38     invoice_number => '100100',
39     customer_id    => 'jsk',
40     first_name     => 'Tofu',
41     last_name      => 'Beast',
42     address        => '123 Anystreet',
43     city           => 'Anywhere',
44     state          => 'UT',
45     zip            => '84058',
46     card_number    => '4111111111111111',
47     expiration     => '09/03',
48 );
49 $tx->test_transaction(1); # test, dont really charge (doesn't do anything with VirtualNet)
50 $tx->submit();
51
52 if($tx->is_success()) {
53     print "not ok 1\n";
54     warn '** ('. $tx->result_code. ') '. $tx->error_message. " **\n" if $DEBUG;
55     warn $tx->error_message if $DEBUG;
56 } else {
57     warn '** ('. $tx->result_code. ') '. $tx->error_message. " **\n" if $DEBUG;
58     print "ok 1\n";
59 }