Results 1 to 10 of 15

Threaded View

  1. #1
    Join Date
    Apr 2019
    Posts
    254
    Plugin Contributions
    0

    Default Advise needed to change the format of INVNUM, to fight duplicated orders?

    Zen cart 1.57d, php7.4

    one-page checkout 2.4.5. Paypal express & paypal payment pro

    We received intermittent duplicated orders when customer paid by credit card/paypal payment pro, like once per week. And it seems getting worse and worse. One pattern I noticed that, in the paypal log files of those duplicated orders, the INVNUM or order number are very close to each others (1s difference or so). PayPal has a function to auto-deny the transaction if both transactions have the same INVNUM numbers.

    Here is the github link for paypalwpp.php I'm currently using:

    https://github.com/zencart/zencart/b.../paypalwpp.php

    I did some search and INVNUM is related to line 396 as the following:

    $options['PAYMENTREQUEST_0_INVNUM'] = (int)$_SESSION['customer_id'] . '-' . time() . '-[' . substr(preg_replace('/[^a-zA-Z0-9_]/', '', STORE_NAME), 0, 30) . ']'; // (cannot send actual invoice number because it's not assigned until after payment is completed)

    In the log file I received, INVNUM is like 1095xx-167700xxxx-[webstore] So the 10-digit middle section of the current INVNUM is generated via time().

    I changed this line to the following code and I expected the new INVNUM format is like 1095xx-167700xx-[webstore]. So the middle section will be 8 digit only.

    $options['PAYMENTREQUEST_0_INVNUM'] = (int)$_SESSION['customer_id'] . '-' . (floor(time()/60)) . '-[' . substr(preg_replace('/[^a-zA-Z0-9_]/', '', STORE_NAME), 0, 30) . ']'; // (cannot send actual invoice number because it's not assigned until after payment is completed)

    However, it doesn't work. By my new test, INVNUM format is unchanged (verified in paypal side and the log files).

    So what is the proper way to change the format of INVNUM value? Any suggestions are appreciated.
    Last edited by njcyx; 22 Feb 2023 at 03:57 AM.

 

 

Similar Threads

  1. ZJ Black Template advise needed
    By mlamme in forum Addon Templates
    Replies: 0
    Last Post: 17 Feb 2010, 01:04 PM
  2. Replies: 0
    Last Post: 14 Apr 2008, 08:54 PM
  3. Change the format of strikethrough
    By eaglewu in forum General Questions
    Replies: 0
    Last Post: 10 Feb 2007, 05:07 AM

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