Re: Advise needed to change the format of INVNUM, to fight duplicated orders?
Update. I received two duplicated submission cases over the weekend. Both are intercepted by this mod in this thread properly. No duplicated payments are received. Now I'm using 120s (2m) delay time.
Case #1
2023-04-29 12:15:34 INVNUM 14023207
DoDirectPayment, Elapsed: 3159ms -- Success
2023-04-29 12:15:34 INVNUM 14023207
DoDirectPayment, Elapsed: 3640ms -- Failure
2023-04-29 12:15:35 INVNUM 14023207
DoDirectPayment, Elapsed: 3832ms -- Failure
Case #2
2023-05-01 08:12:26 INVNUM 14024526
DoDirectPayment, Elapsed: 3060ms -- Success
2023-05-01 08:12:28 INVNUM 14024526
DoDirectPayment, Elapsed: 2460ms -- Failure
2023-05-01 08:12:28 INVNUM 14024526
DoDirectPayment, Elapsed: 2777ms -- Failure
2023-05-01 08:13:43 INVNUM 14024526
DoDirectPayment, Elapsed: 2512ms -- Failure
Re: Advise needed to change the format of INVNUM, to fight duplicated orders?
Quote:
Originally Posted by
njcyx
Done. Here is the link for my PR. Actually it is my first time to submit a PR...lol.
Thanks for doing this - hopefully we'll see more PRs from you in the future!
Re: Advise needed to change the format of INVNUM, to fight duplicated orders?
Update again: I just changed the INVNUM interval back to 60s. I used the 120s interval in the past two months. I haven't received any duplicated orders and this trick didn't trigger as designed. But I received two "Friendly Fire" in this period: two customers tried to checkout with credit card (OPC) in two minutes, so later transaction was blocked.
I started to think, this issue may be due to the ISP/server, since I didn't change paypal code other than INVNUM. Not sure.
Re: Advise needed to change the format of INVNUM, to fight duplicated orders?
60 might be the right balance of risk and reward.
Re: Advise needed to change the format of INVNUM, to fight duplicated orders?
Possibly yes. I used 60s in my PR.
As it is said, "The first draft is always perfect"...lol.