1 use Test::More tests => 4 + 2;
3 BEGIN { use_ok('Business::OnlinePayment') };
4 BEGIN { use_ok('Business::OnlinePayment::InternetSecure') };
5 BEGIN { use_ok('XML::Simple', qw(xml_in)) };
6 BEGIN { use_ok('Encode') };
8 use charnames ':full'; # Why doesn't this work with use_ok?
10 use constant TRANSACTIONS => (
14 action => 'Normal Authorization',
17 card_number => '0000000000000000',
18 exp_date => '2004-07',
21 name => "Fr\N{LATIN SMALL LETTER E WITH ACUTE}d\N{LATIN SMALL LETTER E WITH ACUTE}ric Bri\N{LATIN SMALL LETTER E WITH GRAVE}re",
23 address => '123 Street',
28 phone => '(555) 555-1212',
29 email => 'fbriere@fbriere.net',
40 description => 'Some product',
44 description => 'Shipping',
48 description => 'Some HST example',
56 action => 'Normal Authorization',
59 card_number => '4000000000000000',
62 name => "Fr\x{e9}d\x{e9}ric Bri\x{e8}re",
67 description => "Box o' goodies",
72 my $txn = new Business::OnlinePayment 'InternetSecure', merchant_id => '0000';
75 foreach (TRANSACTIONS) {
76 $txn->test_transaction(delete $_->{_test});
79 xml_in(Encode::encode('utf8', $txn->to_xml)),
86 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
88 <MerchantNumber>0000</MerchantNumber>
89 <xxxCard_Number>0000000000000000</xxxCard_Number>
90 <xxxCCMonth>07</xxxCCMonth>
91 <xxxCCYear>2004</xxxCCYear>
93 <CVV2Indicator>000</CVV2Indicator>
94 <Products>9.99::5::a 001::Some product::{CAD}{GST}{PST}|5.65::1::::Shipping::{CAD}{GST}{PST}|10.00::1::::Some HST example::{CAD}{HST}</Products>
95 <xxxName>Frédéric Brière</xxxName>
96 <xxxCompany></xxxCompany>
97 <xxxAddress>123 Street</xxxAddress>
98 <xxxCity>Metropolis</xxxCity>
99 <xxxProvince>ZZ</xxxProvince>
100 <xxxPostal>A1A 1A1</xxxPostal>
101 <xxxCountry>CA</xxxCountry>
102 <xxxPhone>(555) 555-1212</xxxPhone>
103 <xxxEmail>fbriere@fbriere.net</xxxEmail>
104 <xxxShippingName></xxxShippingName>
105 <xxxShippingCompany></xxxShippingCompany>
106 <xxxShippingAddress></xxxShippingAddress>
107 <xxxShippingCity></xxxShippingCity>
108 <xxxShippingProvince></xxxShippingProvince>
109 <xxxShippingPostal></xxxShippingPostal>
110 <xxxShippingCountry></xxxShippingCountry>
111 <xxxShippingPhone></xxxShippingPhone>
112 <xxxShippingEmail></xxxShippingEmail>
115 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
117 <MerchantNumber>0000</MerchantNumber>
118 <xxxCard_Number>4000000000000000</xxxCard_Number>
119 <xxxCCMonth>07</xxxCCMonth>
120 <xxxCCYear>2004</xxxCCYear>
122 <CVV2Indicator></CVV2Indicator>
123 <Products>12.95::1::::Box o' goodies::{USD}{TEST}</Products>
124 <xxxName>Frédéric Brière</xxxName>
125 <xxxCompany></xxxCompany>
126 <xxxAddress></xxxAddress>
128 <xxxProvince></xxxProvince>
129 <xxxPostal></xxxPostal>
130 <xxxCountry></xxxCountry>
131 <xxxPhone></xxxPhone>
132 <xxxEmail></xxxEmail>
133 <xxxShippingName></xxxShippingName>
134 <xxxShippingCompany></xxxShippingCompany>
135 <xxxShippingAddress></xxxShippingAddress>
136 <xxxShippingCity></xxxShippingCity>
137 <xxxShippingProvince></xxxShippingProvince>
138 <xxxShippingPostal></xxxShippingPostal>
139 <xxxShippingCountry></xxxShippingCountry>
140 <xxxShippingPhone></xxxShippingPhone>
141 <xxxShippingEmail></xxxShippingEmail>