X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=LinkPoint.pm;h=c4f7d18034cf28d1d62faded56e2de5d3029014f;hb=659e4504588f68d5adca8c81001462a7e74e4d6c;hp=70b62535797a5940ace321a72f8b3fe28f95231d;hpb=196db498d6a75d4a772946049fbaee6b4700dd85;p=Business-OnlinePayment-LinkPoint.git diff --git a/LinkPoint.pm b/LinkPoint.pm index 70b6253..c4f7d18 100644 --- a/LinkPoint.pm +++ b/LinkPoint.pm @@ -6,7 +6,8 @@ use Carp qw(croak); use Business::OnlinePayment; @ISA = qw(Business::OnlinePayment); -$VERSION = '0.08'; +$VERSION = '0.10_01'; +$VERSION = eval $VERSION; # modperlstyle: convert the string into a number $DEBUG = 0; use lpperl; #3; #lpperl.pm from LinkPoint @@ -134,10 +135,15 @@ sub submit { $result ||= 'LIVE'; } - #docs disagree with lpperl.pm here - $content{'voidcheck'} = 1 - if ($self->transaction_type() =~ /^e?check$/i - && $content{'action'} =~ /^VOID$/); + #strip phone numbers of non-digits for ACH/echeck + #as per undocumented suggestion from LinkPoint + if ( $self->transaction_type =~ /^e?check$/i ) { + foreach my $field (qw( phone fax )) { + $content{$field} =~ s/\D//g; + } + } + # stuff it back into %content + $self->content(%content); $self->revmap_fields( host => \( $self->server ), @@ -194,6 +200,11 @@ sub submit { $post_data{'ordertype'} = $content{action}; + #docs disagree with lpperl.pm here + $post_data{'voidcheck'} = 1 + if $self->transaction_type() =~ /^e?check$/i + && $post_data{'ordertype'} =~ /^VOID$/; + if ( $content{'cvv2'} ) { $post_data{cvmindicator} = 'provided'; $post_data{cvmvalue} = $content{'cvv2'}; @@ -220,7 +231,12 @@ sub submit { warn "$_ => $response{$_}\n" for keys %response; } - if ( $response{'r_approved'} eq 'APPROVED' ) { + if ( $response{'r_approved'} eq 'APPROVED' + or ( $self->transaction_type() =~ /^e?check$/i + && $response{'r_approved'} eq 'SUBMITTED' + ) + ) + { $self->is_success(1); $self->result_code($response{'r_code'}); $self->authorization($response{'r_ref'});