Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2015
    Posts
    36
    Plugin Contributions
    0

    Default Taxcloud and Duplicate Orders

    Zen Cart: 1.5.5f
    PHP: 7.1.29
    Payment Modules : Paypal Express & Heartland


    I installed the TaxCloud code and I've been having an intermittent issue with duplicate orders.

    The issue has occurred with both payment modules and for states that collect sales tax and states that don't.

    No PHP errors.

    I'm not able to recreate a double order myself.

    It appears as though the users arrive at the checkout confirmation and start circling back to the site.

    I disable the paypal express button because I noticed those users tend to leave the confirm page from time to time to edit their shipping information.

    Since I have done that I'm not seeing any duplicates with paypal but that could just be based on user behavior going forward I guess.

    Also, the orders can be as far apart as a couple minutes in time (time stamp). They aren't 4 to 5 seconds apart.

    I noticed while the customer is getting charged for both orders, zen cart is not posting the data back from the payment processor (authorization code, etc)

    I don't have any redirect plugins and the cart was trouble free before the taxcloud installation.

    Over 90% of the time, it works great.


    I'm a hack at best when it comes to code.

    Is there something I should be looking at specifically.

  2. #2

    Default Re: Taxcloud and Duplicate Orders

    Have you had any luck tracking down the source cause of the duplicates (redundant) Lookups?

    Let us know if we (TaxCloud) can help.

    -David

  3. #3
    Join Date
    Jun 2015
    Posts
    36
    Plugin Contributions
    0

    Default Re: Taxcloud and Duplicate Orders

    I have not had any luck.

    I did just observe a customer that was logged in with 2 different Session IDs.

    One Session ID had one item in the cart.

    The second Session ID had 2 items (one of the items was the same as in the first Session ID)

    I observed all of this on the Who's Online page in real time by chance.

    It looks like they are getting to the checkout confirmation page (where paypal drops you back off or where the credit card information is entered (heartland plugin).

    Then they circle back through the site and that create some kind of loop and they end up with another Session ID. Another Session ID meaning a second instance of the same customer with a different Session ID.

    This one particular customer circled back to add an item.

    I can't recreate this but the pattern is that any duplicate orders have all landed on the Checkout Confirmation and then started shopping again or they go into their address information.

    The customer I observed never checked out so I don't have 2 invoices but I believe what I observed would have resulted in at least 2 submitted orders. They bailed out of the cart for whatever reason, but not during the checkout process.

  4. #4
    Join Date
    Jun 2015
    Posts
    36
    Plugin Contributions
    0

    Default Re: Taxcloud and Duplicate Orders

    I think I finally figured out what is causing my issue (duplicates and unfinished orders that are still charged).

    My problem is caused by customers who enters a 9 digit zip code.

    includes/modules/TaxCloud/func.taxcloud.php

    Line 91

    function func_taxcloud_get_customer_address($delivery) {
    // Customer's address
    $destination = new Address();
    $destination->setAddress1($delivery['street_address']);
    $destination->setAddress2('');
    $destination->setCity($delivery['city']);
    //$destination->setState($delivery['state']); // Two character state appreviation
    $destination->setState($delivery['state_code']); // Two character state appreviation
    $destination->setZip5($delivery['postcode']);
    $destination->setZip4('');
    return $destination;

    I just had a customer who had a few failed attempts, then changed his Shipping Postal Code, and the sale the went through.

    This array works fine is there is a five digit zip.

    I don't see any code that checks the length of postcode or manipulates the postcode in any way to prepare it for formatting.

    I just took a look at the latest version of the TaxCloud plugin and the code is the same.

    Am I missing something, or am I making sense?

  5. #5
    Join Date
    Jun 2015
    Posts
    36
    Plugin Contributions
    0

    Default Re: Taxcloud and Duplicate Orders

    I was a little vague.

    The customer was initially trying to make a purchase with a 9 digit zip code. After some failed attempts he changed his shipping address to a 5 digit zip code.

    Sorry.

  6. #6
    Join Date
    Jun 2015
    Posts
    36
    Plugin Contributions
    0

    Default Re: Taxcloud and Duplicate Orders

    I just made this change and tested it:

    function func_taxcloud_get_customer_address($delivery) {
    // Customer's address
    $destination = new Address();
    $destination->setAddress1($delivery['street_address']);
    $destination->setAddress2('');
    $destination->setCity($delivery['city']);
    //$destination->setState($delivery['state']); // Two character state appreviation
    $destination->setState($delivery['state_code']); // Two character state appreviation
    //$destination->setZip5($delivery['postcode']);
    $destination->setZip5($trunczip = substr($delivery['postcode'], 0, 5));
    $destination->setZip4('');
    return $destination;

    I don't really know much about php (or posting on a forum) but this appears to be working.

    I think this is an ugly hack because I'm not seeing an other examples of string manipulation being done inside of any array.

  7. #7
    Join Date
    Jun 2015
    Posts
    36
    Plugin Contributions
    0

    Default Re: Taxcloud and Duplicate Orders

    sorry for all the post

    the code change I made with the substring failed further testing.

    I just didn't want anyone to think it worked.

  8. #8
    Join Date
    Jun 2015
    Posts
    36
    Plugin Contributions
    0

    Default Re: Taxcloud and Duplicate Orders

    Sorry to keep bumping my own thread, but I think I found a solution.

    I'm using Zec 1.5.5f.

    I think this code works for that and the 1.56c version.

    I think I have fixed the problem I was having with customers who were using 9 digit zip codes.

    includes/modules/TaxCloud/func.taxcloud.php

    Line 91
    function func_taxcloud_get_customer_address($delivery) {
    // Customer's address
    $destination = new Address();
    $destination->setAddress1($delivery['street_address']);
    $destination->setAddress2('');
    $destination->setCity($delivery['city']);
    //$destination->setState($delivery['state']); // Two character state appreviation
    $destination->setState($delivery['state_code']); // Two character state appreviation
    $destination->setZip5($delivery['postcode']);
    $destination->setZip4('');
    return $destination;
    }

    I added some code to handle a zip code longer than 5 digits and pass it back to the taxcloud api correctly

    function func_taxcloud_get_customer_address($delivery) {
    // Customer's address
    $destination = new Address();
    $destination->setAddress1($delivery['street_address']);
    $destination->setAddress2('');
    $destination->setCity($delivery['city']);
    //$destination->setState($delivery['state']); // Two character state appreviation
    $destination->setState($delivery['state_code']); // Two character state appreviation
    $fullzipcode = trim($delivery['postcode']);
    if (strlen($fullzipcode) > 8){
    $fivedigitzip = substr($fullzipcode,0,5);
    $fourdigitzip = substr($fullzipcode,-4);
    $destination->setZip5($fivedigitzip);
    $destination->setZip4($fourdigitzip);
    } else {
    $destination->setZip5($delivery['postcode']);
    $destination->setZip4('');
    }
    return $destination;
    }

    I test for > 8 because I will get a customers who omits the hypen when using a 9 digit zip.

 

 

Similar Threads

  1. v151 Duplicate Orders with PayPal Payments Pro and COWOA
    By damon in forum Addon Payment Modules
    Replies: 2
    Last Post: 17 May 2013, 12:10 AM
  2. 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
  3. Duplicate Orders (Paypal IPN and GV/DC)
    By barrow_matt in forum Managing Customers and Orders
    Replies: 3
    Last Post: 24 Nov 2010, 12:03 AM
  4. Duplicate Orders with Same Order Number and Different Totals
    By sfuredi in forum General Questions
    Replies: 1
    Last Post: 3 May 2010, 04:59 AM
  5. Paypal IPN, Duplicate and empty orders
    By richtom80 in forum Managing Customers and Orders
    Replies: 1
    Last Post: 12 May 2008, 09:20 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