In case anyone else is getting mismatches between authorize's invoice number and Zen Cart's order number for orders which are NOT placed at the same time, it may be worth changing includes/modules/payment/authorizenet_cim.php nextOrderNumber() function to do
$result = $db->Execute("SELECT max(orders_id)+1 AS orders_id FROM " . TABLE_ORDERS . " ORDER BY orders_id");
$next_order_id = $result->fields['orders_id'];
return $next_order_id;
instead of pulling the auto_increment value from SHOW TABLE STATUS.
The use of max(orders_id) mirrors the "next id prediction" logic used by other parts of Zen Cart, such as the attributes controller and specials/featured product management.


Reply With Quote
