Login   Register  
PHP Classes
elePHPant
Icontem

File: authorize_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  >  authorize_start.php  >  Download  
File: authorize_start.php
Role: Example script
Content type: text/plain
Description: Authorize.net initiate
Class: Payment Gateway Library
Accept payments with Paypal, Authorize.net and 2CO
Author: By
Last change: N/A
Date: 5 years ago
Size: 935 bytes
 

Contents

Class file image Download
<?php

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

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

// Specify your authorize.net login and secret
$myAuthorize->setUserInfo('YOUR_LOGIN''YOUR_SECRET_KEY');

// Specify the url where authorize.net will send the user on success/failure
$myAuthorize->addField('x_Receipt_Link_URL''http://YOUR_HOST/payment/authorize_success.php');

// Specify the url where authorize.net will send the IPN
$myAuthorize->addField('x_Relay_URL''http://YOUR_HOST/payment/authorize_ipn.php');

// Specify the product information
$myAuthorize->addField('x_Description''T-Shirt');
$myAuthorize->addField('x_Amount''9.99');
$myAuthorize->addField('x_Invoice_num'rand(1100));
$myAuthorize->addField('x_Cust_ID''muri-khao');

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

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