[PHP]PayPal IPN Script

Just put the code in a hidden area. You aren't supposed to access, or use the code directly...

On your form that you're using to complete the payment process, use something like this..

PHP:
<form method="post" name="paypalConfirm" action="http://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="custom" value="xx"/>
<input type="hidden" name="business" value="xx"/>
<input type="hidden" name="return" value="xx"/>
<input type="hidden" name="cancel_return" value="xx"/>
<input type="hidden" name="notify_url" value="URL_TO_IPN"/>
<input type="hidden" name="item_name" value="xxx"/>
<input type="hidden" name="amount" value="xxx"/>
<p><input type="submit" value="Click Here To Confirm - Paypal Payment"></p>
</form>

Where it says "URL_TO_IPN" you put the URL where your IPN is, and it will the IPN will do it's work from thereon.

Aaron
 
LOL that ipn gateway sucks balls, no security at all, Ican pay 0.1 euro and still get the shiet iwant. anyway good job anyway
 
Last edited:
A very, very conventional method to implement PayPal's IPN service (indeed, the code provided on the OP is almost an abstract of the code samples PayPal provided - and they were developed back then for PHP 4!)

I would strongly recommend using PayPal Express checkout which I have utilised for several of my clients.
 
yeah if you want a proper IPN script you want to check wether gross payed is same as item amount in price or you can bye stuff for anyprice you like
im pretty expreianced at IPN scripts and best way to set up IPN is in paypal profile pannel that way its one less line of code

i can supply anyone with IPN script if they like with all the safe gaurds with it
 
yeah if you want a proper IPN script you want to check wether gross payed is same as item amount in price or you can bye stuff for anyprice you like
im pretty expreianced at IPN scripts and best way to set up IPN is in paypal profile pannel that way its one less line of code

i can supply anyone with IPN script if they like with all the safe gaurds with it

You can only set one IPN in your paypal account. If you run multiple sites, sending the IPN url allows you to use multiple IPN's.
 
I would like to make a addition, don't try this on xampp or wampp because it won't work. I tried that as well but you cannot get a respons from the server when you use your localhost, it will most likely work when you use your own ip when you forwarded port 80.
An other addition: Use the paypals test page, they have a special test environment for this. Look it up on google as I do not remember the link, but I thought it was something with developers.paypal.com or so.
It is a very nice system the paypal ipn, I got it to work as well.
 
And curl if it's not enabled by default. :tongue:
Tho who uses xampp, wamp, etc?

What do you use? I use a LAMP installation on a Debian machine dedicated to being a server and cloud over our router. For anyone who doesn't know, LAMP is actually a separately installed collection of Linux, Apache, MySQL and PHP. I also have many other things such as PostgreSQL and Python2.6/Py3k... SSL works, etc. Anything you'd expect from a Debian server except cPanel/WHM.

For windows I obviously wouldn't be serious about development, so I'd probably use some generic sloppy Apache server like XAMPP or WAMP..

The computer doesn't really have a monitor, but it's hooked up to the HDTV in case I want to watch movies on any computer connected to the router without hooking it up to the TV each time... I should probably improve the video card some day, but that's not what the PC was really designed for anyway, it just kinda works since the router is by the TV.. (cable internet)
 
What do you use? I use a LAMP installation on a Debian machine dedicated to being a server and cloud over our router. For anyone who doesn't know, LAMP is actually a separately installed collection of Linux, Apache, MySQL and PHP. I also have many other things such as PostgreSQL and Python2.6/Py3k... SSL works, etc. Anything you'd expect from a Debian server except cPanel/WHM.

For windows I obviously wouldn't be serious about development, so I'd probably use some generic sloppy Apache server like XAMPP or WAMP..

The computer doesn't really have a monitor, but it's hooked up to the HDTV in case I want to watch movies on any computer connected to the router without hooking it up to the TV each time... I should probably improve the video card some day, but that's not what the PC was really designed for anyway, it just kinda works since the router is by the TV.. (cable internet)

I use nginx with php fast-cgi on windows.

I used xampp/wamp/etc but I lost the interest in pre-configured packages like xampp. But those are great when need fast webserver up for developing or something small/private. But (yes another but) again I would not use it for pserver setup especially when it comes to paypal and such.

On topic: I should probably update this snippet/code a bit for better useability.
 
I use WAMP when developing everything pretty much... If you're not hosting a live website using WAMP then it is perfect for a quick webserver that includes everything in a simple download.

I used to use vmware to run a debian webserver but I got tired of booting it up all the time.
 
If you're not hosting a live website using WAMP then it is perfect for a quick webserver that includes everything in a simple download.

Mm, I'd have to disagree. Development servers should be capable of running the software as similar as possible found on the production server. In most cases, the host server is Linux. In almost no cases is the host server for Apache servers Windows. If Apache were the same on Linux as it is on Windows, I'd agree, but it's not.

As for a VM server... how long does it really take to boot up? My server PC takes about 15 seconds from pressing the power button to availability over the router... It's not by any means a new pc, lol.. Lean, yes- as a server should be.
 
Back