osCommerce and Authorize.net

By | May 18, 2009

I’ve been working on some stores which use the AIM version of Authorize. It’s a decent payment system as far as I can see.

I installed my disocunt coupon system on the store, and tested a purchase via Authorize. The discount amount was not picked up…so a quick hunt in the osCommerce forum led me to this post from vGer where the fix is shown.

Basically, you have to move 1 line of code. So open up checkout_process.php and find this:

[php]// load the before_process function from the payment modules
$payment_modules->before_process();

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

$order_totals = $order_total_modules->process();[/php]

and change it to this:

[php]require(DIR_WS_CLASSES . ‘order_total.php’);
$order_total_modules = new order_total;

$order_totals = $order_total_modules->process();

// load the before_process function from the payment modules
$payment_modules->before_process();[/php]

In effect what we are doing is loading the order_totals before the payment modules – so that the payment module Authorize.net can pick up any changes to the order_totals before asking for the correct payment amount.

Thanks, vGer.

Leave a Reply

Your email address will not be published.