Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Authorizenet Consolidated - Authorize.net Consolidated


Guest

Recommended Posts

Authorize.net Consolidated 1.5

 

If after installing CCGV(trad) and you're running into the "cannot connect to authorize.net......" error, the below worked for an installation. Site uses Authorize.net Consolidated 1.5 by Austin519 (modifed version orig. by Bao Nguyen). Might work for other versions of contribs that use authorize.net for payment. (also, this fix does not break other payment modules on its own).

 

Cheers :P

DRIVE

(very happy to have moved to the TRAD contrib (Thanks Vger).... the original is suffering from massive code-forking and is nearly impossible to install on modded shops)

 

 

// load selected payment module
 require(DIR_WS_CLASSES . 'payment.php');
 if ($credit_covers) $payment=''; // CCGV
 $payment_modules = new payment($payment);

 // Need to be included before Authorizenet ADC Direct Connection
require(DIR_WS_CLASSES . 'order.php');
$order = new order;

require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;

$order_totals = $order_total_modules->process();

//************************************************************
// Authorizenet ADC Direct Connection
// Make sure the /catalog/includes/class/order.php is included
// and $order object is created before this!!!
if(MODULE_PAYMENT_AUTHORIZENET_STATUS) {
include(DIR_WS_MODULES . 'authorizenet_direct.php');
}
//************************************************************

// load the before_process function from the payment modules
$payment_modules->before_process();
 $sql_data_array = array('customers_id' => $customer_id,
					  'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
					  'customers_company' => $order->customer['company'],
					  'customers_street_address' => $order->customer['street_address'],
					  'customers_suburb' => $order->customer['suburb'],
					  'customers_city' => $order->customer['city'],
					  'customers_postcode' => $order->customer['postcode'], 
					  'customers_state' => $order->customer['state'], 
					  'customers_country' => $order->customer['country']['title'], 
					  'customers_telephone' => $order->customer['telephone'], 
					  'customers_email_address' => $order->customer['email_address'],
					  'customers_address_format_id' => $order->customer['format_id'], 
					  'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 
					  'delivery_company' => $order->delivery['company'],
					  'delivery_street_address' => $order->delivery['street_address'], 
					  'delivery_suburb' => $order->delivery['suburb'], 
					  'delivery_city' => $order->delivery['city'], 
					  'delivery_postcode' => $order->delivery['postcode'], 
					  'delivery_state' => $order->delivery['state'], 
					  'delivery_country' => $order->delivery['country']['title'], 
					  'delivery_address_format_id' => $order->delivery['format_id'], 
					  'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 
					  'billing_company' => $order->billing['company'],						   'billing_street_address' => $order->billing['street_address'], 
					  'billing_suburb' => $order->billing['suburb'], 
					  'billing_city' => $order->billing['city'], 
					  'billing_postcode' => $order->billing['postcode'], 
					  'billing_state' => $order->billing['state'], 
					  'billing_country' => $order->billing['country']['title'], 
					  'billing_address_format_id' => $order->billing['format_id'], 
					  'payment_method' => $order->info['payment_method'], 
					  'cc_type' => $order->info['cc_type'], 
					  'cc_owner' => $order->info['cc_owner'], 
					  'cc_number' => $order->info['cc_number'], 
					  'cc_expires' => $order->info['cc_expires'], 
					  'date_purchased' => 'now()', 
					  'orders_status' => DEFAULT_ORDERS_STATUS_ID, 
				// the following field has been moved from orders to order_status_history
				// 'comments' => $order->info['comments'], 
					  'currency' => $order->info['currency'], 
					  'currency_value' => $order->info['currency_value']);
 tep_db_perform(TABLE_ORDERS, $sql_data_array);
 $insert_id = tep_db_insert_id();

//************************************************************

// load the before_process function from the payment modules
//  $payment_modules->before_process();
 for ($i=0; $i<sizeof($order_totals); $i++) {
$sql_data_array = array('orders_id' => $insert_id,
						'title' => $order_totals[$i]['title'],
						'text' => $order_totals[$i]['text'],
						'value' => $order_totals[$i]['value'], 
						'class' => $order_totals[$i]['code'], 
						'sort_order' => $order_totals[$i]['sort_order']);
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
 }

Link to comment
Share on other sites

Another thing-- I had to change the sort order of of my Total in the Modules -> Order Total so that the total is always processed last (Coupon default sort order is 9 and Vouchers default sort order is 740 and causes the actual charge that authorize.net does to disregard the coupon or voucher amount). I set my Total sort order to 741 and it processes both correctly.

Edited by DRIVE
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...