From 513c2cf250cfd3b9ed5507fded951aa85563de00 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 12 Nov 2012 23:54:48 -0800 Subject: don't send countries other than US/CA/GB/UK to paymentech, RT#20222 --- Paymentech.pm | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'Paymentech.pm') diff --git a/Paymentech.pm b/Paymentech.pm index 7fa2e44..09b5672 100644 --- a/Paymentech.pm +++ b/Paymentech.pm @@ -3,7 +3,7 @@ package Business::BatchPayment::Paymentech; use 5.006; use strict; use warnings; -our $VERSION = '0.01'; +our $VERSION = '0.02'; =head1 NAME @@ -91,6 +91,8 @@ my %BankAcctType = ( 'business savings' => 'X', ); +my %paymentech_countries = map { $_ => 1 } qw( US CA GB UK ); + sub default_transport { my $self = shift; Business::BatchPayment::Paymentech::Transport->new( @@ -168,15 +170,18 @@ sub format_item { die "payment type ".$item->type." not supported"; } push @order, ( - avsZip => $item->zip, - avsAddress1 => substr($item->address, 0, 30), - avsAddress2 => substr($item->address2, 0, 30), - avsCity => substr($item->city, 0, 20), - avsState => $item->state, - avsName => substr($item->first_name .' '. $item->last_name, 0, 30), - avsCountryCode => $item->country, - orderID => $item->tid, - amount => int( $item->amount * 100 ), + avsZip => $item->zip, + avsAddress1 => substr($item->address, 0, 30), + avsAddress2 => substr($item->address2, 0, 30), + avsCity => substr($item->city, 0, 20), + avsState => $item->state, + avsName => substr($item->first_name .' '. $item->last_name, 0, 30), + avsCountryCode => ( $paymentech_countries{ $item->country } + ? $_->country + : '' + ), + orderID => $item->tid, + amount => int( $item->amount * 100 ), ); while (@order) { my $key = shift @order; -- cgit v1.2.1