About Club osCommerce

Showcasing osCommerce…the good, the bad and the ugly!

StumbleUpon It! DIGG It!

osCommerce and Authorize.net

Written By Gary on May 18 2009 · Comments (0)

Buy Gary A Beer?
Buying me a "beer" helps me to keep my contributions updated and keep this blog alive - and you get a link from my homepage to your site. Cheers!


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:
  1. // load the before_process function from the payment modules
  2.   $payment_modules->before_process();
  3.  
  4.   require(DIR_WS_CLASSES . 'order_total.php');
  5.   $order_total_modules = new order_total;
  6.  
  7.   $order_totals = $order_total_modules->process();

and change it to this:

PHP:
  1. require(DIR_WS_CLASSES . 'order_total.php');
  2.   $order_total_modules = new order_total;
  3.  
  4.   $order_totals = $order_total_modules->process();
  5.  
  6. // load the before_process function from the payment modules
  7.   $payment_modules->before_process();

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.

No Comments

No comments yet.

Leave a comment

RSS feed for comments on this post · TrackBack URL

Hot 100 osCommerce Shops

View the osCommerce HOT 100These are the best looking, most exceptional osCommerce Stores as voted for by you.

New to osCommerce - get inspiration from these beautiful shops. Reckon your site has what it takes to become a member of the HOT 100? Submit it!