Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

No order id at payment gateway when entering an order via the Admin UI
 
kenosis
Member
 
Total Posts:  45
Joined:  2008-03-14
 

Greetings all!

Over at Untangle.com where we host a store based on Magento, we’re seeing a new weirdness: when orders are processed via the default store view, ie, the customer facing web site, the order ID for an order, as accessed via $order->getIncrementId(), is passed by Mage to the payment module and in turn makes its way to Authorize.net to identify the CC charge there.  BUT, when a customer order is manually entered via the Mage Admin UI (via the Manage Customers/Create Order UI), the order id, when read via that same $order->getIncrementId() call is empty!  This leaves the order unidentified at auth.net, which is driving our accountant nuts!  However, the order ID in Mage is ultimately set when the order is complete as it shows up in the order history UI.  Thus far I’ve been unable to find the cause of this and I was hoping someone on the forums knows what’s up, ie, feature?, bug?, operator error?!?!?!  Hope so!

Best,

Ken

 
Magento Community Magento Community
Magento Community
Magento Community
 
kenosis
Member
 
Total Posts:  45
Joined:  2008-03-14
 

I guess what stumps me is this code from app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php.  See the code marked >>> below.  I added some debug logic and for certain there is no order ID after the order is placed and saved.  The logic marked >>> seems to acknowledge this and setups up a parent child relationship IFF there is an order id.  Very confusing - could someone from the Mage core team respond to this - this is a pretty big issue for us and I think I’ve done a reasonable amount of homework.  Moshe???

Thanks,

Ken

public function createOrder()
{
$this->_validate();
if (!$this->getQuote()->getCustomerIsGuest()) {
$this->_saveCustomer();
}

$quoteConvert = Mage::getModel(’sales/convert_quote’);

/* @var $quoteConvert Mage_Sales_Model_Convert_Quote */

$quote = $this->getQuote();

$order = $quoteConvert->addressToOrder($quote->getShippingAddress());
$order->setBillingAddress($quoteConvert->addressToOrderAddress($quote->getBillingAddress()))
->setShippingAddress($quoteConvert->addressToOrderAddress($quote->getShippingAddress()))
->setPayment($quoteConvert->paymentToOrderPayment($quote->getPayment()));

foreach ($quote->getShippingAddress()->getAllItems() as $item) {
$order->addItem($quoteConvert->itemToOrderItem($item));
}

if ($this->getSendConfirmation()) {
$order->setEmailSent(true);
}

$order->place()
->save();

>>> if ($this->getSession()->getOrder()->getId()) {
$oldOrder = $this->getSession()->getOrder();
$originalId = $oldOrder->getOriginalIncrementId() ? $oldOrder->getOriginalIncrementId() : $oldOrder->getIncrementId();
$order->setOriginalIncrementId($originalId);
$order->setRelationParentId($oldOrder->getId());
638,0-1 81%

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jonathan123
Sr. Member
 
Total Posts:  215
Joined:  2008-09-14
 

Did you figure this out? Has it been fixed in 1.1.7?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top