PHP Classes

File: 2co_ipn.php

Recommend this page to a friend!
  Classes of Md Emran Hasan   Payment Gateway Library   2co_ipn.php   Download  
File: 2co_ipn.php
Role: Example script
Content type: text/plain
Description: 2Checkout (2CO) IPN
Class: Payment Gateway Library
Accept payments with Paypal, Authorize.net and 2CO
Author: By
Last change: N/A
Date: 15 years ago
Size: 513 bytes
 

Contents

Class file image Download
<?php

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

// Create an instance of the authorize.net library
$my2CO = new TwoCo();

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

// Specify your authorize login and secret
$my2CO->setSecret('YOUR_SECRET_KEY');

// Enable test mode if needed
$my2CO->enableTestMode();

// Check validity and write down it
if ($my2CO->validateIpn())
{
   
file_put_contents('2co.txt', 'SUCCESS');
}
else
{
   
file_put_contents('2co.txt', "FAILURE\n\n" . $my2CO->ipnData);
}