当前位置: 首页>>代码示例>>PHP>>正文


PHP cc_validation类代码示例

本文整理汇总了PHP中cc_validation的典型用法代码示例。如果您正苦于以下问题:PHP cc_validation类的具体用法?PHP cc_validation怎么用?PHP cc_validation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了cc_validation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pre_confirmation_check

 function pre_confirmation_check()
 {
     if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
         include 'includes/classes/cc_validation.php';
         $cc_validation = new cc_validation();
         $result = $cc_validation->validate($_POST['psigate_cc_number'], $_POST['psigate_cc_expires_month'], $_POST['psigate_cc_expires_year']);
         $error = '';
         switch ($result) {
             case -1:
                 $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
                 break;
             case -2:
             case -3:
             case -4:
                 $error = TEXT_CCVAL_ERROR_INVALID_DATE;
                 break;
             case false:
                 $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
                 break;
         }
         if ($result == false || $result < 1) {
             $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&psigate_cc_owner=' . urlencode($_POST['psigate_cc_owner']) . '&psigate_cc_expires_month=' . $_POST['psigate_cc_expires_month'] . '&psigate_cc_expires_year=' . $_POST['psigate_cc_expires_year'];
             tep_redirect(tep_href_link('checkout_payment.php', $payment_error_return, 'SSL', true, false));
         }
         $this->cc_card_type = $cc_validation->cc_type;
         $this->cc_card_number = $cc_validation->cc_number;
         $this->cc_expiry_month = $cc_validation->cc_expiry_month;
         $this->cc_expiry_year = $cc_validation->cc_expiry_year;
     } else {
         return false;
     }
 }
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:32,代码来源:psigate.php

示例2: pre_confirmation_check

 function pre_confirmation_check()
 {
     global $HTTP_POST_VARS;
     include DIR_WS_CLASSES . 'cc_validation.php';
     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($HTTP_POST_VARS['ipayment_cc_number'], $HTTP_POST_VARS['ipayment_cc_expires_month'], $HTTP_POST_VARS['ipayment_cc_expires_year']);
     $error = '';
     switch ($result) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     if ($result == false || $result < 1) {
         $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&ipayment_cc_owner=' . urlencode($HTTP_POST_VARS['ipayment_cc_owner']) . '&ipayment_cc_expires_month=' . $HTTP_POST_VARS['ipayment_cc_expires_month'] . '&ipayment_cc_expires_year=' . $HTTP_POST_VARS['ipayment_cc_expires_year'] . '&ipayment_cc_checkcode=' . $HTTP_POST_VARS['ipayment_cc_checkcode'];
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
     }
     $this->cc_card_type = $cc_validation->cc_type;
     $this->cc_card_number = $cc_validation->cc_number;
     $this->cc_expiry_month = $cc_validation->cc_expiry_month;
     $this->cc_expiry_year = $cc_validation->cc_expiry_year;
 }
开发者ID:rongandat,项目名称:scalaprj,代码行数:29,代码来源:ipayment.php

示例3: pre_confirmation_check

 public function pre_confirmation_check()
 {
     global $messageStack;
     include DIR_WS_CLASSES . 'cc_validation.php';
     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($_POST['checkoutapipayment_cc_number'], $_POST['checkoutapipayment_cc_expires_month'], $_POST['checkoutapipayment_cc_expires_year']);
     $error = '';
     switch ($result) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     if ($result == false || $result < 1) {
         $messageStack->add_session('checkout_payment', $error . '<!-- [' . $this->code . '] -->', 'error');
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
     }
     $this->cc_card_type = $cc_validation->cc_type;
     $this->cc_card_number = $cc_validation->cc_number;
     $this->cc_expiry_month = $cc_validation->cc_expiry_month;
     $this->cc_expiry_year = $cc_validation->cc_expiry_year;
 }
开发者ID:avish-bisbeehurry-cko,项目名称:checkout-zencart-plugin,代码行数:29,代码来源:creditcardpci.php

