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.
# 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')
},
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);
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 {
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
: ''