VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Payment VM 1.1 => Authorize.net VM 1 => Topic started by: deathorglory on November 29, 2011, 15:20:56 PM

Title: How to sync VM order number with AN Invoice Number?
Post by: deathorglory on November 29, 2011, 15:20:56 PM
I am trying to sync the Order Numbers from virtuemart to be the same for the invoice numbers in Authorize.net but cant seem to find any information on it.

Currently an example of what is going on is:

VM Order Number  : 0000002
AN Invoice Number: 129_fjd89923kaf

The number appears to be completely random, and when dealing with dozens of orders a day, it would make life easier if these numbers matched.

Anyone have any idea? Or can anyone confirm their numbers match out of the box?

Thanks
Title: Re: How to sync VM order number with AN Invoice Number?
Post by: deathorglory on November 29, 2011, 16:53:49 PM
To help aid in this situation.

I figured out in ps_checkout an order number is created here:

function get_order_number() {
global $auth;

/* Generated a unique order number */

$str = session_id();
$str .= (string)time();

$order_number = $auth['user_id'] .'_'. md5($str);

return substr($order_number, 0, 32);
}


I also figured out that $order_id is what I am trying to pass through to Authorize to show up for their invoice number field. I have tried everything from making $order_number = $order_id, both in the above section as well in ps_authorize code, but no luck. Once I change something I end up getting an empty field with no order_id whatsoever.

Any help on how to get the order_id (vm order number) to display in the Authorize.net Invoice Number Field would be GREATLY appreciated.
Title: Re: How to sync VM order number with AN Invoice Number?
Post by: William Dooley on December 04, 2011, 04:19:02 AM
I also need this. PLEASE can anyone help us.

Thanks,
William
Title: Re: How to sync VM order number with AN Invoice Number?
Post by: deathorglory on December 12, 2011, 17:38:32 PM
This has to be a simple fix, any dev have any input? Everything I try ends up in blank order numbers...
Title: Re: How to sync VM order number with AN Invoice Number?
Post by: Joseph Kwan on December 16, 2011, 22:59:30 PM
Before VM receive the confirmation from authorize.net, the order is not created yet and so there is no order id. The order number is just a temporary number created to identify the transaction.