示例#1
0
 function _validate_creditcard_data($enqueueMessage = TRUE)
 {
     $html = '';
     $this->_cc_valid = TRUE;
     if (!Creditcard::validate_credit_card_number($this->_cc_type, $this->_cc_number)) {
         $this->_errormessage[] = 'VMPAYMENT_AUTHORIZENET_CARD_NUMBER_INVALID';
         $this->_cc_valid = FALSE;
     }
     if (!Creditcard::validate_credit_card_cvv($this->_cc_type, $this->_cc_cvv)) {
         $this->_errormessage[] = 'VMPAYMENT_AUTHORIZENET_CARD_CVV_INVALID';
         $this->_cc_valid = FALSE;
     }
     if (!Creditcard::validate_credit_card_date($this->_cc_type, $this->_cc_expire_month, $this->_cc_expire_year)) {
         $this->_errormessage[] = 'VMPAYMENT_AUTHORIZENET_CARD_EXPIRATION_DATE_INVALID';
         $this->_cc_valid = FALSE;
     }
     if (!$this->_cc_valid) {
         //$html.= "<ul>";
         foreach ($this->_errormessage as $msg) {
             //$html .= "<li>" . vmText::_($msg) . "</li>";
             $html .= vmText::_($msg) . "<br/>";
         }
         //$html.= "</ul>";
     }
     if (!$this->_cc_valid && $enqueueMessage) {
         $app = JFactory::getApplication();
         $app->enqueueMessage($html);
     }
     return $this->_cc_valid;
 }
示例#2
0
 /**
  * @param bool $enqueueMessage
  * @return bool
  */
 function validateRemoteCCForm($enqueueMessage = true)
 {
     if (!class_exists('Creditcard')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'creditcard.php';
     }
     $html = '';
     $cc_valid = true;
     $errormessages = array();
     $saved_cc_selected = $this->customerData->getVar('saved_cc_selected');
     $cc_type = $this->customerData->getVar('cc_type');
     $cc_number = $this->customerData->getVar('cc_number');
     $cc_name = $this->customerData->getVar('cc_name');
     $cc_cvv = $this->customerData->getVar('cc_cvv');
     $cc_expire_month = $this->customerData->getVar('cc_expire_month');
     $cc_expire_year = $this->customerData->getVar('cc_expire_year');
     if (!Creditcard::validate_credit_card_number($cc_type, $cc_number)) {
         $errormessages[] = 'VMPAYMENT_REALEX_HPP_API_CC_CARD_NUMBER_INVALID';
         $cc_valid = false;
     }
     if ($this->_method->cvn_checking and !Creditcard::validate_credit_card_cvv($cc_type, $cc_cvv, true, $cc_number)) {
         $errormessages[] = 'VMPAYMENT_REALEX_HPP_API_CC_CARD_CVV_INVALID';
         $cc_valid = false;
     }
     if (!Creditcard::validate_credit_card_date($cc_type, $cc_expire_month, $cc_expire_year)) {
         $errormessages[] = 'VMPAYMENT_REALEX_HPP_API_CC_CARD_EXPIRATION_DATE_INVALID';
         $cc_valid = false;
     }
     if (empty($cc_name)) {
         $errormessages[] = 'VMPAYMENT_REALEX_HPP_API_CC_NAME_INVALID';
         $cc_valid = false;
     }
     if (!$cc_valid) {
         foreach ($errormessages as $msg) {
             $html .= vmText::_($msg) . "<br/>";
         }
     }
     if (!$cc_valid) {
         $app = JFactory::getApplication();
         $app->enqueueMessage($html, 'error');
         return false;
     }
     return true;
 }
