News:

Looking for documentation? Take a look on our wiki

Main Menu

Bug? Strange behaviour order numbers

Started by suvel, January 02, 2019, 11:33:55 AM

Previous topic - Next topic

suvel

Joomla 3.9.1
VM 3.4.2.9966
php 7.2

Noticed the following strange behaviour: ordernumbers are missing, identical index numbers at ordersnumbers and empty order records appear at order list.

This can be reproduced by: (some shoppers will do this  :( )
- Confirm order and go to payment provider.
- Do not complete the payment but use history back from browser to go back to shopping basket
- Confirm again and finish the payment

What happens:
- After second confirmation, index number of ordernumber increased (eg xxxx001 --> yyyy002), order record id is still the same.
- Because of first started payment, after a while, payment provider will give webhook expired status for ordernumber xxxx001
- Ordernumber xxxx001 (record id =1) is not present anymore and therefore ghostrecord (completely empty) is generated by VM. Designer of payment plugin ccIdeal has now added a check to prevent this (Excellent support by ccIdeal  :) ).
- Ordernumber yyyy002 (record id =1) is completed normally
- Next order (record id = 2) will get ordernumber zzzz002 (same index number as previous order). Index number is generated by VM by counting records and in this case there is only 1 record present, so next index number will be 2.

How to prevent identical index numbers for ordernumbers? Can not forbid shoppers using the history back function of the browser  :P


Thx,
Ronald


rjcroasdale

Interesting, I had the same duplicate number segment issue on a couple of orders yesterday. Thank you for the report! (^_^)

Milbo

Hmm the line

$_orderData->virtuemart_order_id = $this->reUsePendingOrder($_cart);

or better said the function "reUsePendingOrder" should prevent that.

I wonder a bit about this
- Because of first started payment, after a while, payment provider will give webhook expired status for ordernumber xxxx001

I mean, good idea to send that, but it should not affect the order, maybe it changes the order status or so,..
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/