Customer received wrong transaction number
Hi all,
I encountered a strange problem with our shopping cart today. We had two transactions that occured around the same time. Let's say, customer A was assigned transaction number 100 and customer B transaction number 101. Both transactions were saved into the database correctly. However, customer B received an email confirmation stating that his transaction number is 100. The details of his transaction in the email are correct, only the transaction number is mixed up.
Here's roughly the code:
// get transaction number
transNum = salesCFC.createTransactionNumber()
// save shopping cart into db
salesCFC.saveTransaction( transNum, session.shoppingBagObj)
// email customer
<cfmail from="" to="" subject="Transaction Number #transNum#">// shopping bag printout
</cfmail>
transNum is a local-scoped variable.
I have been scratching my head to understand how this happened. We only discovered this issue because customer B wanted to cancel his transaction and he gave the transaction number belonging to customer A. We checked our sent mail folder and sure enough both customers received confirmation emails with the same transaction number.
Is it possible that customer B's transNum variable got corrupted and crossed with customer A's transNum?
