package Business::OnlinePayment::LinkPoint;
-# $Id: LinkPoint.pm,v 1.23 2005-01-07 02:53:50 ivan Exp $
+# $Id: LinkPoint.pm,v 1.24 2007-04-05 22:59:27 jeff Exp $
use strict;
use vars qw($VERSION @ISA $DEBUG @EXPORT @EXPORT_OK);
@ISA = qw(Exporter AutoLoader Business::OnlinePayment);
@EXPORT = qw();
@EXPORT_OK = qw();
-$VERSION = '0.05';
-$DEBUG = 0;
+$VERSION = '0.06';
+$DEBUG = 1;
use lpperl; #3; #lpperl.pm from LinkPoint
$LPPERL::VERSION =~ /^(\d+\.\d+)/
unless ( $content{action} eq 'POSTAUTH'
|| ( $content{'action'} =~ /^(CREDIT|VOID)$/
&& exists $content{'order_number'} )
+ || $self->transaction_type() =~ /^check$/i
) {
if ( $self->transaction_type() =~
$result ||= 'LIVE';
}
+ #docs disagree with lpperl.pm here
+ $content{'voidcheck'} = 1
+ if ($self->transaction_type() =~ /^check$/i
+ && $content{'action'} =~ /^VOID$/);
+
$self->revmap_fields(
host => \( $self->server ),
port => \( $self->port ),
cardexpyear => \$year,
chargetotal => 'amount',
oid => 'order_number',
+ bankname => 'bank_name',
+ routing => 'routing_code',
+ account => 'account_number',
+ accounttype => 'account_type',
+ name => 'account_name',
+ dl => 'state_id',
+ dlstate => 'state_id_state',
);
my $lperl = new LPPERL;
- $self->required_fields(qw/
- host port configfile keyfile amount cardnumber cardexpmonth cardexpyear
- /);
+ 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) {
+ push @required_fields, qw(
+ dl dlstate routing account accounttype bankname bankstate name
+ );
+ }
+ $self->required_fields(@required_fields);
my %post_data = $self->get_fields(qw/
host port configfile keyfile
chargetotal cardnumber cardexpmonth cardexpyear
name email phone addrnum city state zip country
oid
+ dl dlstate routing account accounttype bankname bankstate name void
+
/);
$post_data{'ordertype'} = $content{action};