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:
f30cb43
)
Rename taxes() to tax_amounts()
author
fbriere
<fbriere>
Sat, 18 Feb 2006 04:17:17 +0000
(
04:17
+0000)
committer
fbriere
<fbriere>
Sat, 18 Feb 2006 04:17:17 +0000
(
04:17
+0000)
InternetSecure.pm
patch
|
blob
|
history
t/30parse.t
patch
|
blob
|
history
diff --git
a/InternetSecure.pm
b/InternetSecure.pm
index
f3eacc8
..
cb6d00e
100755
(executable)
--- a/
InternetSecure.pm
+++ b/
InternetSecure.pm
@@
-42,12
+42,12
@@
sub set_defaults {
receipt_number sales_number uuid guid
date
card_type cardholder
receipt_number sales_number uuid guid
date
card_type cardholder
- total_amount tax
e
s
+ total_amount tax
_amount
s
avs_response cvv2_response
));
avs_response cvv2_response
));
- # Just in case someone tries to call tax
e
s() *before* submit()
- $self->tax
e
s( {} );
+ # Just in case someone tries to call tax
_amount
s() *before* submit()
+ $self->tax
_amount
s( {} );
}
# OnlinePayment's get_fields now filters out undefs in 3.x. :(
}
# OnlinePayment's get_fields now filters out undefs in 3.x. :(
@@
-231,10
+231,10
@@
sub infuse {
}
}
}
}
-sub extract_tax
e
s {
+sub extract_tax
_amount
s {
my ($self, $response) = @_;
my ($self, $response) = @_;
- my %tax
e
s;
+ my %tax
_amount
s;
my $products = $response->{Products};
return unless $products;
my $products = $response->{Products};
return unless $products;
@@
-245,11
+245,11
@@
sub extract_taxes {
grep($_ eq '{TAX}', @$flags) &&
grep($_ eq '{CALCULATED}', @$flags))
{
grep($_ eq '{TAX}', @$flags) &&
grep($_ eq '{CALCULATED}', @$flags))
{
- $tax
e
s{ $node->{code} } = $node->{subtotal};
+ $tax
_amount
s{ $node->{code} } = $node->{subtotal};
}
}
}
}
- return %tax
e
s;
+ return %tax
_amount
s;
}
# Parse the server's response and set various fields
}
# Parse the server's response and set various fields
@@
-296,7
+296,7
@@
sub parse_response {
$self->card_type(CARD_TYPES->{$self->card_type});
$self->card_type(CARD_TYPES->{$self->card_type});
- $self->tax
es( { $self->extract_taxe
s($response) } );
+ $self->tax
_amounts( { $self->extract_tax_amount
s($response) } );
return $self;
}
return $self;
}
@@
-544,10
+544,11
@@
Date and time of the transaction. Format is C<YYYY/MM/DD hh:mm:ss>.
Total amount billed for this order, including taxes.
Total amount billed for this order, including taxes.
-=item tax
e
s()
+=item tax
_amount
s()
-Returns a I<reference> to a hash that maps tax names (such as C<GST>) to the
-amount that was billed for each.
+Returns a I<reference> to a hash that maps taxes, which were listed under the
+B<taxes> argument to B<submit>(), to the amount that was calculated by
+InternetSecure.
=item cardholder()
=item cardholder()
diff --git
a/t/30parse.t
b/t/30parse.t
index
3734631
..
6198468
100755
(executable)
--- a/
t/30parse.t
+++ b/
t/30parse.t
@@
-6,7
+6,7
@@
use constant FIELDS => qw(
date
card_type
avs_response cvv2_response
date
card_type
avs_response cvv2_response
- total_amount tax
e
s
+ total_amount tax
_amount
s
);
use constant RESULTS => (
);
use constant RESULTS => (
@@
-22,7
+22,7
@@
use constant RESULTS => (
avs_response => undef,
cvv2_response => undef,
total_amount => 3.88,
avs_response => undef,
cvv2_response => undef,
total_amount => 3.88,
- tax
es
=> { GST => 0.25 },
+ tax
_amounts
=> { GST => 0.25 },
uuid => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
guid => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
},
uuid => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
guid => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
},
@@
-38,7
+38,7
@@
use constant RESULTS => (
avs_response => undef,
cvv2_response => undef,
total_amount => 3.88,
avs_response => undef,
cvv2_response => undef,
total_amount => 3.88,
- tax
es
=> { GST => 0.25,
+ tax
_amounts
=> { GST => 0.25,
PST => 0.27 },
uuid => undef,
guid => undef,
PST => 0.27 },
uuid => undef,
guid => undef,