summaryrefslogtreecommitdiff
path: root/Paymentech.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Paymentech.pm')
-rw-r--r--Paymentech.pm25
1 files changed, 15 insertions, 10 deletions
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;