X-Git-Url: http://git.freeside.biz/gitweb/?p=Business-OnlinePayment-InternetSecure.git;a=blobdiff_plain;f=t%2F50idempotence.t;fp=t%2F50idempotence.t;h=a387e57cd2010a2b5716cdc7da1f93145163ce53;hp=0000000000000000000000000000000000000000;hb=4faf9840f9ecf50c9cfa88bf236ab6963f101472;hpb=0e8df6b61bc37a97b87bc0c95ba818495b3b5d00 diff --git a/t/50idempotence.t b/t/50idempotence.t new file mode 100755 index 0000000..a387e57 --- /dev/null +++ b/t/50idempotence.t @@ -0,0 +1,28 @@ +# vim:set syntax=perl encoding=utf-8: + +# get_remap_fields() used to be destructive (via remap_fields), and thus +# to_xml couldn't be called by itself. + +use Test::More tests => 1 + 1; + +BEGIN { use_ok('Business::OnlinePayment') }; + +use constant TRANSACTION => + ( + action => 'Normal Authorization', + + card_number => '5111-1111-1111-1111', + exp_date => '0704', + + name => "Fr\x{e9}d\x{e9}ric Bri\x{e8}re", + + amount => 13.95, + ); + + +my $txn = new Business::OnlinePayment 'InternetSecure', merchant_id => '0000'; + +$txn->content(TRANSACTION); + +is($txn->to_xml, $txn->to_xml, 'idempotence'); +