Page 11 of 14 FirstFirst ... 910111213 ... LastLast
Results 101 to 110 of 131
  1. #101
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Duplicate Orders/Order Confirmation

    The common term used for the theory you describe is a "race condition" where two or more similar events fire at the same time and are treated independently instead of serially.

    It's very simple to solve any "duplicate" problem caused when using Website Payments Standard module: Simply remove that module and use the more reliable Express Checkout module. Then there will be no race-conditions on ipn_main_handler causing duplicates.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #102
    Join Date
    Sep 2012
    Posts
    2
    Plugin Contributions
    0

    Default Re: Duplicate Orders/Order Confirmation

    Thank you DrByte
    but I prefer to Fix the Problem instead Switching module.


    ok this class will let us to process multiple txn_id's Serial so there wont be "race condition" any more. if it succeed i will share the result.
    PHP Code:
    class process_filelock {
        protected 
    $process_id;
        protected 
    $category;
        protected 
    $additional="Dummy Text";
        protected 
    $process_unq_id;
        protected 
    $active_status_code='ACTIVE';
        protected 
    $file_path='';
        protected 
    $fp;
        
        function 
    __construct() {
            
    $this->set_file_path();
            
    register_shutdown_function(array(&$this"unlock"));
        }    
        function 
    get_file_path(){
            return 
    $this->file_path;
        }
        protected function 
    get_file() {
            return 
    $this->file_path.$this->category.'_'.$this->process_id.'.lock';
        }
        protected function 
    set_file_path() {
            if(
    defined(DIR_FS_CATALOG)){
                
    $this->file_path=DIR_FS_CATALOG.'cache/';
            }else{
                
    $this->file_path='cache/';
            }
            if (!
    is_dir($this->file_path)) {
                
    mkdir($this->file_path,0700,true);
            }
        }

        function 
    lock($process_id,$category='DEFAULT',$additional=''){
            
    $this->process_id=$process_id;
            
    $this->category=$category;
            
    $this->additional=$additional;
            
            
    $file=$this->get_file();
            
    $this->fp fopen$file,"a"); // open it for WRITING ("w") 
            
    if (!$this->fp){
                return 
    false;
            }
            if (
    flock($this->fpLOCK_EX)) {
            
    // do your file writes here
            
    fwrite($this->fpdate("H:i:s"time())." Lock defined on file. \n".$this->additional."\n");
            return 
    true;
            } else {
                return 
    false;
            }
        }

        protected function 
    __destruct() {
            
    $this->unlock();
        }

        function 
    unlock() {
            
    fwrite($this->fpdate("H:i:s"time())." Lock Released on file. \n");
            
    $ret=flock($this->fpLOCK_UN);
            
    fclose($this->fp);
            return 
    $ret;
        }
    }
    class 
    process_paypal_filelock extends process_filelock{
        protected function 
    set_file_path() {if(defined(DIR_FS_CATALOG)){
                
    $this->file_path=DIR_FS_CATALOG.'includes/modules/payment/paypal/locks/';
            }else{            
                
    $this->file_path='includes/modules/payment/paypal/locks/';
            }
            if (!
    is_dir($this->file_path)) {
                
    mkdir($this->file_path,0700,true);
            }
        }

    insert following code after following line
    require('includes/application_top.php');

    PHP Code:
    require('includes/classes/process_lock.php');
    $lock=new process_paypal_filelock();
    $lock->lock($_POST['txn_id'],"PAYPAL_IPN","Note"); 

  3. #103
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Duplicate Orders/Order Confirmation

    But ... if you're really using the Website Payments Standard module, then you have MANY OTHER problems too.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #104
    Join Date
    May 2009
    Location
    Kansas
    Posts
    39
    Plugin Contributions
    0

    Default Re: Duplicate Orders/Order Confirmation

    Quote Originally Posted by alex42 View Post
    Quick fix:
    Remove the javascript function in
    Code:
    includes/templates/[TEMPLATE]/templates/tpl_checkout_confirmation_default.php
    search line 174, and remove the
    Code:
    onsubmit="submitonce();"
    part.
    Doing so, you will lose the functionality, that the user cannot click twice on the submit button, but orders are not doubled any more.
    We are having duplicate orders also.
    I tried the above solution but we just received a duplicate after weeks without seeing one. Could have been a double click this time since I removed that prevention.
    Duplicates have been going on for several months and appear to be totally random.
    We are not using paypal at all we are using CEON manual card. We are also using Edit Orders module among others. And Zen Cart 1.3.9h.
    The only thing that explains the randomness is that it's browser specific as some have mentioned. IE6 or something...

    We are at our wits end to figure this out. Every time it happens we have to tell the customer not to worry...etc.

  5. #105

    Default Re: Duplicate Orders/Order Confirmation

    I have the same problem with duplicate orders. they always occur when an order is made (nothing to do with back to back issues).
    Jamie

  6. #106
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Duplicate Orders/Order Confirmation

    Quote Originally Posted by [email protected] View Post
    I have the same problem with duplicate orders. they always occur when an order is made (nothing to do with back to back issues).
    So ... how about sharing some info about your site? like ZC version and the affected payment module at the very least? Click Reply and then read the questions in the Posting Tips dialog shown above the reply box.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #107

    Default Re: Duplicate Orders/Order Confirmation

    Good point -

    Ceon Sage Pay Server v1.2.2 , Database Version: 1.2.2

    Zen-Cart: v1.3.9h
    Database: MySQL 5.1.70-cll
    HTTP Server: Apache/2.2.24 (Unix)
    mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1
    PHP Version: 5.2.17 (Zend: 2.2.0)
    PHP Memory Limit: 128M
    PHP Safe Mode: Off
    PHP File Uploads: On
    Max Size: 10M
    POST Max Size: 8M
    Database Data Size: 2,269 kB
    Database Index Size: 1,324 kB
    Jamie

  8. #108
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: Duplicate Orders/Order Confirmation

    I know why this happens on Paypal, its actually caused by the customer. I did a test transaction the other day, and on the page after you have confirmed the payment on the Paypal side, it says something like 'you will be returned to {your website} in 10 seconds, if your page doesnt load click here'.

    Basically if you click that link more than once every couple of seconds it will duplicate orders as many times as you click it.

  9. #109
    Join Date
    Oct 2008
    Posts
    32
    Plugin Contributions
    0

    Default Re: Duplicate Orders/Order Confirmation

    So, I was having this same issue for the longest time and none of the posts I could find on here were of any help. Last night, I received 36 (!!!) duplicates of the same order and decided I had enough of this nonsense. About 5 minutes after the orders were duplicated, I also received a very nasty message (sent through my zen cart contact form) from the customer who had thought she was charged a whole bunch of times (she wasn't, just once but she got 36 order confirmation emails as well so was alarmed). ANYWAYS I finally figured out what the issue was because it just so happened that her contact form message was also sent to me NUMEROUS times. It then crossed my mind that this could be an email issue.

    I did a bunch of test orders and noticed that after clicking my "confirm order" button, the site was SOOOOOOO slow. I'm pretty sure that either:
    a) the customers just get fed up and press the button a bunch of times if it's taking too long to connect to the mail server as it looks like the website isn't doing anything.
    b) there is an issue with my mail server and it continuously loops or something while trying to submit the order, causing it to go through too many times.

    I decided to change the email settings from PHP to sendmail and voila! My checkout was much faster which resulted in only having to press the Confirm Order button once, which resulted in no more duplicate orders.

    So long story short, try changing your email settings.

  10. #110
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: Duplicate Orders/Order Confirmation

    Quote Originally Posted by evenangelsdie View Post
    I did a bunch of test orders and noticed that after clicking my "confirm order" button, the site was SOOOOOOO slow. I'm pretty sure that either:
    a) the customers just get fed up and press the button a bunch of times if it's taking too long to connect to the mail server as it looks like the website isn't doing anything.
    b) there is an issue with my mail server and it continuously loops or something while trying to submit the order, causing it to go through too many times.
    Yes, that kind of confirms what I found above, the user doing it.

 

 
Page 11 of 14 FirstFirst ... 910111213 ... LastLast

Similar Threads

  1. Replies: 3
    Last Post: 27 Apr 2015, 03:47 AM
  2. Duplicate order detection misidentifies orders as duplicates
    By Atash in forum Managing Customers and Orders
    Replies: 3
    Last Post: 21 Jan 2013, 12:37 PM
  3. No order details and duplicate orders??
    By sailsport1 in forum PayPal Website Payments Pro support
    Replies: 8
    Last Post: 6 Jun 2011, 09:06 PM
  4. Duplicate Order Confirmation Emails
    By chrismarie in forum General Questions
    Replies: 2
    Last Post: 15 Mar 2010, 05:02 PM
  5. Replies: 49
    Last Post: 23 Feb 2010, 08:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR