X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=LinkPoint.pm;h=84ea74ef2afde7139f6a63e4dbddd2af5deb5465;hb=fc1c50ec369553974c7ea4cef4419003d41067ee;hp=71015f776a8c1745a030643fdf6b8673069919dc;hpb=bae4cd5aaec29c73eeff2250ec21af5d46d2fe9d;p=Business-OnlinePayment-LinkPoint.git diff --git a/LinkPoint.pm b/LinkPoint.pm index 71015f7..84ea74e 100644 --- a/LinkPoint.pm +++ b/LinkPoint.pm @@ -1,6 +1,6 @@ package Business::OnlinePayment::LinkPoint; -# $Id: LinkPoint.pm,v 1.25 2007-04-05 23:12:06 jeff Exp $ +# $Id: LinkPoint.pm,v 1.28 2007-05-01 21:37:17 jeff Exp $ use strict; use vars qw($VERSION @ISA $DEBUG @EXPORT @EXPORT_OK); @@ -13,7 +13,7 @@ require Exporter; @ISA = qw(Exporter AutoLoader Business::OnlinePayment); @EXPORT = qw(); @EXPORT_OK = qw(); -$VERSION = '0.06'; +$VERSION = '0.08'; $DEBUG = 0; use lpperl; #3; #lpperl.pm from LinkPoint @@ -46,6 +46,15 @@ sub map_fields { ); $content{'action'} = $actions{lc($content{'action'})} || $content{'action'}; + #ACCOUNT TYPE MAP + my %account_types = ('personal checking' => 'pc', + 'personal savings' => 'ps', + 'business checking' => 'bc', + 'business savings' => 'bs', + ); + $content{'account_type'} = $account_types{lc($content{'account_type'})} + || $content{'account_type'}; + # stuff it back into %content $self->content(%content); } @@ -103,7 +112,7 @@ sub submit { unless ( $content{action} eq 'POSTAUTH' || ( $content{'action'} =~ /^(CREDIT|VOID)$/ && exists $content{'order_number'} ) - || $self->transaction_type() =~ /^check$/i + || $self->transaction_type() =~ /^e?check$/i ) { if ( $self->transaction_type() =~ @@ -134,7 +143,7 @@ sub submit { #docs disagree with lpperl.pm here $content{'voidcheck'} = 1 - if ($self->transaction_type() =~ /^check$/i + if ($self->transaction_type() =~ /^e?check$/i && $content{'action'} =~ /^VOID$/); $self->revmap_fields( @@ -151,6 +160,7 @@ sub submit { chargetotal => 'amount', oid => 'order_number', bankname => 'bank_name', + bankstate => 'bank_state', routing => 'routing_code', account => 'account_number', accounttype => 'account_type', @@ -164,7 +174,7 @@ sub submit { my @required_fields = qw(host port configfile keyfile amount); if ($self->transaction_type() =~ /^(cc|visa|mastercard|american express|discover)$/i) { push @required_fields, qw(cardnumber cardexpmonth cardexpyear); - }elsif ($self->transaction_type() =~ /^check$/i) { + }elsif ($self->transaction_type() =~ /^e?check$/i) { push @required_fields, qw( dl dlstate routing account accounttype bankname bankstate name ); @@ -212,7 +222,9 @@ sub submit { } else { $self->is_success(0); $self->result_code(''); - $self->error_message($response{'r_error'}); + $response{'r_error'} =~/\S/ + ? $self->error_message($response{'r_error'}) + : $self->error_message($response{'r_approved'}); # no r_error for checks } }