Exemplo n.º 1
0
<?php 
require_once JPATH_COMPONENT . DS . 'anet_php_sdk' . DS . 'AuthorizeNet.php'; // The SDK
$url = JURI::base() . substr($_SERVER['REQUEST_URI'],1) . '&format=raw&post=1' . '&order_id=' . $order_id . '&key=' . $key . '&myid=' . $my->id;
//echo $url;
//error_reporting(E_ALL);
if (JRequest::getVar('post') == 0) {
$api_login_id = $dm->cfg['authorizenet_login_id'];
$transaction_key = $dm->cfg['authorizenet_transaction_key'];
$md5_setting = $dm->cfg['authorizenet_md5_setting']; // Your MD5 Setting
$amount = $dm->getPrice(JRequest::getInt('id'));
error_reporting(0);
echo $dm->cfg['authorizenet_processing_page'];
AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting, $dm->cfg['authorizenet_test_mode']);

?>
* NOTE: To receive the file via email you must be logged in as a registered user.
<?php 
} else if (JRequest::getVar('post') == 1) {
	if (JRequest::getVar('x_response_code') == 1) {
		 $order_id = JRequest::getVar('order_id');
		 $key = JRequest::getVar('key');		
		 $myid = JRequest::getVar('myid');
		 
		 $user =& JFactory::getUser($myid);
		 
	     $dm->completeOrder($order_id);
/*         $dm->updateOrder($order_id,array(
			'first_name' =>  $p->ipn_data['first_name'],
			'last_name' => $p->ipn_data['last_name'],
			'organization' => $p->ipn_data['payer_business_name'],
			'address' => $p->ipn_data['address_street'],
Exemplo n.º 2
0
<?php

require_once 'anet_php_sdk/AuthorizeNet.php';
// The SDK
$url = "http://queencitytech.com/sustainbrand/transaction.php";
$api_login_id = '9bdY4HtEh2P';
$transaction_key = '4FX5Fzp4vv37X6CX';
$md5_setting = 'b33a46f5ee81f6f0790f3ea9f02468e1';
// Your MD5 Setting
$amount = $_POST['billing_amount'];
AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting);