From: Alex Brelsfoard Date: Tue, 10 Feb 2015 23:44:53 +0000 (-0500) Subject: Updating GIT with last bit of changes. X-Git-Url: http://git.freeside.biz/gitweb/?p=Business-OnlinePayment-vSecureProcessing.git;a=commitdiff_plain;h=59dc9c0128f8c9258c9ec80f11754dd1e7ecf26e Updating GIT with last bit of changes. --- diff --git a/extra/libbusiness-onlinepayment-vsecureprocessing-perl_0.01-1_all.deb b/extra/libbusiness-onlinepayment-vsecureprocessing-perl_0.01-1_all.deb index d6d02de..d9edcf2 100644 Binary files a/extra/libbusiness-onlinepayment-vsecureprocessing-perl_0.01-1_all.deb and b/extra/libbusiness-onlinepayment-vsecureprocessing-perl_0.01-1_all.deb differ diff --git a/lib/Business/OnlinePayment/vSecureProcessing.pm b/lib/Business/OnlinePayment/vSecureProcessing.pm index f957aa9..872e4ca 100644 --- a/lib/Business/OnlinePayment/vSecureProcessing.pm +++ b/lib/Business/OnlinePayment/vSecureProcessing.pm @@ -12,7 +12,7 @@ use Business::OnlinePayment::HTTPS; use vars qw($VERSION $DEBUG @ISA $me); @ISA = qw(Business::OnlinePayment::HTTPS); -$DEBUG = 0; +$DEBUG = 3; $VERSION = '0.01'; $me = 'Business::OnlinePayment::vSecureProcessing'; @@ -128,6 +128,10 @@ sub clean_content { $content{card_number} =~ s/\D//g; } + if ($content{'description'} && length($content{'description'}) >20) { + $content{'description'} = substr($content{'description'},0,20); + } + # separate month and year values for expiry_date if ( $content{expiration} ) { ($content{exp_month}, $content{exp_year}) = split /\//, $content{expiration}; @@ -203,10 +207,10 @@ sub submit { CardHolderLastName => ($content{'last_name'}) ? $content{'last_name'} : '', AvsZip => ($content{'zip'}) ? $content{'zip'} : '', AvsStreet => ($content{'street_number'}) ? $content{'street_number'} : '', - IndustryType => { - IndType => ($content{'IndustryInfo'} && lc($content{'IndustryInfo'}) eq 'ecommerce') ? 'ecom_3' : '', - IndInvoice => ($content{'invoice_number'}) ? $content{'invoice_number'} : '' - }, +# IndustryType => { +# IndType => ($content{'IndustryInfo'} && lc($content{'IndustryInfo'}) eq 'ecommerce') ? 'ecom_3' : '', +# IndInvoice => ($content{'invoice_number'}) ? $content{'invoice_number'} : '' +# }, ApplicationId => $self->appid(), Recurring => ($content{'recurring_billing'} && $content{'recurring_billing'} eq 'YES' ) ? 1 : 0, ReferenceNumber => ($content{'ref_num'}) ? $content{'ref_num'} : '', @@ -222,7 +226,7 @@ sub submit { if ($action eq 'charge') { push(@required_fields, $_) foreach (qw/ AccountNumber Cvv ExpirationMonth ExpirationYear /); }elsif ($action eq 'void') { - push(@required_fields, $_) foreach (qw/ ReferenceNumber TransactionDate /); + push(@required_fields, $_) foreach (qw/ ReferenceNumber /); }elsif ($action eq 'refund') { push(@required_fields, $_) foreach (qw/ Amount AccountNumber ExpirationMonth ExpirationYear /); } @@ -324,6 +328,7 @@ sub parse_response { if ($self->server_response =~ /^200/) { my $response = XMLin($page); + warn "Response:\n".Dumper($response)."\n" if $DEBUG > 2; $self->result_code($response->{Status}); # 0 /1 $self->response_code($response->{ResponseCode}); # see documentation for translation $self->avs_response($response->{AvsResponse}); # Y / N @@ -334,7 +339,7 @@ sub parse_response { $self->is_success($self->result_code() eq '0' ? 1 : 0); if ($self->is_success()) { - $self->authorization($response->{AuthIdentificationResponse}); + $self->authorization($response->{ReferenceNumber}); } # fill in error_message if there is is an error if ( !$self->is_success && exists($response->{AdditionalResponseData})) {