示例4: pre_confirmation_check

 function pre_confirmation_check()
 {
     include_once DIR_WS_CLASSES . 'cc_validation.php';
     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($_POST['pm_2checkout_cc_number'], $_POST['pm_2checkout_cc_expires_month'], $_POST['pm_2checkout_cc_expires_year']);
     $error = EMPTY_STRING;
     switch ($result) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     if ($result == false || $result < 1) {
         $this->cc_card_type = $cc_validation->cc_type;
         $this->cc_card_number = $cc_validation->cc_number;
         $this->cc_expiry_month = $cc_validation->cc_expiry_month;
         $this->cc_expiry_year = $cc_validation->cc_expiry_year;
         if (USE_AJAX) {
             ajax_error($error);
         } else {
             $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&pm_2checkout_cc_owner_firstname=' . urlencode($_POST['pm_2checkout_cc_owner_firstname']) . '&pm_2checkout_cc_owner_lastname=' . urlencode($_POST['pm_2checkout_cc_owner_lastname']) . '&pm_2checkout_cc_expires_month=' . $_POST['pm_2checkout_cc_expires_month'] . '&pm_2checkout_cc_expires_year=' . $_POST['pm_2checkout_cc_expires_year'];
             olc_redirect(olc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, SSL, true, false));
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:32,代码来源:pm2checkout.php

示例5: verifyPayment

 function verifyPayment(&$pPaymentParameters, &$pOrder)
 {
     global $_POST;
     include DIR_WS_CLASSES . 'cc_validation.php';
     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($_POST['authorizenet_aim_cc_number'], $_POST['authorizenet_aim_cc_expires_month'], $_POST['authorizenet_aim_cc_expires_year'], $_POST['authorizenet_aim_cc_cvv']);
     $error = '';
     switch ($result) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     if ($result == false || $result < 1) {
         $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&authorizenet_aim_cc_owner=' . urlencode($_POST['authorizenet_aim_cc_owner']) . '&authorizenet_aim_cc_expires_month=' . $_POST['authorizenet_aim_cc_expires_month'] . '&authorizenet_aim_cc_expires_year=' . $_POST['authorizenet_aim_cc_expires_year'];
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
     }
     $this->cc_type = $cc_validation->cc_type;
     $this->cc_number = $cc_validation->cc_number;
     $this->cc_expires_month = $cc_validation->cc_expires_month;
     $this->cc_expires_year = $cc_validation->cc_expires_year;
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:29,代码来源:authorizenet_aim.php

示例6: pre_confirmation_check

 function pre_confirmation_check()
 {
     global $db, $messageStack;
     include DIR_WS_CLASSES . 'cc_validation.php';
     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($_POST['linkpoint_api_cc_number'], $_POST['linkpoint_api_cc_expires_month'], $_POST['linkpoint_api_cc_expires_year']);
     $error = '';
     switch ($result) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     // save record of errors which occur during checkout_payment validation phase but haven't been sent to gateway yet
     if ($result == false || $result < 1) {
         $payment_error_return = 'payment_error=' . $this->code;
         $error_info2 = '&error=' . urlencode($error) . '&linkpoint_api_cc_owner=' . urlencode($_POST['linkpoint_api_cc_owner']) . '&linkpoint_api_cc_expires_month=' . $_POST['linkpoint_api_cc_expires_month'] . '&linkpoint_api_cc_expires_year=' . $_POST['linkpoint_api_cc_expires_year'];
         $messageStack->add_session('checkout_payment', $error . '<!-- [' . $this->code . '] -->', 'error');
         if (MODULE_PAYMENT_LINKPOINT_API_STORE_DATA == 'True') {
             $cc_type = $cc_validation->cc_type;
             $cc_number_clean = $cc_validation->cc_number;
             $cc_expiry_month = $_POST['linkpoint_api_cc_expires_month'];
             $cc_expiry_year = $_POST['linkpoint_api_cc_expires_year'];
             $error_returned = $payment_error_return . $error_info2;
             $cc_number = strlen($cc_number_clean) > 8 ? substr($cc_number_clean, 0, 4) . str_repeat('X', strlen($cc_number_clean) - 8) . substr($cc_number_clean, -4) : substr($cc_number_clean, 0, 3) . '**short**';
             while (strstr($error_returned, '%3A')) {
                 $error_returned = str_replace('%3A', ' ', $error_returned);
             }
             while (strstr($error_returned, '%2C')) {
                 $error_returned = str_replace('%2C', ' ', $error_returned);
             }
             while (strstr($error_returned, '+')) {
                 $error_returned = str_replace('+', ' ', $error_returned);
             }
             $error_returned = str_replace('&', ' &amp;', $error_returned);
             $cust_info = $error_returned;
             $message = addslashes($message);
             $cust_info = addslashes($cust_info);
             $all_response_info = addslashes($all_response_info);
             //  Store Transaction history in Database
             $sql_data_array = array(array('fieldName' => 'lp_trans_num', 'value' => '', 'type' => 'string'), array('fieldName' => 'order_id', 'value' => 0, 'type' => 'integer'), array('fieldName' => 'approval_code', 'value' => 'N/A', 'type' => 'string'), array('fieldName' => 'transaction_response_time', 'value' => 'N/A', 'type' => 'string'), array('fieldName' => 'r_error', 'value' => '**CC Info Failed Validation during pre-processing**', 'type' => 'string'), array('fieldName' => 'customer_id', 'value' => $_SESSION['customer_id'], 'type' => 'integer'), array('fieldName' => 'avs_response', 'value' => '', 'type' => 'string'), array('fieldName' => 'transaction_result', 'value' => '*CUSTOMER ERROR*', 'type' => 'string'), array('fieldName' => 'message', 'value' => $message . ' -- ' . $all_response_info, 'type' => 'string'), array('fieldName' => 'transaction_time', 'value' => time(), 'type' => 'string'), array('fieldName' => 'transaction_reference_number', 'value' => '', 'type' => 'string'), array('fieldName' => 'fraud_score', 'value' => 0, 'type' => 'integer'), array('fieldName' => 'cc_number', 'value' => $cc_number, 'type' => 'string'), array('fieldName' => 'cust_info', 'value' => $cust_info, 'type' => 'string'), array('fieldName' => 'chargetotal', 'value' => 0, 'type' => 'string'), array('fieldName' => 'cc_expire', 'value' => $cc_month . '/' . $cc_year, 'type' => 'string'), array('fieldName' => 'ordertype', 'value' => 'N/A', 'type' => 'string'), array('fieldName' => 'date_added', 'value' => 'now()', 'type' => 'noquotestring'));
             $db->perform(TABLE_LINKPOINT_API, $sql_data_array);
         }
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
     }
     // if no error, continue with validated data:
     $this->cc_card_type = $cc_validation->cc_type;
     $this->cc_card_number = $cc_validation->cc_number;
     $this->cc_expiry_month = $cc_validation->cc_expiry_month;
     $this->cc_expiry_year = $cc_validation->cc_expiry_year;
 }
开发者ID:kirkbauer2,项目名称:kirkzc,代码行数:58,代码来源:linkpoint_api.php

示例7: pre_confirmation_check

    function pre_confirmation_check() {
      global $_POST, $cvv;

      if ((MODULE_PAYMENT_PLUGNPAY_PAYMETHOD == 'onlinecheck') && ($_POST['plugnpay_paytype'] != 'credit_card')) {
        $this->plugnpay_paytype = $_POST['plugnpay_paytype'];
        $this->echeck_accttype = $_POST['plugnpay_echeck_accttype'];
        $this->echeck_accountnum = $_POST['plugnpay_echeck_accountnum'];
        $this->echeck_routingnum = $_POST['plugnpay_echeck_routingnum'];
        $this->echeck_checknum = $_POST['plugnpay_echeck_checknum'];
      }
      else {
        # Note: section assumes the payment method is credit card
        include(dirname(__FILE__).'/../classes/cc_validation.php');
        $cc_validation = new cc_validation();
        $result = $cc_validation->validate($_POST['plugnpay_cc_number'], $_POST['plugnpay_cc_expires_month'], $_POST['plugnpay_cc_expires_year'], $_POST['cvv'], $_POST['credit_card_type']);
        
        $error = '';
        echo $result;
        
        switch ($result) {
          case -1:
            $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
            break;
          case -2:
          case -3:
          case -4:
            $error = TEXT_CCVAL_ERROR_INVALID_DATE;
            break;
          case -5:
            $error = TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH;
            break;
          case -6;
            $error = TEXT_CCVAL_ERROR_CVV_LENGTH;
            break; 
          case false:
            $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
            break;
        }
      if ( ($result == false) || ($result < 1) ) {
        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&authorizenet_cc_owner=' . urlencode($_POST['authorizenet_cc_owner']) . '&authorizenet_cc_expires_month=' . $_POST['authorizenet_cc_expires_month'] . '&authorizenet_cc_expires_year=' . $_POST['authorizenet_cc_expires_year'];
		$payment_error_return .= '&amount=' . $_POST['amount'].'&item_name=' . $_POST['item_name'].'&item_number=' . $_POST['item_number'];
		$payment_error_return .= '&item_id='.$_POST['item_id'].'&item_type='.$_POST['item_type'];
        tep_redirect(tep_href_link("checkout_payment.php", $payment_error_return, 'SSL', true, false));
      }

        $this->cc_card_type = $cc_validation->cc_type;
        $this->cc_card_number = $cc_validation->cc_number;
        $this->cc_expiry_month = $cc_validation->cc_expiry_month;
        $this->cc_expiry_year = $cc_validation->cc_expiry_year;
        $card_cvv = $_POST['cvv'];
      }
    }
开发者ID:nixonch,项目名称:a2billing,代码行数:52,代码来源:plugnpay.php

示例8: pre_confirmation_check

    function pre_confirmation_check() {
      global $aLang;

      include 'includes/classes/class_cc_validation.php';

      $cc_validation = new cc_validation();
      $result = $cc_validation->validate($_POST['ipayment_cc_number'], $_POST['ipayment_cc_expires_month'], $_POST['ipayment_cc_expires_year']);

      $error = '';
      switch ($result) {
        case -1:
          $error = sprintf($aLang['text_ccval_error_unknown_card'], substr($cc_validation->cc_number, 0, 4));
          break;
        case -2:
        case -3:
        case -4:
          $error = $aLang['text_ccval_error_invalid_date'];
          break;
        case false:
          $error = $aLang['text_ccval_error_invalid_number'];
          break;
      }

      if ( ($result == false) || ($result < 1) ) {
        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&ipayment_cc_owner=' . urlencode($_POST['ipayment_cc_owner']) . '&ipayment_cc_expires_month=' . $_POST['ipayment_cc_expires_month'] . '&ipayment_cc_expires_year=' . $_POST['ipayment_cc_expires_year'] . '&ipayment_cc_checkcode=' . $_POST['ipayment_cc_checkcode'];

        $aPages = oos_get_pages();
        MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_payment'], $payment_error_return, 'SSL', true, false));
      }

      $this->cc_card_type = $cc_validation->cc_type;
      $this->cc_card_number = $cc_validation->cc_number;
      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
    }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:35,代码来源:ipayment.php

示例9: pre_confirmation_check

 function pre_confirmation_check()
 {
     global $_POST, $paypal_ec_token, $paypal_ec_payer_id, $paypal_ec_payer_info;
     //If this is an EC checkout, do nuttin'
     if ($this->is_paypal_process()) {
         return false;
     } else {
         include DIR_WS_CLASSES . 'cc_validation.php';
         $cc_validation = new cc_validation();
         $result = $cc_validation->validate($_POST['paypalwpp_cc_number'], $_POST['paypalwpp_cc_expires_month'], $_POST['paypalwpp_cc_expires_year']);
         $error = EMPTY_STRING;
         switch ($result) {
             case -1:
                 $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
                 break;
             case -2:
             case -3:
             case -4:
                 $error = TEXT_CCVAL_ERROR_INVALID_DATE;
                 break;
             case false:
                 $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
                 break;
         }
         $_POST['paypalwpp_cc_checkcode'] = preg_replace('/[^0-9]/i', EMPTY_STRING, $_POST['paypalwpp_cc_checkcode']);
         if ($result == false || $result < 1) {
             $this->away_with_you(MODULE_PAYMENT_PAYPAL_DP_TEXT_CARD_ERROR . '<br/><br/>' . $error, false, FILENAME_CHECKOUT_PAYMENT);
         }
         $this->cc_card_type = $cc_validation->cc_type;
         $this->cc_card_number = $cc_validation->cc_number;
         $this->cc_expiry_month = $cc_validation->cc_expiry_month;
         $this->cc_expiry_year = $cc_validation->cc_expiry_year;
         $this->cc_checkcode = $_POST['paypalwpp_cc_checkcode'];
     }
 }
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:35,代码来源:paypal_wpp.php

示例10: pre_confirmation_check

 /**
  * Performs required validation to check and ensure that the
  * submitted form information appears correct before performming the
  * transaction through the confirmation screen.
  *
  * Uses the cc_validation.php class to check the CC Number, expiry date
  * and redirects an $error string containing the Friendly Error Message
  * to the Checkout Payment screen
  */
 function pre_confirmation_check()
 {
     global $HTTP_POST_VARS;
     require_once DIR_WS_CLASSES . 'cc_validation.php';
     $error = '';
     // Perform validation through the cc_validation class
     $ccValidation = new cc_validation();
     $result = $ccValidation->validate($HTTP_POST_VARS['exalt_cc_number'], $HTTP_POST_VARS['exalt_cc_expires_month'], $HTTP_POST_VARS['exalt_cc_expires_year']);
     // Validate the result
     switch ($result) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($ccValidation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     // Redirect the user if the card data was deemed invalid
     if ($result === false || $result < 1) {
         // Build the return URL
         $paymentErrorReturn = 'payment_error=' . $this->code;
         $paymentErrorReturn .= '&error_message=' . urlencode($error);
         $paymentErrorReturn .= '&exalt_cc_owner=' . urlencode($HTTP_POST_VARS['exalt_cc_owner']);
         $paymentErrorReturn .= '&exalt_cc_expires_month=' . $HTTP_POST_VARS['exalt_cc_expires_month'];
         $paymentErrorReturn .= '&exalt_cc_expires_year=' . $HTTP_POST_VARS['exalt_cc_expires_year'];
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $paymentErrorReturn, 'SSL', true, false));
     }
     // Treat the CC details to ensure they are ready to be sent to a payment gateway
     $this->cc_card_owner = $HTTP_POST_VARS['exalt_cc_owner'];
     $this->cc_card_type = $ccValidation->cc_type;
     $this->cc_card_number = $ccValidation->cc_number;
     $this->cc_expiry_month = $ccValidation->cc_expiry_month;
     $this->cc_expiry_year = $ccValidation->cc_expiry_year;
     $this->cc_cvv = $HTTP_POST_VARS['exalt_cc_cvv'];
 }
开发者ID:chinandjaal,项目名称:os_commerce,代码行数:49,代码来源:exalt.php

示例11: before_process

 /**
  * Prepare and submit the final authorization to PayPal via the appropriate means as configured
  */
 function before_process()
 {
     global $order, $doPayPal, $messageStack;
     $options = array();
     $optionsShip = array();
     $optionsNVP = array();
     $options = $this->getLineItemDetails($this->selectCurrency($order->info['currency']));
     //$this->zcLog('before_process - 1', 'Have line-item details:' . "\n" . print_r($options, true));
     // Initializing DESC field: using for comments related to tax-included pricing, populated by getLineItemDetails()
     $options['DESC'] = '';
     $doPayPal = $this->paypal_init();
     /****************************************
      * Do DP checkout
      ****************************************/
     $this->zcLog('before_process - DP-1', 'Beginning DP mode');
     // Set state fields depending on what PayPal wants to see for that country
     $this->setStateAndCountry($order->billing);
     if (zen_not_null($order->delivery['street_address'])) {
         $this->setStateAndCountry($order->delivery);
     }
     // Validate credit card data
     include DIR_WS_CLASSES . 'cc_validation.php';
     $cc_validation = new cc_validation();
     $response = $cc_validation->validate($_POST['wpp_cc_number'], $_POST['wpp_cc_expdate_month'], $_POST['wpp_cc_expdate_year'], $_POST['wpp_cc_issuedate_month'], $_POST['wpp_cc_issuedate_year']);
     $error = '';
     switch ($response) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     if ($response === false || $response < 1) {
         $this->zcLog('before_process - DP-2', 'CC validation results: ' . $error . '(' . $response . ')');
         $messageStack->add_session('checkout_payment', $error . '<!-- [' . $this->code . '] -->' . '<!-- result: ' . $response . ' -->', 'error');
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
     }
     if (!in_array($cc_validation->cc_type, array('Visa', 'MasterCard', 'Switch', 'Solo', 'Discover', 'American Express', 'Maestro'))) {
         //        $this->zcLog('before_process - DP-3', 'CC info: ' . $cc_validation->cc_type . ' ' . substr($cc_validation->cc_number, 0, 4) . str_repeat('X', (strlen($cc_validation->cc_number) - 8)) . substr($cc_validation->cc_number, -4) . ' ' . $error);
         $messageStack->add_session('checkout_payment', MODULE_PAYMENT_PAYPALDP_TEXT_BAD_CARD . '<!-- [' . $this->code . ' ' . $cc_validation->cc_type . '] -->', 'error');
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
     }
     // if CC validation passed, continue using the validated data
     $cc_type = $cc_validation->cc_type;
     $cc_number = $cc_validation->cc_number;
     $cc_first_name = $_POST['wpp_payer_firstname'] != '' ? $_POST['wpp_payer_firstname'] : $_SESSION['customer_first_name'];
     $cc_last_name = $_POST['wpp_payer_lastname'] != '' ? $_POST['wpp_payer_lastname'] : $_SESSION['customer_last_name'];
     $cc_checkcode = $_POST['wpp_cc_checkcode'];
     $cc_expdate_month = $cc_validation->cc_expiry_month;
     $cc_expdate_year = $cc_validation->cc_expiry_year;
     $cc_issuedate_month = $_POST['wpp_cc_issuedate_month'];
     $cc_issuedate_year = $_POST['wpp_cc_issuedate_year'];
     $cc_issuenumber = $_POST['wpp_cc_issuenumber'];
     $cc_owner_ip = current(explode(':', str_replace(',', ':', zen_get_ip_address())));
     // If they're still here, set some of the order object's variables.
     $order->info['cc_type'] = $cc_type;
     $order->info['cc_number'] = substr($cc_number, 0, 4) . str_repeat('X', strlen($cc_number) - 8) . substr($cc_number, -4);
     $order->info['cc_owner'] = $cc_first_name . ' ' . $cc_last_name;
     $order->info['cc_expires'] = '';
     //$cc_expdate_month . substr($cc_expdate_year, -2);
     $order->info['ip_address'] = $cc_owner_ip;
     // Set currency
     $my_currency = $this->selectCurrency($order->info['currency'], 'DP');
     // if CC is switch or solo, must be GBP
     if (in_array($cc_type, array('Switch', 'Solo', 'Maestro'))) {
         $my_currency = 'GBP';
     }
     //      $order->info['total'] = zen_round($order->info['total'], 2);
     $order_amount = $this->calc_order_amount($order->info['total'], $my_currency);
     $display_order_amount = $this->calc_order_amount($order->info['total'], $my_currency, TRUE);
     // 3D-Secure
     if (MODULE_PAYMENT_PAYPALDP_MERCHANT_COUNTRY == 'UK') {
         // determine the card type and validate that authentication was attempted and completed if applicable
         if ($_SESSION['3Dsecure_requires_lookup'] || $this->requiresLookup($_POST['wpp_cc_number']) == true) {
             // authentication attempt required?
             // validate an acceptable lookup result
             if (isset($_SESSION['3Dsecure_enroll_lookup_attempted']) == false || strcasecmp($_SESSION['3Dsecure_enroll_lookup_attempted'], 'Y') != 0) {
                 // lookup never attempted for required card, so need to redirect to payment-selection page
                 $reason = 'Customer arrived on the order process page without attempting authentication lookup.';
                 $error = MODULE_PAYMENT_PAYPALDP_CANNOT_BE_COMPLETED;
                 $messageStack->add_session('checkout_payment', $error . '<!-- [' . $this->code . '] -->' . '<!-- result: ' . $reason . ' -->', 'error');
                 $errorText = $reason . "\n\nProblem occurred while customer " . $_SESSION['customer_id'] . ' ' . $_SESSION['customer_first_name'] . ' ' . $_SESSION['customer_last_name'] . ' was attempting checkout with 3D-Secure authentication.';
                 $errorText .= $this->code;
                 zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, MODULE_PAYMENT_PAYPALDP_TEXT_EMAIL_ERROR_SUBJECT, $errorText, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML' => nl2br($errorText)), 'paymentalert');
                 zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
             }
             // if enrolled, validate an acceptable authentication result
             if (strcasecmp('Y', $_SESSION['3Dsecure_enrolled']) == 0) {
                 if (isset($_SESSION['3Dsecure_authentication_attempted']) == false || strcasecmp($_SESSION['3Dsecure_authentication_attempted'], 'Y') != 0) {
                     $reason = 'Customer arrived on the order process page without completing required authentication.';
                     $error = MODULE_PAYMENT_PAYPALDP_CANNOT_BE_COMPLETED;
//.........这里部分代码省略.........
开发者ID:bobjacobsen,项目名称:EventTools,代码行数:101,代码来源:paypaldp.php

示例12: pre_confirmation_check

 function pre_confirmation_check()
 {
     global $aLang;
     if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
         include 'includes/classes/class_cc_validation.php';
         $cc_validation = new cc_validation();
         $result = $cc_validation->validate($_POST['psigate_cc_number'], $_POST['psigate_cc_expires_month'], $_POST['psigate_cc_expires_year']);
         $error = '';
         switch ($result) {
             case -1:
                 $error = sprintf($aLang['text_ccval_error_unknown_card'], substr($cc_validation->cc_number, 0, 4));
                 break;
             case -2:
             case -3:
             case -4:
                 $error = $aLang['text_ccval_error_invalid_date'];
                 break;
             case false:
                 $error = $aLang['text_ccval_error_invalid_number'];
                 break;
         }
         if ($result == false || $result < 1) {
             $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&psigate_cc_owner=' . urlencode($_POST['psigate_cc_owner']) . '&psigate_cc_expires_month=' . $_POST['psigate_cc_expires_month'] . '&psigate_cc_expires_year=' . $_POST['psigate_cc_expires_year'];
             $aFilename = oos_get_filename();
             $aModules = oos_get_modules();
             MyOOS_CoreApi::redirect(oos_href_link($aModules['checkout'], $aFilename['checkout_payment'], $payment_error_return, 'SSL', true, false));
         }
         $this->cc_card_type = $cc_validation->cc_type;
         $this->cc_card_number = $cc_validation->cc_number;
         $this->cc_expiry_month = $cc_validation->cc_expiry_month;
         $this->cc_expiry_year = $cc_validation->cc_expiry_year;
     } else {
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:35,代码来源:psigate.php

示例13: pre_confirmation_check

 function pre_confirmation_check()
 {
     global $HTTP_POST_VARS, $paypal_ec_token, $paypal_ec_payer_id, $paypal_ec_payer_info;
     //If this is an EC checkout, do nuttin'
     if (tep_session_is_registered('paypal_ec_token') && tep_session_is_registered('paypal_ec_payer_id') && tep_session_is_registered('paypal_ec_payer_info')) {
         return false;
     } else {
         include DIR_WS_CLASSES . 'cc_validation.php';
         $cc_validation = new cc_validation();
         $ed = $this->get_exp_date($HTTP_POST_VARS['wpp_cc_expdate']);
         $result = $cc_validation->validate($HTTP_POST_VARS['wpp_cc_number'], (int) $ed[0], strlen($ed[1]) > 2 ? substr($ed[1], -2) : $ed[1]);
         $error = '';
         switch ($result) {
             case -1:
                 $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
                 break;
             case -2:
             case -3:
             case -4:
                 $error = TEXT_CCVAL_ERROR_INVALID_DATE;
                 break;
             case false:
                 $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
                 break;
         }
         $HTTP_POST_VARS['wpp_cc_checkcode'] = preg_replace('/[^0-9]/i', '', $HTTP_POST_VARS['wpp_cc_checkcode']);
         if ($result == false || $result < 1) {
             $this->away_with_you(MODULE_PAYMENT_PAYPAL_DP_TEXT_CARD_ERROR . '<br><br>' . $error, false, FILENAME_CHECKOUT_SHIPPING);
         }
         $this->cc_card_type = $cc_validation->cc_type;
         $this->cc_card_number = $cc_validation->cc_number;
         $this->cc_expiry_month = $cc_validation->cc_expiry_month;
         $this->cc_expiry_year = $cc_validation->cc_expiry_year;
         $this->cc_checkcode = $HTTP_POST_VARS['wpp_cc_checkcode'];
     }
 }
开发者ID:rrecurse,项目名称:IntenseCart,代码行数:36,代码来源:paypal_wpp.php

示例14: pre_confirmation_check

 function pre_confirmation_check()
 {
     global $_POST;
     include '../lib/epayment/classes/cc_validation.php';
     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($_POST['authorizenet_cc_number'], $_POST['authorizenet_cc_expires_month'], $_POST['authorizenet_cc_expires_year']);
     $error = '';
     switch ($result) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     if ($result == false || $result < 1) {
         $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&authorizenet_cc_owner=' . urlencode($_POST['authorizenet_cc_owner']) . '&authorizenet_cc_expires_month=' . $_POST['authorizenet_cc_expires_month'] . '&authorizenet_cc_expires_year=' . $_POST['authorizenet_cc_expires_year'];
         tep_redirect(tep_href_link("checkout_payment.php", $payment_error_return, 'SSL', true, false));
     }
     $this->cc_card_type = $cc_validation->cc_type;
     $this->cc_card_number = $cc_validation->cc_number;
     $this->cc_expiry_month = $cc_validation->cc_expiry_month;
     $this->cc_expiry_year = $cc_validation->cc_expiry_year;
 }
开发者ID:sayemk,项目名称:a2billing,代码行数:29,代码来源:authorizenet.php

示例15: pre_confirmation_check

 function pre_confirmation_check()
 {
     include_once DIR_WS_CLASSES . 'cc_validation.php';
     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($_POST['cc_number'], $_POST['cc_expires_month'], $_POST['cc_expires_year']);
     $error = EMPTY_STRING;
     switch ($result) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case -5:
             $error = sprintf(TEXT_CCVAL_ERROR_NOT_ACCEPTED, substr($cc_validation->cc_type, 0, 10), substr($cc_validation->cc_type, 0, 10));
             break;
         case -6:
             $error = TEXT_CCVAL_ERROR_SHORT;
             break;
         case -7:
             $error = TEXT_CCVAL_ERROR_BLACKLIST;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     if ($result == false || $result < 1) {
         if (USE_AJAX) {
             ajax_error($error);
         } else {
             $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($_POST['cc_owner']) . '&cc_expires_month=' . $_POST['cc_expires_month'] . '&cc_expires_year=' . $_POST['cc_expires_year'];
             olc_redirect(olc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, SSL, true, false));
         }
     }
     if (strtolower(USE_CC_CVV) != TRUE_STRING_S) {
         $this->cc_cvv = '000';
     }
     $this->cc_card_type = $cc_validation->cc_type;
     $this->cc_card_number = $cc_validation->cc_number;
 }
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:42,代码来源:cc.php


注:本文中的cc_validation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。