Added backwards-compatible support for exp_date
[Business-OnlinePayment-InternetSecure.git] / t / exp_date.t
1 # vim:set syntax=perl encoding=utf-8:
2
3 # Check for backwards-compatible support for exp_date
4
5 use Test::More tests => 2 + 1;
6
7 BEGIN { use_ok('Business::OnlinePayment') };
8 BEGIN { use_ok('XML::Simple', qw(xml_in)) };
9
10 my $txn = new Business::OnlinePayment 'InternetSecure', merchant_id => '0000';
11
12 $txn->content(
13                 action          => 'Normal Authorization',
14
15                 card_number     => '5111-1111-1111-1111',
16                 exp_date        => '0704',
17
18                 amount          => 13.95,
19         );
20
21 is_deeply( xml_in($txn->to_xml), xml_in(<<__EOF__) ); 
22 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
23 <TranxRequest>
24   <MerchantNumber>0000</MerchantNumber>
25   <xxxCard_Number>5111111111111111</xxxCard_Number>
26   <xxxCCMonth>07</xxxCCMonth>
27   <xxxCCYear>2004</xxxCCYear>
28   <CVV2>0</CVV2>
29   <CVV2Indicator></CVV2Indicator>
30   <Products>13.95::1::::::{CAD}</Products>
31   <xxxName></xxxName>
32   <xxxCompany></xxxCompany>
33   <xxxAddress></xxxAddress>
34   <xxxCity></xxxCity>
35   <xxxProvince></xxxProvince>
36   <xxxPostal></xxxPostal>
37   <xxxCountry></xxxCountry>
38   <xxxPhone></xxxPhone>
39   <xxxEmail></xxxEmail>
40   <xxxShippingName></xxxShippingName>
41   <xxxShippingCompany></xxxShippingCompany>
42   <xxxShippingAddress></xxxShippingAddress>
43   <xxxShippingCity></xxxShippingCity>
44   <xxxShippingProvince></xxxShippingProvince>
45   <xxxShippingPostal></xxxShippingPostal>
46   <xxxShippingCountry></xxxShippingCountry>
47   <xxxShippingPhone></xxxShippingPhone>
48   <xxxShippingEmail></xxxShippingEmail>
49 </TranxRequest>
50
51 __EOF__
52