diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-01-14 19:23:56 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-01-14 19:23:56 -0800 |
commit | 8c67441ae837ff8d99d47239d5b5562ff310bd3f (patch) | |
tree | 6033e4d100c651ab35f45f71189e463261932803 /Paymentech.pm | |
parent | 513c2cf250cfd3b9ed5507fded951aa85563de00 (diff) |
truncate state to 2 characters
Diffstat (limited to 'Paymentech.pm')
-rw-r--r-- | Paymentech.pm | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/Paymentech.pm b/Paymentech.pm index 09b5672..fd3f4ae 100644 --- a/Paymentech.pm +++ b/Paymentech.pm @@ -3,16 +3,12 @@ package Business::BatchPayment::Paymentech; use 5.006; use strict; use warnings; -our $VERSION = '0.02'; +our $VERSION = '0.03'; =head1 NAME Business::BatchPayment::Paymentech - Chase Paymentech XML batch format. -=head1 VERSION - -Version 0.01 - =head1 USAGE See L<Business::BatchPayment> for general usage notes. @@ -71,14 +67,14 @@ with 'Business::BatchPayment::TestMode'; # could have some validation on all of these has [ qw(merchantID terminalID bin industryType login password) ] => ( - is => 'ro', - isa => 'Str', + is => 'ro', + isa => 'Str', required => 1, ); has 'fileDateTime' => ( - is => 'ro', - isa => 'Str', + is => 'ro', + isa => 'Str', default => sub { DateTime->now->strftime('%Y%m%d%H%M%S') }, @@ -110,8 +106,8 @@ sub format_request { my $output; my $xml = XML::Writer->new( - OUTPUT => \$output, - DATA_MODE => 1, + OUTPUT => \$output, + DATA_MODE => 1, DATA_INDENT => 2, ); $self->format_header($batch, $xml); @@ -145,25 +141,25 @@ sub format_item { if ( $item->action eq 'payment' ) { $xml->startTag('newOrder', BatchRequestNo => $count); my @order = ( - industryType => $self->industryType, - transType => 'AC', - bin => $self->bin, - merchantID => $self->merchantID, - terminalID => $self->terminalID, + industryType => $self->industryType, + transType => 'AC', + bin => $self->bin, + merchantID => $self->merchantID, + terminalID => $self->terminalID, ); if ($item->payment_type eq 'CC') { push @order, ( - ccAccountNum => $item->card_number, - ccExp => $item->expiration, + ccAccountNum => $item->card_number, + ccExp => $item->expiration, ); } elsif ( $item->payment_type eq 'ECHECK' ) { push @order, ( - cardBrand => 'EC', - ecpCheckRT => $item->routing_code, - ecpCheckDDA => $item->account_number, + cardBrand => 'EC', + ecpCheckRT => $item->routing_code, + ecpCheckDDA => $item->account_number, ecpBankAcctType => $BankAcctType{ $item->account_type }, - ecpDelvMethod => 'A', + ecpDelvMethod => 'A', ); } else { @@ -174,8 +170,8 @@ sub format_item { 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), + avsState => substr($item->state, 0, 2), + avsName => substr($item->first_name. ' '. $item->last_name, 0, 30), avsCountryCode => ( $paymentech_countries{ $item->country } ? $_->country : '' |