Hi there, iv setup paypal buttons to purchase a service that needs to be activated if the payment was successfull. However i am unsure how to check if payment failed or not. If anyone can give me some clear advice on how this would be done, it would be greatly appreciated.
Page 1 of 1
Paypal Payment Fail or Success PHP how to find out if payment was successful
#2
Posted 01 December 2011 - 02:07 PM
You'll need to read up on paypal IPN (Instant Payment Notification). Once a payment is complete, paypal IPN will provide a silent callback, which is what you need.
This website might be able to help https://www.paypaltech.com/SG2/
This website might be able to help https://www.paypaltech.com/SG2/
#3
Posted 01 December 2011 - 02:15 PM
Thank you very much, iv created the custom script you get at the end, but what do i do with that now?
#4
Posted 01 December 2011 - 02:19 PM
Read up on IPN and you should be able to work out everything you know, it's not difficult.
http://designertuts....eb-application/
http://designertuts....eb-application/
#5
Posted 01 December 2011 - 02:24 PM
Think iv just got it. Nice one, thanks very much for all your help!!
#7
Posted 10 December 2011 - 05:29 PM
A few rules for IPN:
- Try to avoid specifying your callback urls within hidden forms fields - that will lead to abuse. I've come across sites where I can confirm an order and recieve a order paid email simply from viewing the source on the payment pages and pasting the ipn callback url into the browser - not a good thing really!

- IF you do specify urls in your form as hidden fields, for the love of all things holy, don't rely on querystring data E.g. do not have your ipn url like: site.com/ipn.php?ConfirmOrderRef=123456789
- During the IPN script do check the data PayPal sends you it was you expect. So check if the order id exists, check that amounts mtahc, check the payment status
- IF you are using the same PayPal account for multiple purposes be very warey. For example, if using it for eBay too you'll notice a "for_auction" variable get sent back - you'll most likely want to filter thewse out - there are a few more payment types
- Check the referer - this should really only be PayPal for your purposes
- Check the IPN version - these do change sometimes
Share this topic:
Page 1 of 1
Help















