What methods are generally employed to handle checkout processes that involve unique items?--Selling paintings, for example. Some pitfalls maybe:
- A buyer purchases an item before a slower buyer is able to complete the checkout process.
- A buyer attempts to purchase an item that has already been purchased.
I thought of a couple of approaches.
Do away with the shopping cart and reserve items
Buyers would purchase items individually without adding them to a shopping cart. When a buyer visits the checkout page, the item is reserved. If we navigates away, the item is released.
- Minimises race conditions because buyers must decide whether to buy, and consequently items do not spend any time in a cart.
- It requires separate checkout process for each purchase.
- If payment method is handled on an external site (PayPal) there's a risk that buyers will not navigate back to the site and buy more items.
- Requires extra logic for reserving/releasing items.
Using a Cart
Allow users to add items to their cart. Upon checkout, verify inventory.
- Allows buyers to purchase multiple items in a single checkout.
A bigger chance to have race conditions where the cart becomes stale as some of its contents get purchased by other buyers.
Requires an elegant way of notifying the buyer that some of the items in the cart are no longer available.
Opportunity to reserve items is minimal since time spent before checkout varies from buyer to buyer. Also, putting an expiration on a shopping cart could pressure and put off buyers.
Are there other ways to handle this type of situation? Can you see further advantages pitfalls in either approach?