Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Passing an invoice number to Authorize.net


Recommended Posts

Hi folks,


Client had me upgrade from a very old install of osC to the latest.


In their old payment module (authorizenet.php) they were passing `orders`.`OrderIdPrefix` as an invoice number like so:


tep_draw_hidden_field('x_invoice_num', $order->info['OrderIdPrefix'])


This `orders`.`OrderIdPrefix` field no longer exists in the new osC. Trying to make the new payment module (authorizenet_cc_aim.php) add the unique orders_id I tried a slew of things and finally used


$myQuery = "SELECT MAX(orders_id) as id from orders WHERE customers_id = '$customer_id'"; 
$result = mysql_query($myQuery);
$x_invoice_number = mysql_result($result, 0, 'id');


only to find that the order has apparently not yet been inserted into the `orders` table when this post is made to Authorize.net since I keep getting the previous order's id here.


Someone please advise me a to the _right_ way to post an invoice number with the sale!!!


Thank you!!!!!



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...