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