0.05
[Business-OnlinePayment-InternetSecure.git] / t / 40live.t
1 # vim:set syntax=perl:
2
3 use Test::More;
4
5 BEGIN {
6         plan skip_all => 'MERCHANT_ID environment variable not set'
7                 unless defined $ENV{MERCHANT_ID};
8 };
9
10 BEGIN { plan tests => 1 + 2 };
11
12 BEGIN { use_ok('Business::OnlinePayment') };
13
14
15 my $txn = new Business::OnlinePayment 'InternetSecure',
16                 merchant_id => $ENV{MERCHANT_ID};
17
18 $txn->test_transaction(1);
19
20 $txn->content(
21                 action          => 'Normal Authorization',
22
23                 type            => 'Visa',
24                 card_number     => '0000000000000000',
25                 expiration      => '2004/07',
26
27                 name            => "Fr\x{e9}d\x{e9}ric Bri\x{e8}re",
28                 address         => '123 Nowhere',
29                 city            => 'Metropolis',
30                 state           => 'QC',
31                 zip             => 'A1A 1A1',
32                 country         => 'CA',
33                 phone           => '123-456-7890',
34                 email           => 'fbriere@fbriere.net',
35
36                 amount          => 0.01,
37                 description     => 'Test transaction',
38         );
39
40 $txn->submit;
41
42 is($txn->result_code, '2000', 'Result code is ok');
43 is($txn->cardholder, "Fr\x{e9}d\x{e9}ric Bri\x{e8}re",
44         'Cardholder name is encoded properly');
45