Added support for CC type
[Business-OnlinePayment-InternetSecure.git] / t / types.t
1 # vim:set syntax=perl encoding=utf-8:
2
3 # Check for case-insensitivity and CC support in type
4
5 use constant TYPES => ('Visa', 'viSa', 'CC');
6
7 use Test::More tests => 1 + TYPES;
8
9 BEGIN { use_ok('Business::OnlinePayment') };
10
11 my $txn = new Business::OnlinePayment 'InternetSecure', merchant_id => '0000';
12
13 foreach my $type (TYPES) {
14         $txn->content(
15                 action          => 'Normal Authorization',
16                 type            => $type,
17
18                 card_number     => '5111-1111-1111-1111',
19                 exp_date        => '0704',
20
21                 amount          => 13.95,
22         );
23
24         # This will fail if type is not recognized
25         $txn->to_xml;
26
27         pass("type: $type");
28 }
29