Thanks for the snappy reply, I know your swamped!
I use Square
Printable View
Thanks for the snappy reply, I know your swamped!
I use Square
You might try looking at /includes/classes/cc_validation.php.
Thank you and I’ll report back on my findings.
I don't see the immediate fix.
Code:<?php
/**
* cc_validation Class.
*
* @package classes
* @copyright Copyright 2003-2016 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: Author: DrByte Mon Jul 27 18:24:22 2015 -0400 Modified in v1.5.5 $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
/**
* cc_validation Class.
* Class to validate credit card numbers etc
*
* @package classes
*/
class cc_validation extends base {
var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year;
function validate($number, $expiry_m, $expiry_y, $start_m = null, $start_y = null) {
$this->cc_number = preg_replace('/[^0-9]/', '', $number);
// NOTE: We check Solo before Maestro, and Maestro/Switch *before* we check Visa/Mastercard, so we don't have to rule-out numerous types from V/MC matching rules.
if (preg_match('/^(6334[5-9][0-9]|6767[0-9]{2})[0-9]{10}([0-9]{2,3}?)?$/', $this->cc_number) && CC_ENABLED_SOLO=='1') {
$this->cc_type = "Solo"; // is also a Maestro product
} else if (preg_match('/^(49369[8-9]|490303|6333[0-4][0-9]|6759[0-9]{2}|5[0678][0-9]{4}|6[0-9][02-9][02-9][0-9]{2})[0-9]{6,13}?$/', $this->cc_number) && CC_ENABLED_MAESTRO=='1') {
$this->cc_type = "Maestro";
} else if (preg_match('/^(49030[2-9]|49033[5-9]|4905[0-9]{2}|49110[1-2]|49117[4-9]|49918[0-2]|4936[0-9]{2}|564182|6333[0-4][0-9])[0-9]{10}([0-9]{2,3}?)?$/', $this->cc_number) && CC_ENABLED_MAESTRO=='1') {
$this->cc_type = "Maestro"; // SWITCH is now Maestro
} elseif (preg_match('/^4[0-9]{12}([0-9]{3})?$/', $this->cc_number) && CC_ENABLED_VISA=='1') {
$this->cc_type = 'Visa';
} elseif (preg_match('/^5[1-5][0-9]{14}$/', $this->cc_number) && CC_ENABLED_MC=='1') {
$this->cc_type = 'MasterCard';
} elseif (preg_match('/^3[47][0-9]{13}$/', $this->cc_number) && CC_ENABLED_AMEX=='1') {
$this->cc_type = 'American Express';
} elseif (preg_match('/^3(0[0-5]|[68][0-9])[0-9]{11}$/', $this->cc_number) && CC_ENABLED_DINERS_CLUB=='1') {
$this->cc_type = 'Diners Club';
} elseif (preg_match('/^(6011[0-9]{12}|622[1-9][0-9]{12}|64[4-9][0-9]{13}|65[0-9]{14})$/', $this->cc_number) && CC_ENABLED_DISCOVER=='1') {
$this->cc_type = 'Discover';
} elseif (preg_match('/^(35(28|29|[3-8][0-9])[0-9]{12}|2131[0-9]{11}|1800[0-9]{11})$/', $this->cc_number) && CC_ENABLED_JCB=='1') {
$this->cc_type = "JCB";
} elseif (preg_match('/^5610[0-9]{12}$/', $this->cc_number) && CC_ENABLED_AUSTRALIAN_BANKCARD=='1') {
$this->cc_type = 'Australian BankCard'; // NOTE: is now obsolete
} else {
return -1;
}
if (is_numeric($expiry_m) && ($expiry_m > 0) && ($expiry_m < 13)) {
$this->cc_expiry_month = $expiry_m;
} else {
return -2;
}
$current_year = date('Y');
if (strlen($expiry_y) == 2) $expiry_y = intval(substr($current_year, 0, 2) . $expiry_y);
if (is_numeric($expiry_y) && ($expiry_y >= $current_year) && ($expiry_y <= ($current_year + 10))) {
$this->cc_expiry_year = $expiry_y;
} else {
return -3;
}
if ($expiry_y == $current_year) {
if ($expiry_m < date('n')) {
return -4;
}
}
// check the issue month & year but only for Switch/Solo cards
if (($start_m || $start_y) && in_array($this->cc_type, array('Switch', 'Solo'))) {
if (!(is_numeric($start_m) && ($start_m > 0) && ($start_m < 13))) {
return -2;
}
if (strlen($start_y) == 2) {
if ($start_y > 80) {
$start_y = intval('19' . $start_y);
} else {
$start_y = intval('20' . $start_y);
}
}
if (!is_numeric($start_y) || ($start_y > $current_year)) {
return -3;
}
if (!($start_y >= ($current_year - 10))) {
return -3;
}
}
return $this->is_valid();
}
function is_valid() {
$cardNumber = strrev($this->cc_number);
$numSum = 0;
for ($i=0; $i<strlen($cardNumber); $i++) {
$currentNum = substr($cardNumber, $i, 1);
// Double every second digit
if ($i % 2 == 1) {
$currentNum *= 2;
}
// Add digits of 2-digit numbers together
if ($currentNum > 9) {
$firstNum = $currentNum % 10;
$secondNum = ($currentNum - $firstNum) / 10;
$currentNum = $firstNum + $secondNum;
}
$numSum += $currentNum;
}
// If the total has no remainder it's OK
return ($numSum % 10 == 0);
}
}
On further inspection (aren't demo sites wonderful?), it appears that the text is being added by the Square payment method's jQuery (see /includes/modules/pages/checkout_one/jscript_square.php). The values displayed appear to be coming back from an AJAX call to Square.
You might try posting in that payment-method's support-thread for more details.
Thank you for your time Cindy,
Yes, when I inspected with firefox I found the following 3 files that make a call for this text.
Ex: sq-card-brand which when you type in two number is appears with the text visa.
I will submit a thread in the square module.
Mark
v1.5.5f ... NOT URGENT
Hi Cindy, I hope you are well. I've searched the thread and cannot find a reference to this - guests using credit card are not showing up in admin/customers/customers whereas those who use PayPal are showing. In configuration/one page checkout I have 'enable account registration' set to true .... and in admin/modules/payment/PayPal Express have Express Checkout: Automatic Account Creation set to Yes (which explains why PayPal users are being registered).
I noticed this when using admin/tools/send email when I was sending 'select' emails and many 'orders' entries did not show up in 'customers'. So many guests will not be included for email marketing.
I'm not sure if I have missed something somewhere?
cheers,
Mike
That's the way this module currently functions. If you need to see the guests as customers you might need to use a different one. And OPC doesn't have a checkbox to opt in to email marketing or a newsletter for guests. It might seem spammy to send marketing emails to customers that didn't ask to be emailed and if they report the spam it can have negative consequences for your domain.
Mike, as @lankeeyankee indicated, that's OPC working-as-designed. If a customer placed an order as a guest, they've implicitly opted-out of any email marketing from the site.
Upon order completion, a guest is given the opportunity to create an account, but if they didn't ...
@lankeeyankee and Cindy - thank you both for your responses .... all is good. Just as a matter of clarification, in configuration settings what does enabling 'enable account registration' actually do? ... or is that answered in your last line Cindy? ... 'Upon order completion, a guest is given the opportunity to create an account'
cheers,
Mike