4d59f689205c8210fb67518780aa0abb1c9ff84c
[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                 type            => 'Visa',
21                 card_number     => '0000000000000000',
22                 exp_date        => '2004/07',
23                 name            => "Fr\x{e9}d\x{e9}ric Bri\x{e8}re",
24                 amount          => 0.01,
25         );
26
27 $txn->submit;
28
29 is($txn->result_code, '2000', 'is result_code 2000?');
30 is($txn->cardholder, "Fr\x{e9}d\x{e9}ric Bri\x{e8}re",
31         'is cardholder encoded properly?');
32