[freeside-commits] branch FREESIDE_3_BRANCH updated. b95a79d19aa66e2488b49b42e1792a8ccf87f1aa

Ivan ivan at 420.am
Fri Apr 25 16:46:53 PDT 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  b95a79d19aa66e2488b49b42e1792a8ccf87f1aa (commit)
      from  4bb41a18e2ad78c1422dca1298a6e6464c38f5fb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b95a79d19aa66e2488b49b42e1792a8ccf87f1aa
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Apr 25 16:46:52 2014 -0700

    only require self-service CVV when using a new card< RT#28486

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index ad882d5..71df0ef 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -989,10 +989,14 @@ sub validate_payment {
    
     $payinfo = $p->{'payinfo'};
 
+    my $onfile = 0;
+
     #more intelligent matching will be needed here if you change
     #card_masking_method and don't remove existing paymasks
-    $payinfo = $cust_main->payinfo
-      if $cust_main->paymask eq $payinfo;
+    if ( $cust_main->paymask eq $payinfo ) {
+      $payinfo = $cust_main->payinfo;
+      $onfile = 1;
+    }
 
     $payinfo =~ s/\D//g;
     $payinfo =~ /^(\d{13,16}|\d{8,9})$/
@@ -1014,7 +1018,7 @@ sub validate_payment {
           or return { 'error' => "CVV2 (CVC2/CID) is three digits." };
         $paycvv = $1;
       }
-    } elsif ( $conf->exists('selfservice-require_cvv') ) { #and you weren't using a card on file?
+    } elsif ( !$onfile && $conf->exists('selfservice-require_cvv') ) {
       return { 'error' => 'CVV2 is required' };
     }
   
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index ac90775..7336a9e 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2677,7 +2677,7 @@ and customer address. Include units.',
   {
     'key'         => 'selfservice-require_cvv',
     'section'     => 'self-service',
-    'description' => 'Require CVV for credit card self-service payments.',
+    'description' => 'Require CVV for credit card self-service payments, except for cards on-file.',
     'type'        => 'checkbox',
   },
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm |   10 +++++++---
 FS/FS/Conf.pm                |    2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list