From 5d6d9f2bb7de1d5efa60172d351e7ae64676ddf5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 22 Apr 2014 17:57:25 -0700 Subject: [PATCH] Flag to disable passing AVS and CVV information, so Moneris doesn't error out, and documentation on the behavior change --- Changes | 4 +++- eSelectPlus.pm | 23 +++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index 2ec011a..1a82ae9 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,9 @@ Revision history for Perl extension Business::OnlinePayment::eSelectPlus 0.08 unreleased - - Pass AVS and CVV information + - (0.08_01) Pass AVS and CVV information + - (0.08_02) Flag to disable passing AVS and CVV information, so Moneris + doesn't error out, and documentation on the behavior change 0.07 Wed Aug 21 11:53:36 PDT 2013 - eSelectPlus cust_id: Use customer number instead of invoice number diff --git a/eSelectPlus.pm b/eSelectPlus.pm index b118080..806fb65 100644 --- a/eSelectPlus.pm +++ b/eSelectPlus.pm @@ -8,11 +8,12 @@ use Business::OnlinePayment::HTTPS 0.03; use vars qw($VERSION $DEBUG @ISA); @ISA = qw(Business::OnlinePayment::HTTPS); -$VERSION = '0.08_01'; +$VERSION = '0.08_02'; $DEBUG = 0; sub set_defaults { my $self = shift; + my %opts = @_; #USD #$self->server('esplusqa.moneris.com'); # development @@ -26,8 +27,11 @@ sub set_defaults { $self->port('443'); - $self->build_subs(qw( order_number avs_code )); + $self->build_subs(qw( order_number avs_code skip_avs skip_cvv )); # avs_code order_type md5 cvv2_response cavv_response + + $self->skip_avs( $opts{skip_avs} ); + $self->skip_cvv( $opts{skip_cvv} ); } sub submit { @@ -188,14 +192,14 @@ sub submit { ''. join('', map "<$_>$avs_fields{$_}", keys %avs_fields ). '' - if grep $_, values %avs_fields; + if ! $self->skip_avs && grep $_, values %avs_fields; tie my %cvd_fields, 'Tie::IxHash', $self->get_fields( $self->cvd_fields ); $post_data .= ''. join('', map "<$_>$cvd_fields{$_}", keys %cvd_fields ). '' - if grep $_, values %cvd_fields; + if ! $self->skip_cvv && grep $_, values %cvd_fields; } $post_data .= @@ -431,6 +435,17 @@ so that authorization() and order_number() can return the 2 fields needed for capture. See also cpansearch.perl.org/src/IVAN/Business-OnlinePayment-3.02/notes_for_module_writers_v3 +=head2 Note for upgrading to 0.08 without AVS/CVV enabled with Moneris + +This version now passes AVS and CVV info (previous versions did not). If your +Moneris account is not enabled for these services, you can omit them by passing +the "skip_avs" and/or "skip_cvv" options set to a true value: + + my $tx = new Business::OnlinePayment('eSelectPlus', + 'skip_avs' => 1, + 'skip_cvv' => 1, + ); + =head1 AUTHOR Ivan Kohler -- 2.11.0