| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,074
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Process paypal IPN with cURL I was recently creating a script to process IPN payments from paypal. I tried using the fsockopen approach that paypal suggest but it was failing all of the time so I decided to use cURL. The following maybe of use to you (it is of course not complete you will have to do the checks, read the comments). PHP Code: If you need help in carrying out the checks feel free to contact me and I will work on a more comprehensive tutorial. The paypal ipn manual is located at:- https://www.paypal.com/cgi-bin/websc...manual-outside The manual lists all of the parameters and these will be available in the $_POST global array
Last edited by Peter; 03-17-2007 at 03:15 AM.
|
| |
| | #2 (permalink) |
| Senior Member Join Date: Jan 2006 Location: Portland, Oregon
Posts: 2,100
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | So basically you put this as the return link in the paypal button, and it will check to see if it was paid or not? What do you mean by: Code: // Do some checks to ensure that the payment has been sent to the correct person
// Check and ensure currency and amount are correct
// Check that the transaction has not been processed before
// Ensure the payment is complete
__________________ HostingFuze.com Premium Master Reseller Services | 99.9% Uptime Guaranteed SLA | Starting at $4.95/mo Basic Reseller Hosting @ HostFz.com - Services starting as low as $1.95/mo! |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,074
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | No the if statement confirms it is a genuine transaction. If the user uses an echeck paypal will send a notice to say payment initiated which will chow as VERIFIED but echeck payments are not actually completed for a few days. Regarding what you put the url as. You can either enter the address the script would be at in the admin panel of paypal or you can use the following in your payment form:- <input type="hidden" name="notify_url" value="http://www.you.url/script_name.php" /> |
| |