示例#3
0
 function validate($enqueueMessage = true)
 {
     if (!class_exists('Creditcard')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'creditcard.php';
     }
     $html = '';
     $cc_valid = true;
     $errormessages = array();
     $cc_type = $this->customerData->getVar('cc_type');
     $cc_number = $this->customerData->getVar('cc_number');
     $cc_cvv = $this->customerData->getVar('cc_cvv');
     $cc_expire_month = $this->customerData->getVar('cc_expire_month');
     $cc_expire_year = $this->customerData->getVar('cc_expire_year');
     if (!Creditcard::validate_credit_card_number($cc_type, $cc_number)) {
         $errormessages[] = 'VMPAYMENT_PAYPAL_CC_CARD_NUMBER_INVALID';
         $cc_valid = false;
     }
     if ($this->_method->cvv_required or $cc_type == 'Maestro') {
         $required = true;
     } else {
         $required = false;
     }
     if (!Creditcard::validate_credit_card_cvv($cc_type, $cc_cvv, $required)) {
         $errormessages[] = 'VMPAYMENT_PAYPAL_CC_CARD_CVV_INVALID';
         $cc_valid = false;
     }
     if (!Creditcard::validate_credit_card_date($cc_type, $cc_expire_month, $cc_expire_year)) {
         $errormessages[] = 'VMPAYMENT_PAYPAL_CC_CARD_DATE_INVALID';
         $cc_valid = false;
     }
     if (!$cc_valid) {
         foreach ($errormessages as $msg) {
             $html .= tsmText::_($msg) . "<br/>";
         }
     }
     if (!$cc_valid && $enqueueMessage) {
         $app = JFactory::getApplication();
         $app->enqueueMessage($html, 'error');
     }
     $displayInfoMsg = "";
     if (!$cc_valid) {
         $displayInfoMsg = false;
         return false;
     } else {
         return parent::validate($displayInfoMsg);
     }
 }
 function _validate_velocity_creditcard_data($enqueueMessage = TRUE)
 {
     static $force = true;
     if (empty($this->_cc_number) and empty($this->_cc_cvv)) {
         return false;
     }
     $html = '';
     $this->_cc_valid = !empty($this->_cc_number) and !empty($this->_cc_cvv) and !empty($this->_cc_expire_month) and !empty($this->_cc_expire_year);
     if (!empty($this->_cc_number) and !Creditcard::validate_credit_card_number($this->_cc_type, $this->_cc_number)) {
         $this->_errormessage[] = 'VMPAYMENT_VELOCITY_CARD_NUMBER_INVALID';
         $this->_cc_valid = FALSE;
     }
     if (!Creditcard::validate_credit_card_cvv($this->_cc_type, $this->_cc_cvv)) {
         $this->_errormessage[] = 'VMPAYMENT_VELOCITY_CARD_CVV_INVALID';
         $this->_cc_valid = FALSE;
     }
     if (!Creditcard::validate_credit_card_date($this->_cc_type, $this->_cc_expire_month, $this->_cc_expire_year)) {
         $this->_errormessage[] = 'VMPAYMENT_VELOCITY_CARD_EXPIRATION_DATE_INVALID';
         $this->_cc_valid = FALSE;
     }
     if (!$this->_cc_valid) {
         //$html.= "<ul>";
         foreach ($this->_errormessage as $msg) {
             //$html .= "<li>" . vmText::_($msg) . "</li>";
             $html .= vmText::_($msg) . "<br/>";
         }
         //$html.= "</ul>";
     }
     if (!$this->_cc_valid && $enqueueMessage && $force) {
         $app = JFactory::getApplication();
         $app->enqueueMessage($html);
         $force = false;
     }
     return $this->_cc_valid;
 }
示例#5
0
 /**
  * @param bool $enqueueMessage
  * @return bool
  */
 function validateCvv($enqueueMessage = true)
 {
     if (!class_exists('Creditcard')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'creditcard.php';
     }
     if (!$this->_method->cvn_checking) {
         return true;
     }
     $cc_cvv_realvault = vRequest::getInt('cc_cvv_realvault', '');
     if (!Creditcard::validate_credit_card_cvv('', $cc_cvv_realvault, true)) {
         $app = JFactory::getApplication();
         $app->enqueueMessage(vmText::_('VMPAYMENT_REALEX_HPP_API_CC_CARD_CVV_INVALID'), 'error');
         return false;
     }
     return true;
 }
示例#6
0
 function _validate_creditcard_data($enqueueMessage = true)
 {
     static $force = true;
     $emptyEssentialFields = empty(self::$_cc_number) || empty(self::$_cc_cvv) || empty(self::$_cc_name);
     if ($emptyEssentialFields) {
         return false;
     }
     $html = '';
     $this->_cc_valid = true;
     if (!Creditcard::validate_credit_card_cvv(self::$_cc_type, self::$_cc_cvv)) {
         $this->_errormessage[] = 'VMPAYMENT_EVERYPAY_CARD_CVV_INVALID';
         $this->_cc_valid = false;
     }
     if (!Creditcard::validate_credit_card_date(self::$_cc_type, self::$_cc_expire_month, self::$_cc_expire_year)) {
         $this->_errormessage[] = 'VMPAYMENT_EVERYPAY_CARD_EXPIRATION_DATE_INVALID';
         $this->_cc_valid = false;
     }
     if (!$this->_cc_valid) {
         //$html.= "<ul>";
         foreach ($this->_errormessage as $msg) {
             //$html .= "<li>" . vmText::_($msg) . "</li>";
             $html .= vmText::_($msg) . "<br/>";
         }
         //$html.= "</ul>";
     }
     if (!$this->_cc_valid && $enqueueMessage && $force) {
         $app = JFactory::getApplication();
         $app->enqueueMessage($html);
         $force = false;
     }
     return $this->_cc_valid;
 }