PHP Classes

File: paypal_ipn.php

Recommend this page to a friend!
  Classes of Md Emran Hasan   Payment Gateway Library   paypal_ipn.php   Download  
File: paypal_ipn.php
Role: Example script
Content type: text/plain
Description: Paypal IPN
Class: Payment Gateway Library
Accept payments with Paypal, and 2CO
Author: By
Last change:
Date: 13 years ago
Size: 542 bytes


Class file image Download

// Include the paypal library
include_once ('Paypal.php');

// Create an instance of the paypal library
$myPaypal = new Paypal();

// Log the IPN results
$myPaypal->ipnLog = TRUE;

// Enable test mode if needed

// Check validity and write down it
if ($myPaypal->validateIpn())
    if (
$myPaypal->ipnData['payment_status'] == 'Completed')
file_put_contents('paypal.txt', 'SUCCESS');
file_put_contents('paypal.txt', "FAILURE\n\n" . $myPaypal->ipnData);