VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: suvel on January 02, 2019, 11:33:55 AM

Title: Bug? Strange behaviour order numbers
Post by: suvel on January 02, 2019, 11:33:55 AM
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

Title: Re: Bug? Strange behaviour order numbers
Post by: rjcroasdale on January 10, 2019, 07:45:35 AM
Interesting, I had the same duplicate number segment issue on a couple of orders yesterday. Thank you for the report! (^_^)
Title: Re: Bug? Strange behaviour order numbers
Post by: Milbo on January 16, 2019, 13:56:37 PM
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,..