logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
jdepoy24549696  
#1 Posted : Thursday, July 21, 2022 2:59:32 PM(UTC)
jdepoy24549696

Rank: Advanced Member

Groups: Authorized User, Developers, Registered
Joined: 4/17/2019(UTC)
Posts: 80

On a 9.0.2 installation there are occasionally missing order numbers. What causes this?
missing orders

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

Katie S  
#2 Posted : Friday, July 22, 2022 12:37:34 PM(UTC)
Katie S

Rank: Advanced Member

Groups: System, Administrators, Developers, Registered, HelpDesk
Joined: 10/29/2018(UTC)
Posts: 472

Thanks: 4 times
Was thanked: 34 time(s) in 33 post(s)
Hi,

If you review the Checkout Settings on the Configure > Store > General page, there are 3 options available under Order Payments:

Order Payments -

- Do not create order unless it has a successful payment
- Always create order even if payment fails
- Create order and allow partial payments or multiple payments

If the 3rd setting is selected, the behavior, when this happens, is that an order number (id) is generated for the failed payment. The customer is given additional opportunities to complete the payment. For each attempt, the order number (id) is incremented. So, it can look like a gap in order numbers from the admin side.

Let me know if you have any questions,
Thanks for your support!

Katie
Secure eCommerce Software and Hosting
thanks 1 user thanked Katie S for this useful post.
sweeperqb on 7/22/2022(UTC)
jdepoy24549696  
#3 Posted : Friday, July 22, 2022 12:42:25 PM(UTC)
jdepoy24549696

Rank: Advanced Member

Groups: Authorized User, Developers, Registered
Joined: 4/17/2019(UTC)
Posts: 80

Hi katie,
Thanks for your reply. I looked at the store's settings and the 2nd option is selected: "Always create order even if payment fails".

That's why I'm confused. I thought that the first failure would just create an order with a "Pay now" button. I don't understand why there would be multiple attempts and missing numbers.
Katie S  
#4 Posted : Friday, July 22, 2022 1:07:59 PM(UTC)
Katie S

Rank: Advanced Member

Groups: System, Administrators, Developers, Registered, HelpDesk
Joined: 10/29/2018(UTC)
Posts: 472

Thanks: 4 times
Was thanked: 34 time(s) in 33 post(s)
Sorry, but I had it backwards, you are correct. I just retested each of the settings to confirm.

Quote:
- Create order and allow partial payments or multiple payments


This setting will display the payment amount in an editable field. When you pay a partial amount, the order is created and you will see a Pay Now button on the receipt/invoice.

Quote:
- Always create order even if payment fails


Using this option will keep you on the checkout payment page with the same order number. The customer can make additional attempts to pay for the order and the number is the same.

Quote:
- Do not create order unless it has a successful payment


This option is the one that will result in an order gap for each failed transaction. If the payment Tx never happens successfully, then no order is created.

Let me know if you have any questions,




Thanks for your support!

Katie
Secure eCommerce Software and Hosting
jdepoy24549696  
#5 Posted : Friday, July 22, 2022 2:44:37 PM(UTC)
jdepoy24549696

Rank: Advanced Member

Groups: Authorized User, Developers, Registered
Joined: 4/17/2019(UTC)
Posts: 80

I still don't understand:
They have selected "Always create order even if payment fails"

And above you say:
Using this option will keep you on the checkout payment page with the same order number. The customer can make additional attempts to pay for the order and the number is the same.

So why are there number gaps?

Edited by user Friday, July 22, 2022 2:55:24 PM(UTC)  | Reason: Not specified

ray22901031  
#6 Posted : Saturday, July 23, 2022 4:09:27 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
I remember asking the same question 25 years ago when I was using a product call storefront. That software was notorious for creating tremendous gaps in the order numbers. This was a major concern for us from an accounting perspective that I will discuss below.

The Internet works on a stateless protocol, it attaches to its source, and then it disconnects. It only reattaches to the source if it needs additional information, or you are sending information back to the source. Each additional connection is treated as a new connection from the server's perspective, what holds everything together is usually a session ID.

Although I have not reviewed the source code, I'm pretty certain that the order number is created during the first commit. (When the table is in insert mode, not edit mode). This makes sense because after the first commit, triggers are generated and the order ID needs to be assigned at this point. You don't want emails going out without order IDs.

It is possible while multiple commits are occurring, that a rollback is instigated, or the initial commit to the database fails, and it tries again to commit to the database. It is possible at this point that a gap will appear.

So many things that can occur when dealing with a stateless protocol, where hiccups can indeed occur. The only true sequential numerator that you're ever going to find is the auto ID, or the increment integer field that is actually controlled by the SQL Server itself. This is significant from an accounting standpoint.

If you're ever audited by either federal or state, they are looking for order numbers that are sequential with no gaps. If they detect fraud, they will assign value to the missing orders and hold you responsible.

Let's face it, government agencies are not up-to-date on newer technology. The Lifesaver here is the auto ID or the increment integer field that is assigned by the server itself. This will always show, at lease it should, a sequence numerical sequence without gaps. But this will only hold true, if you do not delete orders. If you do, and they detect fraud, well, you're just screwed.

This is why we do not delete orders, we cancel them. So in the event of an audit, I can always show a numerical sequence without interruption.

Is there a way for the order ID to be sequential without interruption? The answer would be yes, but it would involve committing the row first, then putting the row in edit mode, grabbing the auto ID or the integer field control by the database and adding a custom value. But of course if things are triggered right after an initial commitment, you're gonna run into problems.

I understand where you're coming from, I like everything in order, and from an accounting perspective, it's a lot easier to keep track of. I wonder if it would be a good idea, if you would introduce the auto ID somewhere in your order print out, let's say as a tracking ID.

Anyway, when working with a stateless protocol, so many factors are involved that these types of occurrences will happen.

I hope this helps.
-Ray
shaharyar  
#7 Posted : Monday, July 25, 2022 3:53:03 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)

Quote:
On a 9.0.2 installation there are occasionally missing order numbers. What causes this?


I am able to reproduce.

- Select "Do not create order unless it has a successful payment" from the admin - store - configure page.
- Go to the checkout payment page submit the form and make sure the payment is failed. (I did it by using incorrect gateway credentials).
- Now use the correct credentials and again submit from the payment page. This time the order is created but an order number is skipped.
Katie S  
#8 Posted : Tuesday, July 26, 2022 12:40:09 PM(UTC)
Katie S

Rank: Advanced Member

Groups: System, Administrators, Developers, Registered, HelpDesk
Joined: 10/29/2018(UTC)
Posts: 472

Thanks: 4 times
Was thanked: 34 time(s) in 33 post(s)
Quote:
I still don't understand:
They have selected "Always create order even if payment fails"

And above you say:
Using this option will keep you on the checkout payment page with the same order number. The customer can make additional attempts to pay for the order and the number is the same.

So why are there number gaps?


I tested again with this setting and it stayed on the payment page. I entered 4 invalid payments and it stays on the payment page. With the final valid payment, the order was created and there are no gaps between the last order and this one.

I am testing on 9.0.6, our latest version so maybe there is a bug in 9.0.2?


Thanks for your support!

Katie
Secure eCommerce Software and Hosting
Users browsing this topic
Guest (4)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.