summaryrefslogtreecommitdiff
path: root/InternetSecure.pm
diff options
context:
space:
mode:
authorfbriere <fbriere>2006-02-16 23:44:35 +0000
committerfbriere <fbriere>2006-02-16 23:44:35 +0000
commitaeefaf19907da445544d0eadc9c0e0e62f7b3d5d (patch)
tree5e59826b7cf185e4021ffb1659d583d444ad7207 /InternetSecure.pm
parentc205128a87a645f3e65be5f58ca04e124d56e9b2 (diff)
Remove prod_string() taxes argument
Diffstat (limited to 'InternetSecure.pm')
-rwxr-xr-xInternetSecure.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/InternetSecure.pm b/InternetSecure.pm
index c70b79f..65a9112 100755
--- a/InternetSecure.pm
+++ b/InternetSecure.pm
@@ -108,14 +108,13 @@ sub parse_expdate {
# Convert a single product into a product string
#
sub prod_string {
- my ($self, $currency, $taxes, %data) = @_;
+ my ($self, $currency, %data) = @_;
croak "Missing amount in product" unless defined $data{amount};
my @flags = ($currency);
- $taxes = uc $data{taxes} if defined $data{taxes};
- foreach (split ' ' => $taxes) {
+ foreach (split ' ' => uc($data{taxes} || '')) {
croak "Unknown tax code $_" unless /^(GST|PST|HST)$/;
push @flags, $_;
}
@@ -200,16 +199,16 @@ sub to_xml {
if (ref $content{description}) {
$data{Products} = join '|' => map $self->prod_string(
- $content{currency},
- $content{taxes},
- %$_),
- @{ $content{description} };
+ $content{currency},
+ taxes => $content{taxes},
+ %$_),
+ @{ $content{description} };
} else {
$self->required_fields(qw(amount));
$data{Products} = $self->prod_string(
$content{currency},
- $content{taxes},
- amount => $content{amount},
+ taxes => $content{taxes},
+ amount => $content{amount},
description => $content{description},
);
}