Click here to Skip to main content
15,885,137 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi All,

I am facing a problem in my application. It's an online shopping portal.
Problem is:
- When a customer choose an item to purchase, it's added to his wishlist. he had some problem to
make payment.
- Now he calls Customer care to purchase ahead.
- At same time he again login to application and tries to make payment.
- So there are 2 persons (Call center user and Customer) trying to make payment for same item.
- Now Call center user does it first and receive a Thank You message.
- Meanwhile Customer also reached to payment gateway and made payment.
- Therefore 2 payments have been done for the same item.
- Payment gateway is 3rd party site so we can not mandate user there.

Is there any solution to allow only the current user(who is is making payment)to proceed and lock other sessions?

Please advise.
Posted
Comments
tanweer 14-Oct-13 1:45am    
hi, let me know do you have any success message from the 3rd party after payment successfull?
chandrayog.2 14-Oct-13 1:49am    
yes, we receive a success token from third party. based on that we redirect user to thankyou page or payment failed page.

Regards,
Chandra
tanweer 14-Oct-13 1:54am    
then I suggest you to sore this success/failure message in your database for this transaction ID and lock it for other user to make any transaction for the same trnsaction
chandrayog.2 14-Oct-13 2:16am    
Problem is that 2 users are reaching to payment portal simultaneously before the token received. til the time our application page loads, 2 payments have been done.
any other suggestions??
chandrayog.2 14-Oct-13 2:47am    
yeah,i am also thinking the same but is there any other solution like using application variable, session IDs, anything where DB table not require?/

1 solution

Unfortunately there is no magic bullet solution. You'll have to write code to see if a similar order was placed recently and then perhaps warn the user. For example, the user could purchase the item and then decide they want another one so they purchase again. That would be valid but your code wouldn't know.

Probably the best way is to have a shopping card table with an ID and when the customer service rep pays for it the shopping card is emptied and an order created. So, when the user goes back online he no longer has a valid shopping cart.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900