Jump to content
Sign in to follow this  
NodsDorf

How do you pass the order # as invoice number to Auth.net?

Recommended Posts

We have the Authorize.net (AIM) module installed it works fine except the data auth.net gets always shows an invoice number of 1. Is there a way to get the module to pass them the order number as the invoice number?

 

 

Any help or suggestions is very much appreciated.

 

Thank you.

Share this post


Link to post
Share on other sites

Hello,

We are having the same problem with the SIM module of Authorize.net. The only exception is that from authorize.net, the Invoice number in the email notification is left blank.

 

Having the order number passed to the invoice number field at authorize.net is crucial to correctly matching order notifications to orders in our OS Admin.

 

Can anyone help with this issue, or point us to where it may already be posted in the forum. I have yet to find a matching entry.

 

Thank you,

Olivia

www.cityofstrength.com

Share this post


Link to post
Share on other sites
Check out the Authorize Net AIM Invoice Number Fix contribution

 

I just installed the latest Authorize.net AIM from http://addons.oscommerce.com/info/4091 and I'm getting the same thing, invoice number is always 1, instead of using the order number.

 

Is there a quick and dirty way to fix this?

Share this post


Link to post
Share on other sites
I just installed the latest Authorize.net AIM from http://addons.oscommerce.com/info/4091 and I'm getting the same thing, invoice number is always 1, instead of using the order number.

 

Is there a quick and dirty way to fix this?

 

Change this:

// Calculate the next expected order id
		$last_order_id = tep_db_query("select * from " . TABLE_ORDERS . " order by orders_id desc limit 1");
		$new_order_id = $last_order_id->fields['orders_id'];
	 //$new_order_id = ($new_order_id + 1);

And comment out like this:

// Calculate the next expected order id
	 //$last_order_id = tep_db_query("select * from " . TABLE_ORDERS . " order by orders_id desc limit 1");
	 //$new_order_id = $last_order_id->fields['orders_id'];
	//$new_order_id = ($new_order_id + 1);

Add this code just below the above code:

// A.NET INVOICE NUMBER FIX
	// find the next order_id to pass as x_Invoice_Num
	$next_inv = '';
	$inv_id = tep_db_query("select orders_id from " . TABLE_ORDERS . " order by orders_id DESC limit 1");
	$last_inv = tep_db_fetch_array($inv_id);
	$next_inv = $last_inv['orders_id']+1;
	// END A.NET INVOICE NUMBER FIX

And change this here:

'x_invoice_num'		 => $new_order_id,

To this:

'x_invoice_num'		 => $next_inv,

 

You will then see the invoice number attached to your order in Authorize.net!


I am currently just learning osCommerce and PHP, but am always willing to help out.

 

Have successfully installed the following: Discount Coupons, UPS shipping module, Ultimate SEO URL's, Easy Meta Tags for SEO 1.0, Google XML Sitemap SEO v1.3, HTML Editor for Email and Newsletters.

Share this post


Link to post
Share on other sites
We have the Authorize.net (AIM) module installed it works fine except the data auth.net gets always shows an invoice number of 1. Is there a way to get the module to pass them the order number as the invoice number?
No, not accurately. The invoice number is created after the charge is complete at authorize.net. The code can guess at the number, as mentioned in this thread, but on a busy site that could be wrong.

 

Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×