X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=t%2F30parse.t;h=619846809d9f6bec3358b047e24bd3954ac6444d;hb=aee9564f2cae2cd7b63aba4d52105dbf24422bae;hp=7e8e67897e4800a6644b14f697f1f694049ba2f4;hpb=e7b48d8f859ab09851ef35ba4cd19d61fbe66f1f;p=Business-OnlinePayment-InternetSecure.git diff --git a/t/30parse.t b/t/30parse.t index 7e8e678..6198468 100755 --- a/t/30parse.t +++ b/t/30parse.t @@ -6,7 +6,7 @@ use constant FIELDS => qw( date card_type avs_response cvv2_response - total_amount + total_amount tax_amounts ); use constant RESULTS => ( @@ -22,6 +22,7 @@ use constant RESULTS => ( avs_response => undef, cvv2_response => undef, total_amount => 3.88, + tax_amounts => { GST => 0.25 }, uuid => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', guid => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', }, @@ -37,6 +38,8 @@ use constant RESULTS => ( avs_response => undef, cvv2_response => undef, total_amount => 3.88, + tax_amounts => { GST => 0.25, + PST => 0.27 }, uuid => undef, guid => undef, }, @@ -66,7 +69,7 @@ foreach my $results (RESULTS) { foreach (FIELDS) { no strict 'refs'; - is($txn->$_, $results->{$_}, $_); + is_deeply($txn->$_, $results->{$_}, $_); } } @@ -160,6 +163,7 @@ __DATA__ {USD} {GST} + {PST} @@ -170,6 +174,7 @@ __DATA__ 0.20 {GST} + {PST} @@ -180,6 +185,7 @@ __DATA__ 0.33 {GST} + {PST} @@ -193,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}