Paypal Standard IPN Return Variable When Order Is Cancelled
I'm using Paypal Standard as the payment. If a user cancels does Paypal send custom variable back?
Here's the current workflow
- Page 1 - User creates listing
- Page 2 - User previews listing
- Page 3 - Display total cost for the listing and if they hit pay it will redirect to Paypal
- Post is inserted into the database and Paypal custom variable is sent
- We send "custom" variable 开发者_C百科to Paypal and if user is successful it will return the "custom" variable back and enable the listing by changing the status in the database.
Does Paypal send the custom variable back when user decides to hit cancel? I want the variable to come back and delete the listing from the database.
As far as I know paypal IPN only sends data when an event occurs: Completed, refunded, etc...
What you can do is create a new field in your table called status with a default value of 0 and a timeStamp. When a user complete's payment, set that field to = 1.
Then, to weed out incomplete orders you can setup a CRON job that goes through your DB every few days and removes/archives rows that have WHERE status=0 AND timeStamp < '$today'
.
精彩评论