X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=t%2F30parse.t;h=3734631391dbf3c468754d42c9b7691ed5589d8e;hb=227f87ababc68077ac00d2fb5ee52f080370cbff;hp=cfc2b55e96e402a4189f7ce875997914ecfad3ac;hpb=70860c963fab13b6c28e998519936fcb0af5d083;p=Business-OnlinePayment-InternetSecure.git diff --git a/t/30parse.t b/t/30parse.t index cfc2b55..3734631 100755 --- a/t/30parse.t +++ b/t/30parse.t @@ -1,10 +1,12 @@ +# vim:set syntax=perl: + use constant FIELDS => qw( result_code authorization error_message receipt_number sales_number date card_type avs_response cvv2_response - total_amount + total_amount taxes ); use constant RESULTS => ( @@ -12,7 +14,7 @@ use constant RESULTS => ( is_success => 1, result_code => '2000', authorization => 'T00000', - error_message => 'Test Approved', + error_message => undef, receipt_number => '1096019995.5012', sales_number => 0, date => '2003/12/17 09:59:58', @@ -20,6 +22,9 @@ use constant RESULTS => ( avs_response => undef, cvv2_response => undef, total_amount => 3.88, + taxes => { GST => 0.25 }, + uuid => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', + guid => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', }, { is_success => 0, @@ -33,6 +38,10 @@ use constant RESULTS => ( avs_response => undef, cvv2_response => undef, total_amount => 3.88, + taxes => { GST => 0.25, + PST => 0.27 }, + uuid => undef, + guid => undef, }, ); @@ -60,7 +69,7 @@ foreach my $results (RESULTS) { foreach (FIELDS) { no strict 'refs'; - is($txn->$_, $results->{$_}, $_); + is_deeply($txn->$_, $results->{$_}, $_); } } @@ -128,6 +137,7 @@ __DATA__ 3.10::1::001::Test Product 1::{USD}{GST}{TEST}|0.20::1::010::Test Product 2::{GST}{TEST}|0.33::1::020::Test Product 3::{GST}{TEST}|0.25::1::GST::Canadian GST Charged::{TAX}{CALCULATED} + f81d4fae-7dec-11d0-a765-00a0c91e6bf6 @@ -153,6 +163,7 @@ __DATA__ {USD} {GST} + {PST} @@ -163,6 +174,7 @@ __DATA__ 0.20 {GST} + {PST} @@ -173,6 +185,7 @@ __DATA__ 0.33 {GST} + {PST} @@ -186,8 +199,19 @@ __DATA__ {CALCULATED} + + PST + PST Charged + 1 + 0.27 + 0.27 + + {TAX} + {CALCULATED} + + - 3.10::1::001::Test Product 1::{USD}{GST}|0.20::1::010::Test Product 2::{GST}|0.33::1::020::Test Product 3::{GST}|0.25::1::GST::Canadian GST Charged::{TAX}{CALCULATED} + 3.10::1::001::Test Product 1::{USD}{GST}{PST}|0.20::1::010::Test Product 2::{GST}{PST}|0.33::1::020::Test Product 3::{GST}{PST}|0.25::1::GST::Canadian GST Charged::{TAX}{CALCULATED}|0.27::1::PST::PST Charged::{TAX}{CALCULATED}