Best practice for canceling an MVC Order

Coreysan 1,811 Reputation points
2025-01-13T00:06:40.7166667+00:00

I have a store that will not require logging in. A customer can order as a guest, and fill in their shipping details, etc.

(Payment is Paypal. ) If a customer cancels Paypal and disconnects, I would remove their data, but exactly how would I know they canceled? What's a good way to know?

One idea I have is to fetch some kind of token from Paypal if they paid. If they didnt pay, then I could remove their data. But what if they are still connected, and they are just being undecided for a half hour?

I ask because I was using session data, where I only persisted if they paid. But MVC is good at persisting data, and now I don't know whats best.

To persist or not to persist...that is the question!

Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | .NET | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,926 Reputation points Volunteer Moderator
    2025-01-13T17:16:02.57+00:00

    its up to you. it common to save an anonymous carts for days or weeks, so the user can come back and complete their order. as the cart takes disk/database space, you need to decide how long to keep.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.