I have installed a fresh RC2a and run the Authorize.net AIM payment module. Everything works just fine, but the invoice # is missing from the order. Does anyone know how to fix this so that it passes that information?
Latest News: (loading..)
RC2a - No Invoice # - Why not?
Started by Sethman, Aug 15 2008, 05:12
3 replies to this topic
#1
Posted 15 August 2008, 05:12
#2
Posted 15 August 2008, 22:46
In the Payment module authorizenet_cc_aim.php find the function function before_process()
Add
// Calculate the next expected order id
$last_order_id = tep_db_query("select * from " . TABLE_ORDERS . " order by orders_id desc limit 1");
$last_inv = tep_db_fetch_array($last_order_id);
$new_order_id = $last_inv['orders_id'] + 1;
Just after line
global $HTTP_POST_VARS, $customer_id, $order, $sendto, $currency;
Near the top.
Then Add line:
x_invoice_num => $new_order_id,
Just after lines:
x_phone => $order->customer['telephone'],
x_email => $order->customer['email_address'],
x_cust_id => $_SESSION['customer_id'],
in the same function.
Enjoy,
RookuhShay
Add
// Calculate the next expected order id
$last_order_id = tep_db_query("select * from " . TABLE_ORDERS . " order by orders_id desc limit 1");
$last_inv = tep_db_fetch_array($last_order_id);
$new_order_id = $last_inv['orders_id'] + 1;
Just after line
global $HTTP_POST_VARS, $customer_id, $order, $sendto, $currency;
Near the top.
Then Add line:
x_invoice_num => $new_order_id,
Just after lines:
x_phone => $order->customer['telephone'],
x_email => $order->customer['email_address'],
x_cust_id => $_SESSION['customer_id'],
in the same function.
Enjoy,
RookuhShay
#3
Posted 16 August 2008, 11:25
Thank you! Works wonders! I had the right idea, just couldn't get my syntax right.
#4
Posted 16 September 2008, 16:05














