Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SerbanG

Pioneers
  • Posts

    20
  • Joined

  • Last visited

Profile Information

  • Real Name
    Serban
  • Gender
    Male
  • Location
    Romania
  • Interests
    PHP & MySQL + ecommerce
  • Website

SerbanG's Achievements

  1. i have the same kind of problem. i select 1 or 3 products and when i go to the shipping (checkout) screen, it shows me 25packages x 1234 lbs or something like that, and the prices are enormous. i have removed from includes/[lang]/modules/shipping/upsxml.php the stuff that you said above.. still i have the same problems. someone with an advice please.. thanks
  2. if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) { $this->cc_type = 'Visa'; } elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) { $this->cc_type = 'Master Card'; } elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) { $this->cc_type = 'American Express'; } elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'Diners Club'; } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) { $this->cc_type = 'Discover'; } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'JCB'; } elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) { $this->cc_type = 'Australian BankCard'; } elseif (ereg('^6759[0-9]{14}$',$this->cc_number)) { $this->cc_type = 'Switch'; } else { $this->cc_type = 'Unknown'; } for all major used cards, hope this helps, if not TomCavendish please show me an example of UK Switch card. serban
  3. thanks davis, my clients validate their customers credit cards by telephone or manual methods, si FOR THAT kind of shops is the code above. please leave this post undeleted because some may find it usefull. serban
  4. nope, my 'fix' is ONLY for that users that seemed to have problems with validating visa and mastercard on their site, i happen to do a lot of tests and it worked for me. IGNORE THIS FIX IF YOU DIDN't HAVE ANY PROBLEMS WITH CC VALIDATION
  5. hello i have noticed that were a lot of discussions on the past about problems of validating visa and mastercard cards using the simple cc module of payment in oscommerce. for those who seek the answer, i pasted the entire code modified, of cc_validation.php: <?php /* $Id: cc_validation.php,v 1.3 2003/02/12 20:43:41 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License ###################################### ###################################### #########Serban Gheorghe Ghita######## ######[email protected]###### ####################################### ??FIX?? - for validation of mastercard and visa cards */ class cc_validation { var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year; function validate($number, $expiry_m, $expiry_y) { $this->cc_number = ereg_replace('[^0-9]', '', $number); if (ereg('^4(.{12}|.{15})$', $this->cc_number)) { $this->cc_type = 'Visa'; } elseif (ereg('^5[1-5].{14}$', $this->cc_number)) { $this->cc_type = 'Master Card'; } elseif (ereg('^3[47].{13}$', $this->cc_number)) { $this->cc_type = 'American Express'; } elseif (ereg('^3(0[0-5].{11}|[68].{12})$', $this->cc_number)) { $this->cc_type = 'Diners Club'; } elseif (ereg('^6011.{12}$', $this->cc_number)) { $this->cc_type = 'Discover'; } elseif (ereg('^(3.{15}|(2131|1800).{11})$', $this->cc_number)) { $this->cc_type = 'JCB'; } elseif (ereg('^5610.{12}$', $this->cc_number)) { $this->cc_type = 'Australian BankCard'; } else { $this->cc_type = 'Unknown'; } /* class cc_validation { var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year; function validate($number, $expiry_m, $expiry_y) { //$this->cc_number = ereg_replace('[^0-9]', '', $number); $this->cc_number = ereg_replace('[^[:digit:]]', '', $number); //if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) { if (ereg('^4.{15}$|^4.{12}$', $this->cc_number)) { //^5[1-5].{14}$ //^4.{15}$|^4.{12}$ //[^[:digit:]] $this->cc_type = 'Visa'; // } elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) { } elseif (ereg('^5[1-5].{14}$', $this->cc_number)) { //} elseif (ereg("^5[0-9]{16}$", $this->cc_number) || eregi("^[0-9{2}/+[0-9]{2}", $this->cc_number)) { $this->cc_type = 'Master Card'; /* } elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) { $this->cc_type = 'American Express'; } elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'Diners Club'; } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) { $this->cc_type = 'Discover'; } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'JCB'; } elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) { $this->cc_type = 'Australian BankCard'; } 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'); $expiry_y = 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; } } //return $this->is_valid(); return true; } /* 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); } */ } ?> i have test it with numerous cc-s, valids and it works, and it doesn;t create any problems that i had in the past. i really hope this helps for some of you. serban
  6. i only get a java popup message saying 'Could not upload 'product.jpg' or 'Cannot create motherboards directory' thats all. thanks zam
  7. hello first of all (i`ve said it before) this is a great contrib. to osc. way to go maxidvd. my problem is that i cannot upload pics, or create directories. i checked if the images folder is chmod 777 (it was), i checked if the php scripts in /htmlarea/ and i set them all (i guess) to 777. i have cleared my cache tried to upload again, but still nothing. a little help pls, i am running osc ms2 with latest contrib for ms2 on a linux server. S. Ghita
  8. hello i read all replies but i still cant figure out what is my problem.When i try to insert an image i see in Image Manager windows this error: Warning: open_basedir restriction in effect.File in wrong directory in /usr/local/apache/www/site.com/catalog/admin/includes/configure.php on line 45 Fatal error: Failed opening required 'includes/modules/infopages/configure.php in /usr/local/apache/www/site.com/catalog/admin/includes/configure.php on line 45 please tell me where should i modify the paths to correct this error. thanks btw: great great script!greetz
  9. it would be cool to add this property to custom pc creator: when you create a category like motherboard you must be able to grab components from more than one category. a more advanced one: when you select a certain type of processor let the user select a motherboard from a certain category. thanks. zam
  10. :roll: well i know that after a clean install all works fine, but i allready started the shop and i have a lot of comment made by users on products.if i change the id of the product than a certain comment would appear at another product. i wonder if i insert a column named 'product_id' and i set the product id there, what code should i insert in easypopulate.php to work? :oops: i dont understand what thunderbird said, i`ll try to read again the whole thread. zam
  11. tomcat i dont know how to help you but i know that every time I upload a database i save it in .txt format (from excel). i have a problem.when i grab the database form the server i want to add a field, and that is product_id.because my first product ID is 57, when i upload a database it creates duplicate products, because the first product in excel is with ID 1 and my first product from the database beggins with ID 57. please tell me where to edit the source code. thanks
  12. hello i think a good addon to osCommerce will be the ability to add html,java blocks.lets say that i want to add a block with a random text inside. please help
×
×
  • Create New...