Login   Register  
PHP Classes
elePHPant
Icontem

File: 2co_start.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Md Emran Hasan  >  Payment Gateway Library  >  2co_start.php  >  Download  
File: 2co_start.php
Role: Example script
Content type: text/plain
Description: 2Checkout (2CO) initiate
Class: Payment Gateway Library
Accept payments with Paypal, Authorize.net and 2CO
Author: By
Last change: N/A
Date: 2009-03-04 13:02
Size: 663 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();

// Specify your 2CheckOut vendor id
$my2CO->addField('sid''YOUR_VENDOR_ID');

// Specify the order information
$my2CO->addField('cart_order_id'rand(1100));
$my2CO->addField('total''9.99');

// Specify the url where authorize.net will send the IPN
$my2CO->addField('x_Receipt_Link_URL''http://YOUR_HOST/payment/twoco_ipn.php');
$my2CO->addField('tco_currency''USD');
$my2CO->addField('custom''muri');

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

// Let's start the train!
$my2CO->submitPayment();