74f2695601fd9e9012f4f36c0c37a84386b9fe85
[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        => '2007/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     => [ { amount => 19.99, sku => '123',
36                                         description => 'Something' } ],
37         );
38
39 $txn->submit;
40
41 is($txn->result_code, '2000', 'Result code is ok');
42 is($txn->cardholder, "Fr\x{e9}d\x{e9}ric Bri\x{e8}re",
43         'Cardholder name is encoded properly');
44