Following on from this question here, how does one reserve a product in a shopping cart when a user goes to pay? What if the user abandons the purchase and does not come back to your site, how will you unreserve the product if the page is not being reloaded. For that matter how would you reserve the product in the first place? I am creating a cart using php mysql and using paypal web payments standard. Thanks
相关问题
- Get payment by transaction ID using PayPal API
- Paypal Rest API SDK v2
- Paypal Express Checkout - You are calling paypal.c
- PayPal REST API cross reference transaction with p
- PayPal Payments Advanced — Validate Parameters Sen
相关文章
- php paypal. A way to validate a payment before acc
- Paypal IPN Script, issue with feof and fgets
- Google Forms PayPal Express Integration
- Recurring payment for Paypal Android SDK
- Paypal web payments standard - Refunds. Can they b
- Using Objects in PAYPAL PHP REST API SDK
- django-paypal IPN signals not being received
- How to check email or mobile phone paypal account
I too need this answer, with asp.net and MS Sql. Problem being, you need to flag the SQL record in order to avoid others reserving the item at the same time, but if the first user closes the browser there is no way to unreserve the item in sql...
A clean solution that works well for us is to use an "internal order" type system. The product table would hold the product details as well as the stock on hand. When a user reserves the product we treat it as an internal order, so in an order table you'll have the item that the user has reserved and the date and time that it was reserved. You can then decrease the stock quantity in your product table based on the number of units the user has reserver.
Then you can on the nightly basis for example check for internal orders that have not been converted to invoices and subsequently remove them from the database increasing the stock quantity in your product table based on the number of units that were reserved but not invoiced.
If a use however ends up completing the purchase the item is simply converted to an invoice. We use the same table for both invoices and orders in some instances with a simple field that specifies whether the record is an invoice or simply an internal order.
You can create a cron job that will run periodically and check if there are any reserved items that have not been paid for in time (for example, within 24 hours from reservation).