[freeside-commits] branch master updated. 2c4cf12af441dc22859e30c1474e279499edfa3a

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


The branch, master has been updated
       via  2c4cf12af441dc22859e30c1474e279499edfa3a (commit)
      from  e91ed1c4a81c25757f812b3ec8238645b836b235 (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 2c4cf12af441dc22859e30c1474e279499edfa3a
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Apr 25 16:46:50 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 d4c0d37..c75a56b 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -993,10 +993,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})$/
@@ -1018,7 +1022,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 5919804..59ccd90 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