Author Topic: Bug? Strange behaviour order numbers  (Read 389 times)

suvel

  • Beginner
  • *
  • Posts: 11
Bug? Strange behaviour order numbers
« 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


rjcroasdale

  • Jr. Member
  • **
  • Posts: 75
    • Marketing Consultants
Re: Bug? Strange behaviour order numbers
« Reply #1 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! (^_^)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9838
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Bug? Strange behaviour order numbers
« Reply #2 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,..
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/