Jump to content

Bob Terveuren

Members
  • Content count

    496
  • Joined

  • Last visited

  • Days Won

    15

Reputation Activity

  1. Like
    Bob Terveuren got a reaction from Supertex in Mobile Devices - PayPal Standard - Buyer Being Returned to Shopping Cart After Purchase   
    Hi there
     
    I can tell you why maybe this is happening and I have a quick sticking plaster 'fix' that may help
     
    PayPal will send your customers to their 'new' mobile express checkout - in turn that will send your customers back to your site via an HTTP GET method. The desktop checkout at PayPal will use a HTTP POST return
     
    The PayPal Standard module file in osCommerce traps the return in the before_process() function:
    function before_process() { global $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_PayPal_Standard_ID, $payment, $HTTP_GET_VARS, $HTTP_POST_VARS, $messageStack; $result = false; if ( isset($HTTP_POST_VARS['receiver_email']) && (($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_ID) || (defined('MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID') && tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID) && ($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID))) ) { $parameters = 'cmd=_notify-validate'; foreach ($HTTP_POST_VARS as $key => $value) { $parameters .= '&' . $key . '=' . urlencode(stripslashes($value)); } $result = $this->sendTransactionToGateway($this->form_action_url, $parameters); } if ($result != 'VERIFIED') { if (defined('MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION')) { $messageStack->add_session('header', MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION); } $this->sendDebugEmail($result); tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } as there is no POST data to check line 512 above will always see a GET return as !='VERIFIED' so your customer gets booted back to the shopping cart despite having paid
     
    It is possible to get some data returned from PayPal by GET (you setup PDT on your account) however that does not hold the same values as a POST return (instead it sends back a token that you need to verify)
     
    Attached is some new code that replaces the stock includes/modules/payment/paypal_standard.php - you will need to go to your store admin, uninstall Paypal, then replace the file and reinstall. There is a new field in the admin that wants you to enter a PDT code - get that code by following the advice here (or Google it)
     
    When you setup the PDT you'll need to set the auto return to 'on' and enter a valid looking url at PayPal (it can be anything - the osCommerce code over rides it but PayPal will insist you pop something in there)
     
    If properly setup this will send your customers back with a PDT GET url which includes a token - there's some new code in the file that checks that for you and will update the order. It will add a comment that an order total does not match PayPal e.g. PayPal Verified [Transaction ID: 4LR5883905582730T; Completed (Verified; $1,313.37); PayPal transaction value (1313.37) does not match order value (1,313.37)]
    Just ignore that bit!
     
    This is a patch on the standard file - it is used at your own risk and the code really needs tidying up by one of the Core Team. I have tested this on the PayPal Sandbox only. Using Chrome on a desktop you can spoof a user agent for a mobile to check what happens
    paypal_standard.php
  2. Like
    Bob Terveuren got a reaction from Supertex in Mobile Devices - PayPal Standard - Buyer Being Returned to Shopping Cart After Purchase   
    Hi there
     
    I can tell you why maybe this is happening and I have a quick sticking plaster 'fix' that may help
     
    PayPal will send your customers to their 'new' mobile express checkout - in turn that will send your customers back to your site via an HTTP GET method. The desktop checkout at PayPal will use a HTTP POST return
     
    The PayPal Standard module file in osCommerce traps the return in the before_process() function:
    function before_process() { global $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_PayPal_Standard_ID, $payment, $HTTP_GET_VARS, $HTTP_POST_VARS, $messageStack; $result = false; if ( isset($HTTP_POST_VARS['receiver_email']) && (($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_ID) || (defined('MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID') && tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID) && ($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID))) ) { $parameters = 'cmd=_notify-validate'; foreach ($HTTP_POST_VARS as $key => $value) { $parameters .= '&' . $key . '=' . urlencode(stripslashes($value)); } $result = $this->sendTransactionToGateway($this->form_action_url, $parameters); } if ($result != 'VERIFIED') { if (defined('MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION')) { $messageStack->add_session('header', MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION); } $this->sendDebugEmail($result); tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } as there is no POST data to check line 512 above will always see a GET return as !='VERIFIED' so your customer gets booted back to the shopping cart despite having paid
     
    It is possible to get some data returned from PayPal by GET (you setup PDT on your account) however that does not hold the same values as a POST return (instead it sends back a token that you need to verify)
     
    Attached is some new code that replaces the stock includes/modules/payment/paypal_standard.php - you will need to go to your store admin, uninstall Paypal, then replace the file and reinstall. There is a new field in the admin that wants you to enter a PDT code - get that code by following the advice here (or Google it)
     
    When you setup the PDT you'll need to set the auto return to 'on' and enter a valid looking url at PayPal (it can be anything - the osCommerce code over rides it but PayPal will insist you pop something in there)
     
    If properly setup this will send your customers back with a PDT GET url which includes a token - there's some new code in the file that checks that for you and will update the order. It will add a comment that an order total does not match PayPal e.g. PayPal Verified [Transaction ID: 4LR5883905582730T; Completed (Verified; $1,313.37); PayPal transaction value (1313.37) does not match order value (1,313.37)]
    Just ignore that bit!
     
    This is a patch on the standard file - it is used at your own risk and the code really needs tidying up by one of the Core Team. I have tested this on the PayPal Sandbox only. Using Chrome on a desktop you can spoof a user agent for a mobile to check what happens
    paypal_standard.php
  3. Like
    Bob Terveuren got a reaction from radhavallabh in View Counter   
    Hi - can you rename it on your local computer as a .txt, upload and then rename on the server to a .bin?
  4. Like
    Bob Terveuren got a reaction from ArtcoInc in Virtual Merchant - Elavon, ViaKlix, Nova Payment Module Support Forum   
    Hi
     
    If you are using a recent version of osC  then the includes/classes/order.php file will not record anything in those fields - e.g. 2.3.4 and 2.3.4BS have these at line 218/221
    'cc_type' => '', 'cc_owner' => '', 'cc_number' => '', 'cc_expires' => '', so you'll always get empty data.
     
    If you change those lines to this you'll get a record
    'cc_type' => $_POST['cc_type'], 'cc_owner' => $_POST['cc_owner'], 'cc_number' => $_POST['cc_number'], 'cc_expires' => $_POST['cc_expires'], However that could land you in a world of pain as storing the cc_number in its entirety is most likely a hanging offence in most of the Western World nowadays so you should obfuscate that in some manner e.g. I think this should get you a card number like 4111XXXXXXXX1234 for storage but best check
    'cc_type' => $_POST['cc_type'], 'cc_owner' => $_POST['cc_owner'], 'cc_number' => substr($_POST['cc_number'], 0, 4) . str_repeat('X', (strlen($_POST['cc_number']) - 8)) . substr($_POST['cc_number'], -4); 'cc_expires' => $_POST['cc_expires'],
  5. Like
    Bob Terveuren reacted to auzStar in [Contribution] NEW Australia Post Shipping Modules for osC 2.3.x   
    @@Bob Terveuren
     
    Thankyou Bob
     
    Fingers crossed :)
  6. Like
    Bob Terveuren got a reaction from auzStar in [Contribution] NEW Australia Post Shipping Modules for osC 2.3.x   
    No - it is not a mismatch - what you are seeing is down to the difference between the
     
    catalog/includes/classes/currencies.php file and admin/includes/classes/currencies.php files - as pointed out to you the latter is missing:
    function get_decimal_places($code) { return $this->currencies[$code]['decimal_places']; } if you add that into admin/includes/classes/currencies.php then the order editor add on should work. You may also have to cast the value at line 29 to an integer:
     
    'decimal_places' => (int)$currencies['decimal_places'],
     
     
    Shipping modules were never designed to be pulled into the admin side of things - when they are then you also need to have all the catalog operations available to them so, in this case the error lies in a combination or order editor and the stock code - not the shipping module. This has always been the case with osCommerce (at least since 2006) - that get_decimal_places is missing from the admin class.
  7. Like
    Bob Terveuren got a reaction from Psytanium in Auto Update Currencies   
    Hi there Jack
     
    @@Psytanium
     
    Here's the code I use on a 2.3.4 site - has the mysqli stuff in there
    <?php /* Auto Update Currencies v 1.0 by Jack_mcs - oscommerce-solution.com osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ///////CONFIGURABLE VARIABLES/////////// define('DEFAULT_CURRENCY', 'GBP'); define('HOURS_BETWEEN_UPDATES' , '24'); //if more than one day, multiply days by hours so the setting for two days would be 2 * 24 = 48 define('REPORT_NO_UPDATE', true); //if the currencies are not updated since they have already been updated, don't report it. Set to false to always receive this message define('NO_REPORT', 0); define('SCREEN', 1); define('EMAIL', 2); define('SCREEN_EMAIL', 3); $output_report = EMAIL; ///////////////END////////////////////// define('CURRENCY_SERVER_PRIMARY', 'xe'); define('CURRENCY_SERVER_BACKUP', 'oanda'); require_once('includes/configure.php'); require_once(DIR_WS_FUNCTIONS . 'localization.php'); $link = mysqli_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD,DB_DATABASE) or die("Unable to connect to database server!"); //mysql_select_db(DB_DATABASE); $report = ''; $updated = array(); $rate = ''; $today = date("Y-m-d H:i:s"); // The exact time $currency_query = mysqli_query($link,"select currencies_id, code, title, last_updated from currencies" ) or die(mysql_error()); while ($currency = mysqli_fetch_array($currency_query, MYSQL_ASSOC)) { { $quote_function = 'quote_' . CURRENCY_SERVER_PRIMARY . '_currency'; $rate = $quote_function($currency['code']); if (empty($rate)) { $quote_function = 'quote_' . CURRENCY_SERVER_BACKUP . '_currency'; $rate = $quote_function($currency['code']); } if (!empty($rate)) { $updated[] = 'The exchange rate for ' . $currency['title'] . ' <b>WAS</b> successfully updated.' . "\n"; //if ($rate !=1){$rate=$rate*1.02;} mysqli_query($link,"update currencies set value = '" . $rate . "', last_updated = now() where currencies_id = '" . (int)$currency['currencies_id'] . "'"); } else $updated[] = 'The exchange rate for ' . $currency['title'] . ' <b>WAS NOT</b> successfully updated. It was last updated on ' . $currency['last_updated'] . "\n"; } } if ($output_report > NO_REPORT) { $report = 'Currencies Update Report' . "\n\n"; $configuration_query = mysqli_query($link,"select configuration_value as store_name from configuration where configuration_key = 'STORE_NAME' limit 1") or die(mysqli_error()); $configuration = mysqli_fetch_array($configuration_query, MYSQL_ASSOC); $report .= 'Currencies for ' . $configuration['store_name'] . ' updated on ' . date("D M j G:i:s Y") . "\n\n"; foreach ($updated as $changed) $report .= $changed; { echo str_replace("\n", '<br>', $report); } } mysqli_close($link); ?> n.b I have an extra quick and dirty line in there (if ($rate !=1){$rate=$rate*1.02;}) that adds 2% markup on the exchange rate as my payment processor adds that in as their premium over and above the bank rates.
     
    edit: commented out that line but left it in there FYI
  8. Like
    Bob Terveuren got a reaction from Supertex in Mobile Devices - PayPal Standard - Buyer Being Returned to Shopping Cart After Purchase   
    Hi there
     
    I can tell you why maybe this is happening and I have a quick sticking plaster 'fix' that may help
     
    PayPal will send your customers to their 'new' mobile express checkout - in turn that will send your customers back to your site via an HTTP GET method. The desktop checkout at PayPal will use a HTTP POST return
     
    The PayPal Standard module file in osCommerce traps the return in the before_process() function:
    function before_process() { global $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_PayPal_Standard_ID, $payment, $HTTP_GET_VARS, $HTTP_POST_VARS, $messageStack; $result = false; if ( isset($HTTP_POST_VARS['receiver_email']) && (($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_ID) || (defined('MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID') && tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID) && ($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID))) ) { $parameters = 'cmd=_notify-validate'; foreach ($HTTP_POST_VARS as $key => $value) { $parameters .= '&' . $key . '=' . urlencode(stripslashes($value)); } $result = $this->sendTransactionToGateway($this->form_action_url, $parameters); } if ($result != 'VERIFIED') { if (defined('MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION')) { $messageStack->add_session('header', MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION); } $this->sendDebugEmail($result); tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } as there is no POST data to check line 512 above will always see a GET return as !='VERIFIED' so your customer gets booted back to the shopping cart despite having paid
     
    It is possible to get some data returned from PayPal by GET (you setup PDT on your account) however that does not hold the same values as a POST return (instead it sends back a token that you need to verify)
     
    Attached is some new code that replaces the stock includes/modules/payment/paypal_standard.php - you will need to go to your store admin, uninstall Paypal, then replace the file and reinstall. There is a new field in the admin that wants you to enter a PDT code - get that code by following the advice here (or Google it)
     
    When you setup the PDT you'll need to set the auto return to 'on' and enter a valid looking url at PayPal (it can be anything - the osCommerce code over rides it but PayPal will insist you pop something in there)
     
    If properly setup this will send your customers back with a PDT GET url which includes a token - there's some new code in the file that checks that for you and will update the order. It will add a comment that an order total does not match PayPal e.g. PayPal Verified [Transaction ID: 4LR5883905582730T; Completed (Verified; $1,313.37); PayPal transaction value (1313.37) does not match order value (1,313.37)]
    Just ignore that bit!
     
    This is a patch on the standard file - it is used at your own risk and the code really needs tidying up by one of the Core Team. I have tested this on the PayPal Sandbox only. Using Chrome on a desktop you can spoof a user agent for a mobile to check what happens
    paypal_standard.php
  9. Like
    Bob Terveuren reacted to TomB01 in Support for Stripe.com?   
    Got my first credit card sale and shipped it, so I consider this a success. :)
  10. Like
    Bob Terveuren got a reaction from tgely in Mobile Devices - PayPal Standard - Buyer Being Returned to Shopping Cart After Purchase   
    Hi - you could try using $_REQUEST in place of $_GET/$_POST - not as secure maybe but may do the trick
     
    http://php.net/manual/en/reserved.variables.request.php
  11. Like
    Bob Terveuren got a reaction from raiwa in [Contribution] iOSC - mobile version of OSC on your iPhone   
    Hi Rainer
     
    I've hit a snag with the latest iosc and Ultimate Seo Urls 5 Pro (http://addons.oscommerce.com/info/7704/v,23) both requested by a client (along with a large number of other add-ons but I thought to get these two running first)
     
    On a vanilla 2.3.4 oSC I was unable to get the mobile links operating correctly regardless of which add-on I installed first - the /mobile/ folder files would always lose a the '/mobile/' from the href value.
     
    I've gone through all the docs you supplied and this thread and couldn't find a solution - (knowing me I have overlooked something)  however if the file includes/modules/ultimate_seo_urls5/includes/usu_general_functions.php is edited as shown below then the links will work (copying  the changes you provide to the standard tep_href_link() function into the similar function with the SEO code
     
    If I have missed something in the docs - apologies. Changes below start at line 41 in the USU code:
    #### changes to href_link copied from the iOsc add-on ###### #### comment out the following seven lines ###### // if ($connection == 'NONSSL') { // $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; // } elseif ($connection == 'SSL') { // if (ENABLE_SSL == true) { // $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; // } else { // $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; #### new code as supplied by iosc (Raiwa) ##### defined('MOBILE_SESSION') ? $mobile_directory = HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE : $mobile_directory = HTTP_SERVER . DIR_WS_HTTP_CATALOG; defined('MOBILE_SESSION') ? $mobile_secure_directory = HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : $mobile_secure_directory = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; if ($connection == 'NONSSL') { $link = $mobile_directory; } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = $mobile_secure_directory; } else { $link = $mobile_directory; ##### end changes #######
  12. Like
    Bob Terveuren got a reaction from raiwa in [Contribution] Super Download Store for Version 2.3.x   
    Thanks for this - was having the same problem with a different payment module
  13. Like
    Bob Terveuren got a reaction from rice in Module for insurance for 10 euro   
    Hi
    You could adapt a Giftwrap module e.g. http://addons.oscommerce.com/info/8115 and change the wording (that one works in the checkout_shipping page but you could edit to appear in checkout_payment?
  14. Like
    Bob Terveuren got a reaction from Stefan_MM in can't get minimum order addon to work   
    Hi
     
    You could try adding that chunk of code
     

    // check order total minimum begin if ((MIN_ORDER_AMOUNT > 0) && ($order->info['total'] < MIN_ORDER_AMOUNT)) tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . urlencode(sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, MIN_ORDER_AMOUNT, MIN_ORDER_AMOUNT - $order->info['total'])), 'NONSSL')); // check order total minimum end
     
    Into checkout_shipping.php so folks would get caught there and returned to the cart try adding it after

    require(DIR_WS_CLASSES . 'order.php'); $order = new order;
     
    That's not going to beat paypal_express though so the idea there would be to use that chunk of code to intercept the call to PayPal express/pause checkout
     
    catalog\ext\modules\payment\paypal\express.php add that chunk in at line 120 (so after $order gets created and before shipping)
     
    Ideally you'd want to pop it into the cart page to hide the checkout bitton entirely but the paypal express button woudl still display as it sits in a world of it's own with respect to <div><p>and<span>
  15. Like
    Bob Terveuren reacted to bruyndoncx in MUST SELECT ATTRIBUTES   
    the check in application top is expecting action=add_product to be called when the product is added to the shopping cart.
    on your product page, it is named differently, not sure why this is done, but it is called action=add_prods
     
    i suspect if you use the same action call in both places, it will work
     
    Carine
  16. Like
    Bob Terveuren got a reaction from imageanative in Problems with "Canada Post Sell Online v1.1_1"   
    Hi - just a guess but check the edits to admin/categories.php - if you can see the new fields in there but anything you type in them is not saved then you may have missed the bit after
    if ($action == 'new_product') {
  17. Like
    Bob Terveuren reacted to GLWalker in contact page upgrade   
    Really no point in any of those addons, all are outdated and just add more overhead. The most recent versions of osc already have code in place to deal with spammers and mail abuse.
     
    Adding custom content to the page can easily be done through the language file or even with the banner manager.
     
    If your going to build a fork, think it through very thouroughly. There are already a handful of loaded osCommerce builds available, everyone and his brother, mother, sister and talented dog has been there, done that. Theres a reason the core osCommerce is not "Loaded".
     
    Good Luck
  18. Like
    Bob Terveuren got a reaction from jharri74 in usaepay checkout_process.php error   
    Hi - also suppress error reporting as that would mean that your checkout can continue past the error messages
  19. Like
    Bob Terveuren got a reaction from enagyzer in Support Thread for Supertracker Contribution   
    Download links for the GeoIP dat files - go here: http://dev.maxmind.com/geoip/geolite the links mentioned in the install file are out of date
  20. Like
    Bob Terveuren got a reaction from enagyzer in Support Thread for Supertracker Contribution   
    Oops - can't edit the last one - so here's a bit more info if you are installing
     
    1) Grab the last full package - 2.3.x is here http://addons.oscommerce.com/info/8056
    - 2.2 is here http://addons.oscommerce.com/info/3924
     
    2) Also grab the latest (well it is as of today) download which has only the admin/supertracker.php file in it
     
    3) Follow the install instructions - however you will need to edit that admin/supertracker file if you do not have the version checker add-on installed as the author has uploaded a file that has a call to the version checker includes which will bork the admin page when you try to load it - specifically remove or comment out at abiout line 31
     

    /********************** BEGIN VERSION CHECKER *********************/ require(DIR_WS_LANGUAGES . $language . '/version_checker.php'); require(DIR_WS_FUNCTIONS . 'version_checker.php'); $contribPath = 'http://addons.oscommerce.com/info/3924'; $currentVersion = 'Supertracker 3.5 for OSC 2.2.'; $contribName = 'Supertracker'; /********************** END VERSION CHECKER *********************/
     
    and at line 210
     

    <td class="smallText" style="font-weight: bold; color: red;"><?php echo AnnounceVersion($contribPath, $currentVersion, $contribName); ?></td>
×