Subject: | BOP:TCLink does not support CVV |
Attached patch implements fix for Bug ID: 64322
Also adds CVV support, follows responses more along the lines of
BOP::AuthorizeNet
Features added in this patch
Adding of the following fields to processor:
cvv2 : CVV/CVV2 Code
order_number : Transaction ID from previous transaction
invoice_number : Submitters invoice number for tracking in TC
Adding/Changing of the following fields in response from processor:
$tx->authorization : CHANGED - Authorization Code instead of AVS
Response
$tx->avs_code : AVS Response Code
$tx->cvv2_response : CVV Response Code
Adding of the following flags:
$tx->require_cvv(1) now supported
Subject: | BOP.TCLink.patch |
diff -crB Business-OnlinePayment-TCLink-1.03-orig/TCLink.pm Business-OnlinePayment-TCLink-1.03/TCLink.pm
*** Business-OnlinePayment-TCLink-1.03-orig/TCLink.pm Fri Jan 10 15:24:25 2003
--- Business-OnlinePayment-TCLink-1.03/TCLink.pm Thu Dec 30 14:13:49 2010
***************
*** 7,13 ****
require Exporter;
! @ISA = qw(Exporter AutoLoader Business::OnlinePayment);
@EXPORT = qw();
@EXPORT_OK = qw();
$VERSION = '1.03';
--- 7,13 ----
require Exporter;
! @ISA = qw(Exporter Business::OnlinePayment);
@EXPORT = qw();
@EXPORT_OK = qw();
$VERSION = '1.03';
***************
*** 20,26 ****
$self->port('');
$self->path('');
! $self->build_subs('order_number');
}
sub map_fields {
--- 20,26 ----
$self->port('');
$self->path('');
! $self->build_subs('order_number', 'avs_code', 'cvv2_response', 'require_cvv');
}
sub map_fields {
***************
*** 98,104 ****
country => 'country',
phone => 'phone',
email => 'email',
! order_number => 'transid'
);
if($self->transaction_type() eq "ach") {
--- 98,106 ----
country => 'country',
phone => 'phone',
email => 'email',
! order_number => 'transid',
! cvv2 => 'cvv',
! invoice_number => 'purchaseordernum'
);
if($self->transaction_type() eq "ach") {
***************
*** 120,128 ****
my %params = $self->get_fields(qw/media custid password action amount
first_name last_name address1 city state
zip cc exp account routing country phone
! email transid/);
$params{'demo'} = $self->test_transaction() ? 'y' : 'n';
$params{'avs'} = $self->require_avs() ? 'y' : 'n';
$params{'name'} = $params{'first_name'} . ' ' . $params{'last_name'};
delete $params{'first_name'};
delete $params{'last_name'};
--- 122,131 ----
my %params = $self->get_fields(qw/media custid password action amount
first_name last_name address1 city state
zip cc exp account routing country phone
! email transid cvv purchaseordernum/);
$params{'demo'} = $self->test_transaction() ? 'y' : 'n';
$params{'avs'} = $self->require_avs() ? 'y' : 'n';
+ $params{'checkcvv'} = $self->require_cvv() ? 'y' : 'n';
$params{'name'} = $params{'first_name'} . ' ' . $params{'last_name'};
delete $params{'first_name'};
delete $params{'last_name'};
***************
*** 130,143 ****
$params{'cc'} =~ s/\D//g;
$params{'exp'} =~ s/\D//g;
$params{'exp'} = '0' . $params{'exp'} if length($params{'exp'}) == 3;
my %results = Net::TCLink::send(\%params);
if($results{'status'} eq 'approved' or $results{'status'} eq 'accepted') {
$self->is_success(1);
$self->result_code($results{'status'});
! $self->authorization($results{'avs'});
$self->order_number($results{'transid'});
} else {
$self->is_success(0);
$self->result_code($results{'status'});
--- 133,149 ----
$params{'cc'} =~ s/\D//g;
$params{'exp'} =~ s/\D//g;
$params{'exp'} = '0' . $params{'exp'} if length($params{'exp'}) == 3;
+ $params{'cvv'} =~ s/\D//g;
my %results = Net::TCLink::send(\%params);
if($results{'status'} eq 'approved' or $results{'status'} eq 'accepted') {
$self->is_success(1);
$self->result_code($results{'status'});
! $self->authorization($results{'authcode'});
! $self->avs_code($results{'avs'});
$self->order_number($results{'transid'});
+ $self->cvv2_response($results{'cvv'});
} else {
$self->is_success(0);
$self->result_code($results{'status'});
***************
*** 184,189 ****
--- 190,196 ----
zip => '84058',
card_number => '4111111111111111',
expiration => '09/05',
+ cvv2 => '123'
);
$tx->submit();
***************
*** 199,204 ****
--- 206,215 ----
Carte Blanche, Japan Card, Enroute, CC
Content required: type, login, password, action, amount, first_name, last_name, card_number, expiration.
+ Optional content: cvv2, invoice_number.
+
+ To fail on CVV failure: $tx->require_cvv(1);
+ To fail on AVS failure: $tx->require_avs(1);
=head2 Check