Skip to content

Commit

Permalink
CRM-20166: Making CVV always required for front-end contribution pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
agilewarealok committed Nov 6, 2017
1 parent 6995213 commit 8e88d12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CRM/Core/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ protected function getDirectDebitFormFields() {
public function getPaymentFormFieldsMetadata() {
//@todo convert credit card type into an option value
$creditCardType = array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::creditCard();
$isCVVRequired = Civi::settings()->get('cvv_backoffice_required');
if (!$this->isBackOffice()) {
$isCVVRequired = TRUE;
}
return array(
'credit_card_number' => array(
'htmlType' => 'text',
Expand All @@ -686,7 +690,7 @@ public function getPaymentFormFieldsMetadata() {
'maxlength' => 10,
'autocomplete' => 'off',
),
'is_required' => Civi::settings()->get('cvv_backoffice_required'),
'is_required' => $isCVVRequired,
'rules' => array(
array(
'rule_message' => ts('Please enter a valid value for your card security code. This is usually the last 3-4 digits on the card\'s signature panel.'),
Expand Down

0 comments on commit 8e88d12

Please sign in to comment.