home |  
Sell Downloads - Ejunkie
open db network by 19.5 degrees
LYRICS | FREE E-BOOKS | SELL DOWNLOADS WITH PAYPAL
 in   
contribute for fun & profit
brink

PayPal IPN Handler
-PayPal IPN Agen..
-PayPal IPN hand..
-Image to ASCII ..
-Image to ASCII ..
-PayPal IPN hand..
All Resources > Server Scripts > PHP
spread the word around  send this page to a friend   read/write comments/corrections/additions comments  rate this 

PayPal IPN Agent

listed by 19.5 Degrees
 
 
Developer / Artist / Author: Kees Cook
 
views: 18286 | rating: 3/10 | downloads: 1998 download | homepage
 


PayPal IPN Agent

This page is for helping people set up validation software to handle IPNs on their own server. This will hopefully change in the future, and I will start offering a customizable IPN service, using this software. And if anyone wants to know how secure the backend IPN handler is, they can look at the source code themselves, unlike the other IPN services out there. :)

This software is released under the GPL.


"IPN Agent" version 1.0.2
A PayPal IPN Backend Handler for PHP
Kees Cook
$Date: 2004/07/28 01:57:01 $

Overview

I wrote this tool since I couldn't find any others that did the FULL job. However, I am also notoriously bad at (impatient with) finding software, so it's possible another one with the similar functionality exists.

This tool was designed to handle Instant Payment Notifications from paypal.com. Since I wanted to design it as separate from any existing cart or payment system, this tool simply takes IPN information, verifies it, and then stores it into a local database. It is up to the cart or other payment system to then examine the resulting transaction lists to determine the state of the world. Basically, this tool lets PayPal update your database with what they think the status of any given payment is.

Paypal's documentation of how their IPN system works was last seen at https://www.paypal.com/en_US/pdf/ipn.pdf

I would suggest giving it a read, just to understand what's happening.

"IPN Agent" Features

  • Verifies the IPN with Paypal. (All the other IPN software does at least this part.)
  • Actually verifies that the SSL Certificate is owned by paypal.com. SSL is useless unless you can actually verify the owner of the domain. To use this, you must have a "root Certificate Authorities" file. All modern browsers come with one, and there is a debian package named "ca-certificates" that has the file as well.
  • Stores results intelligently in a database for later examination.
  • Runs external tool on a "Completed" payment. Once a transaction is actually finished, an external tool can be called to perform final price verification. One of the easiest ways to defraud a merchant using PayPal is to just change the price of all the items in a shopping cart. With an external price verification system, you can hook up to any shopping cart system. Once that is finished, it can continue to perform other functions to react to the completed payment.

Missing

Subscriptions. I just haven't bothered to investigate the fields sent during a subscription. We can do that in the next version.

Requirements

  • PHP (version 4 or better). I tested under 4.3.4.
  • PEAR DB (version 1.6.0 or better). I tested under 1.6.1. You may need to explicitly upgrade your version of PEAR's "DB" package. Run "pear list" to see what version of "DB" you have installed. If it is younger than "1.6.0", run "pear upgrade DB" to get the latest.

Files

README - This documentation.
COPYING - The GPL, the license for this software.
config.txt - Should be edited and renamed to "config.php". See "Setup" below.
sql.sh - Shell script to generate the expected SQL tables.
ipn_agent.php - The core PHP "IPN_Agent" class source.
ipn.php - The script that instantiates an IPN_Agent object and is actually responsible for taking the incoming POST from PayPal.
pay.php - Example PayPal payment form.
paid.php - Example "return" script. See "pay.php".
cancel.php - Example "cancel" script. See "pay.php".
DESIGN - The mindless gibbering of my design work for IPN_Agent.

Setup

  1. Configure
    Rename "config.txt" to "config.php", and edit it to set up all the variables. The listed defaults are all just examples. Don't forget you MUST have a password defined for your database DSN.
  2. Set up database
    If you have the command-line "php" interpreter, run sql.sh | mysql -u root -p

    Otherwise, rename "sql.sh" to "sql.php", edit it to remove the first two lines and the last line (leaving just the PHP code) and access it from your browser. Take the output and run it through "mysql -u root -p" to create your IPN database tables. If you do this, please rename "sql.php" back to "sql.sh" so other people can't read your database password. ;)
  3. Hook up to your cart/website/whatever through the "run_completed" script. (And do price verification!)
  4. Have fun!

Testing

To test everything, you can formulate IPN queries at https://www.eliteweaver.co.uk/testing/ipntest.php But you'll have to update the 'url' variable in "config.php" used for IPN verification. Don't forget to change it back when you're done testing.



download


« PREVIOUS
  INDEX
NEXT »

spread the word around
read comments

untitled
posted by: soliver
on: Jan 1, 08 9:25 am

oh and that db.php .. you don't need it
just replace require_once(db.php) with config.php and then run it in a browser ..
will show you the sql statements to create the tables

post reply | read replies (0)



some more documentation would be awesome :D
posted by: soliver
on: Jan 1, 08 9:23 am

If i try to do some testing https://www.eliteweaver.co.uk/testing/ipntest.php
I insert my domain/ipn.php or ipn_agent.php but I always receive:

Your script is not posting back to us!

Although I have changed the url in config.php and created all the tables. What am I supposed to do ? Do I have to call ipn.php ?

post reply | read replies (0)



not good code at all
posted by: spike
on: Dec 19, 07 12:48 pm

well first off half of the files are missing. I have NO DB.php, as well not real sure if I even have the correct version. what am I to down load??? paypal_ipn_handler.zip / or ew_php-idh-2.0.zip.

I think you need to do a bit more on the documentation arena as this is just not getting it at all!!!
way to much open ended lack of general information and no clear doc's to even point a person into the right set of files.

post reply | read replies (1)



very good
posted by: shaid
on: Nov 11, 07 11:23 am

<a href="http://scholarshipsme.blogspot.com">wao!!!</a> its a useful document to go with.
Thanks
<a href="http://apexvideo.blogspot.com">BBV</a>
http://cricketallround.bllogspot.com

post reply | read replies (1)



Update?
posted by: JD
on: Mar 2, 06 2:44 am

Hey, was just wondering how updates where coming along on this. If this script just had the capability to handle subscriptions it would be PERFECT for what I need. I have yet to find a script like this for under $50 US.

post reply | read replies (0)



read more commentsread more comments   |   read more commentspost comment 



home | contact | contribute | terms of use | privacy policy |