Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

bettyj

Members
  • Content count

    22
  • Joined

  • Last visited

Everything posted by bettyj

  1. bettyj

    Low Stock Report v2.0

    Hi First thank you to the author - great contrib! Works like a charm :D and it is one of those nice contribs that really helps! The contrib allows sorting of columns for product name, model, qty available and status which is great, but I also want to sort the colume 'est 60 day sales' so I can see the top sellers (and worst sellers!) easily. I struggle with php at best of times ... have tried to copy/paste other sorting code already there, but just ended in a jumble ... presume it's easy to do? Perhaps this may also be a useful function in the next upgrade?? If anyone has any suggestions, it would be really appreciated! Thanks B
  2. bettyj

    Fancier Invoice & Packingslip v1.0

    Great contribution! I'm trying to add the shipping method (not prices) to the packing slip - saw this was touched on briefly during an earlier post, but I can't figure the code to pull out just the shippng method - I either get nothing or the text and costs too. Any ideas? Thanks!
  3. bettyj

    Help! Shipping Crisis!

    Hi - I have a really weird problem.... I am using the single page easy checkout mod in conjunction with the UK postcode zone shipping mod. All works fine, but every now and again a customer goes through with no shipping having been applied to their order. I have checked the postcode zones, weight etc and all are in order - if I repeat these orders, then shipping is applied, so I know it is not a zone or weight error. I have a feeling it is something to do with using the browser back/forward buttons - I was testing this once and the shipping just disappeared from the order when I used the IE browser back and then forward buttons, but it does not do it all the time, so is not a consistent issue. Occurs in maybe 1 in 30 orders. No consistency with postcode, weight or items ordered. But it is a real pain - and costing me money!! Has anyone any idea where I can look to sort this out or have any ideas.....?? I know the description above is vague - but it is about all I have to go on... Thank you!
  4. Does anyone know if it is possible to preselect a payment option - I run with three payment options and some folk forget to select the one they want to use and then get frustrated. So if the payment option of (my) choice already has the radio button checked they use what I want unless they really have a preference. Any ideas how I could do this?
  5. bettyj

    UK Debit Cards & cc_Validate

    Hiya - This seems to be a continual problem with UK debit cards - my cc_validate file will not allow debit cards to be processed, and well frankly I just have no idea how to amend the file to add the debit card bin number ranges in. The key part of cc_validate.php is currently: 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(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'; } else { return -1; Does anyone have the relevant range codes for Delta/Electron/Maestro/Switch & Solo? I have up to date bin ranges for the cards, but as I don't even understand the format of the coding (Barely a basic php newbie!) I just don't know how to start adding them in... Can anyone help with the code or decipher the above card number format info so I could have a stab at it myself? Thanks everso...!
  6. bettyj

    UK Debit Cards & cc_Validate

    :blink: Still having problems with debit payment cards using optimal payments .... but different ones! I think the problem is because the Optimal Payment module I am using does not collect an issue number which is found on some debit cards. The relevant code in the optimal/firepay module is: <?php # # Payment Module SureFire Commerce via FirePay for osCommerce (http://www.oscommerce.com) # Developed by mike wOZniewski, http://www.OZmediaSolutions.com # If you find bugs, have questions, please email mike@OZmediaSolutions.com # # API information, white papers, protocol info can be found at http://www.sfcommerce.com/Back-Office/merchant.asp # # IMPORTANT NOTES FOR THIS VERSION: # - Since FirePay does not return a message in the header, this module uses CURL to post and receive a response. This MUST be installed on your server if this module is to work (found at http://curl.haxx.se/). # - You cannot use your regular account, username, and password if you are using the TEST mode; you must contact SureFire and request a test account. # - Currencies are NOT sent to SureFire. Your SureFire account has a specific default currency, and any order totals should be in that currency. # # THINGS STILL TO DO: # - Add currency conversion for order total to convert it to your SureFire default currency. # - Modify the cc_validation.php class to accept FirePay Payments # class firepay { var $code, $title, $description, $enabled; // class constructor function firepay() { global $order; $this->code = 'firepay'; $this->title = MODULE_PAYMENT_FIREPAY_TEXT_TITLE; $this->description = MODULE_PAYMENT_FIREPAY_TEXT_DESCRIPTION; $this->enabled = ((MODULE_PAYMENT_FIREPAY_STATUS == 'True') ? true : false); $this->sort_order = MODULE_PAYMENT_FIREPAY_SORT_ORDER; if ((int)MODULE_PAYMENT_FIREPAY_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_FIREPAY_ORDER_STATUS_ID; } if (is_object($order)) $this->update_status(); $this->form_action_url = FILENAME_CHECKOUT_PROCESS; } // start custom firepay methods function dp($call,$cname) { // debug display for test mode echo "<br/>".$cname.":<pre>"; if (!is_array($call)) $call=htmlspecialchars($call); print_r($call); if (is_array($call)) reset($call); echo "</pre><hr/>\n"; } function firepay_cardType() { switch ($this->cc_card_type) { case "Visa": return "VI"; case "Master Card": return "MC"; case "UK Electron": return "VE"; case "UK Switch/Maestro": return "SW"; case "UK Solo": return "SO"; case "Delta": return "VD"; } return false; } // end custom firepay methods // class methods function update_status() { global $order; if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_FIREPAY_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_FIREPAY_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->billing['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } function javascript_validation() { $js = ' if (payment_value == "' . $this->code . '") {' . "\n" . ' var cc_owner = document.checkout_payment.firepay_cc_owner.value;' . "\n" . ' var cc_number = document.checkout_payment.firepay_cc_number.value;' . "\n" . ////evan added on August 27 2003 ' var cc_cvd = document.checkout_payment.firepay_cvd_number.value;'. "\n". /////evan added ends ' if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" . ' error_message = error_message + "' . MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_OWNER . '";' . "\n" . ' error = 1;' . "\n" . ' }' . "\n" . ' if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" . ' error_message = error_message + "' . MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_NUMBER . '";' . "\n" . ' error = 1;' . "\n" . ' }' . "\n" . ////evan added on August 27 2003 ' if (cc_cvd == "" || cc_cvd.length < 3 || cc_cvd.length > 4) {'."\n". ' error_message = error_message + "CVD Number not input or number of digits incorrect";'."\n". ' error = 1;'. "\n". ' }' . "\n". ///evan added ends ' }' . "\n"; return $js; } function selection() { global $order; for ($i=1; $i<13; $i++) { $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000))); } $today = getdate(); for ($i=$today['year']; $i < $today['year']+10; $i++) { $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i))); } $selection = array('id' => $this->code, 'module' => $this->title, 'fields' => array(array('title' => MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_OWNER, 'field' => tep_draw_input_field('firepay_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])), array('title' => MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_NUMBER, 'field' => tep_draw_input_field('firepay_cc_number')), ///evan added thte following on August 26 2003 array('title' => 'CVD <span style="font-size:10">(last 3 or 4 digits of the security number <br> on the back of your card-usually on the signature line)</span>', 'field'=> tep_draw_input_field('firepay_cvd_number')), ///evan added ends array('title' => MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_EXPIRES, 'field' => tep_draw_pull_down_menu('firepay_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('firepay_cc_expires_year', $expires_year)))); return $selection; } 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['firepay_cc_number'], $HTTP_POST_VARS['firepay_cc_expires_month'], $HTTP_POST_VARS['firepay_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) . '&firepay_cc_owner=' . urlencode($HTTP_POST_VARS['firepay_cc_owner']) . '&firepay_cc_expires_month=' . $HTTP_POST_VARS['firepay_cc_expires_month'] . '&firepay_cc_expires_year=' . $HTTP_POST_VARS['firepay_cc_expires_year']; 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; } function confirmation() { global $HTTP_POST_VARS; $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type, 'fields' => array(array('title' => MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_OWNER, 'field' => $HTTP_POST_VARS['firepay_cc_owner']), array('title' => MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_NUMBER, 'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)), ///evan added on August 23 2003 array('title' => 'CVD Number', 'field' => $HTTP_POST_VARS['firepay_cvd_number']), ///evan added ends array('title' => MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_EXPIRES, 'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['firepay_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['firepay_cc_expires_year']))))); return $confirmation; } function process_button() { global $HTTP_SERVER_VARS, $HTTP_POST_VARS, $order, $customer_id;////evan added on August 27 2003, the $HTTP_POST_VARS $process_button_string = // unique transaction id number: tep_draw_hidden_field('firepay[merchantTxn]', $customer_id . '-' . date('Ymdhis')) . // cc info: tep_draw_hidden_field('firepay[cardNumber]', $this->cc_card_number) . tep_draw_hidden_field('firepay[cardType]', $this->firepay_cardType()) . ///evan added on August 27 2003 tep_draw_hidden_field('firepay[cvdValue]', $HTTP_POST_VARS['firepay_cvd_number']). ///evan added ends tep_draw_hidden_field('firepay[cardExp]', $this->cc_expiry_month . '/' . substr($this->cc_expiry_year, -2)) . ///tep_draw_hidden_field('firepay[cvdIndicator]', '0') . // indicates that no cc security number was provided ////evan commented above line and changed it to below on August 27 2003 tep_draw_hidden_field('firepay[cvdIndicator]', '1'). //indicates cvd is provided ///evan added ends // amount owed (in cents): tep_draw_hidden_field('firepay[amount]', round($order->info['total'],2)*100) . // billing info: tep_draw_hidden_field('firepay[custName1]', $order->billing['lastname'] . ', ' . $order->customer['firstname']) . tep_draw_hidden_field('firepay[streetAddr]', $order->billing['street_address']) . tep_draw_hidden_field('firepay[city]', $order->billing['city']) . tep_draw_hidden_field('firepay[province]', $order->billing['state']) . tep_draw_hidden_field('firepay[zip]', $order->billing['postcode']) . tep_draw_hidden_field('firepay[country]', $order->billing['country']['title']) . tep_draw_hidden_field('firepay[phone]', $order->customer['telephone']) . tep_draw_hidden_field('firepay', $order->customer['email_address']); $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id()); return $process_button_string; } function before_process() { global $HTTP_POST_VARS; // transaction info: if (MODULE_PAYMENT_FIREPAY_TESTMODE=="Production") $firepay_post_url = 'https://realtime.firepay.com:443/servlet/DPServlet'; else $firepay_post_url = 'https://realtime.test.firepay.com:443/servlet/DPServlet'; if (MODULE_PAYMENT_FIREPAY_OPERATION=='Payment') $firepay_transaction_type = "P"; else $firepay_transaction_type = "A"; // prepare vars to post to fireplay $firepay_data_stream = ''; $firepay_account_info = array( 'account' => MODULE_PAYMENT_FIREPAY_ACCOUNT, 'merchantId' => MODULE_PAYMENT_FIREPAY_USERNAME, 'merchantPwd' => MODULE_PAYMENT_FIREPAY_PASSWORD, 'clientVersion' => '1.1', 'operation' => $firepay_transaction_type ); $firepay_input = (array)$HTTP_POST_VARS['firepay'] + (array)$firepay_account_info; foreach ($firepay_input as $k=>$v) { if (strlen($firepay_data_stream)>0) $firepay_data_stream .= '&'; $firepay_data_stream .= "$k=".urlencode($v); } //send the data and retrieve response using CURL () $curl_handler = curl_init($firepay_post_url); curl_setopt($curl_handler,CURLOPT_RETURNTRANSFER,1); curl_setopt($curl_handler,CURLOPT_POST,1); curl_setopt($curl_handler,CURLOPT_POSTFIELDS,$firepay_data_stream); $curl_result = curl_exec($curl_handler); curl_close($curl_handler); //re-arrange the results into an array $curl_result = explode('&',urldecode($curl_result)); foreach ($curl_result as $v) { list($key,$val) = explode('=',$v); $firepay_output[$key] = $val; } // uncomment for debugging: (the order will NOT be placed in the catalog database, but the transaction will go through // $this->dp($firepay_input,"INPUT PARAMETERS"); // $this->dp($firepay_output,"OUTPUT PARAMETERS"); // exit; if (($firepay_output['status'] == 'SP') || ($firepay_output['status'] == 'A')) return; else if ($firepay_output['status'] == 'E') tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode($firepay_output['errString']), 'SSL', true, false)); else tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_FIREPAY_TEXT_ERROR_MESSAGE), 'SSL', true, false)); } function after_process() { return false; } function get_error() { global $HTTP_GET_VARS; $error = array('title' => MODULE_PAYMENT_FIREPAY_TEXT_ERROR, 'error' => stripslashes(urldecode($HTTP_GET_VARS['error']))); return $error; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_FIREPAY_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable FirePay Module', 'MODULE_PAYMENT_FIREPAY_STATUS', 'True', 'Do you want to accept FirePay / SFCommerce payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Account Number', 'MODULE_PAYMENT_FIREPAY_ACCOUNT', 'testing', 'Your FirePay / SFCommerce Account Number', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Username', 'MODULE_PAYMENT_FIREPAY_USERNAME', 'testing', 'The merchant username provided by the FirePay or SFCommerce service', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Password', 'MODULE_PAYMENT_FIREPAY_PASSWORD', 'Test', 'The merchant password provided by the FirePay or SFCommerce service', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_FIREPAY_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Production\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Type', 'MODULE_PAYMENT_FIREPAY_OPERATION', 'Authorization', 'What type of transaction should be used?', '6', '0', 'tep_cfg_select_option(array(\'Authorization\', \'Payment\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_FIREPAY_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_FIREPAY_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_FIREPAY_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_PAYMENT_FIREPAY_STATUS', 'MODULE_PAYMENT_FIREPAY_ACCOUNT', 'MODULE_PAYMENT_FIREPAY_USERNAME', 'MODULE_PAYMENT_FIREPAY_PASSWORD', 'MODULE_PAYMENT_FIREPAY_TESTMODE', 'MODULE_PAYMENT_FIREPAY_OPERATION', 'MODULE_PAYMENT_FIREPAY_ZONE', 'MODULE_PAYMENT_FIREPAY_ORDER_STATUS_ID', 'MODULE_PAYMENT_FIREPAY_SORT_ORDER'); } } ?> So what I ned to do is add an extra field to capture an issue number and start date if present (so not required fields).... I think! Does anyone have any idea where to start? I have discussed this with the payment processor who told me it would be a simple thing for anyone with php knowledge... thanks... helpful... not! ...thank you ....
  7. bettyj

    accepting credit cards

    You need an online credit card processor - look at worldpay, optimal, etc. Look for one suitable with your country and check if you need a merchant account or if one comes with it (like worldpay). Check both setup fees and per transaction fees/chargebacks/reserve fees. Some are real pricey and some are OK. I recently ventured down this path myself - bit of a confusing minefield, but just check out loads (do a search on google) and you'll soon get a feel for what is good or bad. Rule out those that are not osC friendly - perhaps start with those you alreay have osC payment modules for... Good luck!
  8. bettyj

    UK Debit Cards & cc_Validate

    ((hugs!)) I think this has sorted it - THANKYOU! You have no idea how long I have been battling at this .... and how releaved I now am! God bless the open forum! Thanks again!
  9. bettyj

    PayPal Processing Page

    I'm ANOTHER newbie to oSC - but wow! What a great system!! I'm using PayPal as my (only) processor and would like to edit the look of the page that says 'Processing Transaction'. This appears to be catalog/checkout_process.php, but I can't see how to change the code to edit the layout. Probably a very dim question, but am not a php wizz! Can anyone point me in the right direction? Many thanks in advance!
×