summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-01-14 19:08:13 -0800
committerIvan Kohler <ivan@freeside.biz>2013-01-14 19:08:13 -0800
commit31753c35b06e7e95ea19b5c00e3d6e0ac8fc47af (patch)
tree68b4675eba51d8558e640cbf7240e5a93ee8350e
parent234871d72733d12fd00540ea6455653a1d0e5b2d (diff)
pass AVScountryCode, 2.05
-rw-r--r--Changes3
-rw-r--r--lib/Business/OnlinePayment/PaymenTech.pm11
2 files changed, 13 insertions, 1 deletions
diff --git a/Changes b/Changes
index 38e9da9..f7554a0 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
Revision history for Business-OnlinePayment-PaymenTech
+2.05 Mon Jan 14 19:07:14 PST 2013
+ - pass AVScountryCode
+
2.04 Mon Oct 11 17:30:00 PDT 2010
- Always send expiration date as MMYY
diff --git a/lib/Business/OnlinePayment/PaymenTech.pm b/lib/Business/OnlinePayment/PaymenTech.pm
index 72fc767..3d060bb 100644
--- a/lib/Business/OnlinePayment/PaymenTech.pm
+++ b/lib/Business/OnlinePayment/PaymenTech.pm
@@ -9,7 +9,7 @@ use vars qw($VERSION $DEBUG @ISA $me);
@ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '2.04';
+$VERSION = '2.05';
$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
$DEBUG = 0;
@@ -42,6 +42,7 @@ tie my %new_order, 'Tie::IxHash', (
AVSaddress1 => [ ':address', 30 ],
AVScity => [ ':city', 20 ],
AVSstate => [ ':state', 2 ],
+ AVScountryCode => [ ':country', 2 ],
OrderID => [ ':invoice_number', 22 ],
Amount => [ ':amount', 12 ],
Comments => [ ':email', 64 ],
@@ -96,6 +97,8 @@ my %currency_code = (
MXN => [484, 2],
);
+my %paymentech_countries = map { $_ => 1 } qw( US CA GB UK );
+
sub set_defaults {
my $self = shift;
@@ -197,6 +200,12 @@ sub map_fields {
$content{expiration} =~ s/\D//g;
$content{expiration} = sprintf('%04d',$content{expiration});
+ $content{country} ||= 'US';
+ $content{country} = ( $paymentech_countries{ $content{country} }
+ ? $content{country}
+ : ''
+ ),
+
$self->content(%content);
return;
}