Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


NodsDorf

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.

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 1 month later...
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.

Link to comment
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

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...