Home arrow PHP arrow Paypal IPN PHP Handler Script

Paypal IPN PHP Handler Script

This is the fourth part of the PayPal IPN PHP script tutorial. This part will discuss the details of the IPN handler script. Let's name this script "ipnhandler.php."

  1. Paypal IPN PHP Handler Script
  2. IPN Handler PHP Script: ipnhandler.php
By: Codex-M
Rating: starstarstarstarstar / 7
January 24, 2011

print this article



Setting up your IPN URL

Before discussing this script in detail, you need to set up your IPN URL. When a customer on your website clicks the Buy Now button, they will be taken to PayPal for payment. After this successful transaction, PayPal's server sends an IPN message which essentially contains all the information relating to the transaction (product purchased, transaction number, amount paid, etc) to your IPN URL.

If you upload the IPN PHP script to the "paypal_ipn_demo" folder, the IPN URL, for example, will be: http://www.example.com/paypal_ipn_demo/ipnhandler.php.

How are you going to inform PayPal of your IPN URL?

Note: Since you are still testing your application, you will use the PayPal Sandbox to set your IPN URL and test your scripts.

  1. Go to https://developer.paypal.com/ and log in using your PayPal Sandbox account.

  2. Click "Test Accounts" and select the radio button for your test business account in Sandbox.

  3. Click "Enter Sandbox Test Site."

  4. Click "Profile," and under "Selling Preferences," click "Instant Payment Notification Preferences."

  5. By default the IPN is off. You will need to turn it on. Click "Choose IPN settings." Then, in the "Notification URL" section, you will need to enter your IPN URL, e.g. http://www.php-developer.org/paypal_ipn_demo/ipnhandler.php

  6. Under "IPN Messages," select "Receive IPN messages," and then click "Save." This completes the process of setting up your IPN URL in PayPal.

>>> More PHP Articles          >>> More By Codex-M

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: