projects
/
Business-OnlinePayment-InternetSecure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename sales_order_number() to order_number()
[Business-OnlinePayment-InternetSecure.git]
/
InternetSecure.pm
diff --git
a/InternetSecure.pm
b/InternetSecure.pm
index
af62241
..
b99a95e
100755
(executable)
--- a/
InternetSecure.pm
+++ b/
InternetSecure.pm
@@
-37,8
+37,8
@@
sub set_defaults {
$self->path('/process.cgi');
$self->build_subs(qw(
$self->path('/process.cgi');
$self->build_subs(qw(
- receipt_number
sales_
order_number
- card
holder card
_type
+ receipt_number order_number
+ card_type
total_amount
avs_response cvv2_response
));
total_amount
avs_response cvv2_response
));
@@
-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, $_;
}
@@
-149,13
+148,11
@@
sub to_xml {
croak 'Unsupported action'
unless $content{action} =~ /^Normal Authori[zs]ation$/i;
croak 'Unsupported action'
unless $content{action} =~ /^Normal Authori[zs]ation$/i;
- $content{currency} ||= 'CAD';
- $content{currency} = uc $content{currency};
+ $content{currency} = uc($content{currency} || 'CAD');
croak "Unknown currency code ", $content{currency}
unless $content{currency} =~ /^(CAD|USD)$/;
croak "Unknown currency code ", $content{currency}
unless $content{currency} =~ /^(CAD|USD)$/;
- $content{taxes} ||= '';
- $content{taxes} = uc $content{taxes};
+ $content{taxes} = uc($content{taxes} || '');
my %data = $self->get_remap_fields(qw(
xxxCard_Number card_number
my %data = $self->get_remap_fields(qw(
xxxCard_Number card_number
@@
-200,16
+197,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},
);
}
@@
-253,8
+250,7
@@
sub parse_response {
$self->infuse($response, qw(
ReceiptNumber receipt_number
$self->infuse($response, qw(
ReceiptNumber receipt_number
- SalesOrderNumber sales_order_number
- xxxName cardholder
+ SalesOrderNumber order_number
CardType card_type
Page result_code
ApprovalCode authorization
CardType card_type
Page result_code
ApprovalCode authorization
@@
-451,9
+447,8
@@
separating them with spaces, such as C<GST HST>.
=item name / company / address / city / state / zip / country / phone / email
=item name / company / address / city / state / zip / country / phone / email
-Facultative customer information. B<state> should be either a postal
-abbreviation or a two-letter code taken from ISO 3166-2, and B<country> should
-be a two-letter code taken from ISO 3166-1.
+Customer information. B<Country> should be a two-letter code taken from ISO
+3166-1.
=back
=back
@@
-463,7
+458,7
@@
be a two-letter code taken from ISO 3166-1.
=over 4
=over 4
-=item receipt_number() /
sales_
order_number()
+=item receipt_number() / order_number()
Receipt number and sales order number of submitted order.
Receipt number and sales order number of submitted order.
@@
-471,11
+466,6
@@
Receipt number and sales order number of submitted order.
Total amount billed for this order, including taxes.
Total amount billed for this order, including taxes.
-=item cardholder()
-
-Cardholder's name. This is currently a mere copy of the B<name> field passed
-to B<submit()>.
-
=item card_type()
Type of the credit card used for the submitted order, being one of the
=item card_type()
Type of the credit card used for the submitted order, being one of the