use vars qw($VERSION $DEBUG @ISA $me);
@ISA = qw(Business::OnlinePayment::HTTPS);
-$DEBUG = 0;
+$DEBUG = 3;
$VERSION = '0.01';
$me = 'Business::OnlinePayment::vSecureProcessing';
$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};
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'} : '',
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 /);
}
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
$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})) {