projects
/
Business-OnlinePayment-InternetSecure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c205128
)
Remove prod_string() taxes argument
author
fbriere
<fbriere>
Thu, 16 Feb 2006 23:44:35 +0000
(23:44 +0000)
committer
fbriere
<fbriere>
Thu, 16 Feb 2006 23:44:35 +0000
(23:44 +0000)
InternetSecure.pm
patch
|
blob
|
history
diff --git
a/InternetSecure.pm
b/InternetSecure.pm
index
c70b79f
..
65a9112
100755
(executable)
--- a/
InternetSecure.pm
+++ b/
InternetSecure.pm
@@
-108,14
+108,13
@@
sub parse_expdate {
# Convert a single product into a product string
#
sub prod_string {
# 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);
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, $_;
}
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(
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},
} 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},
);
}
description => $content{description},
);
}