diff options
-rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 10 | ||||
-rw-r--r-- | FS/FS/Conf.pm | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index d4c0d3723..c75a56b17 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 59198045d..59ccd90ab 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', }, |