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

Order id within payment authorization process
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi guys,

i would like to add order id to payment request. Within authorizenet module of magento varien uses following code

$request->setXInvoiceNum($order->getIncrementId());

In my module is make a print of $order->getIncrementId());, but nothing is printed.

$order           $payment->getOrder();
$billing     $order->getBillingAddress();
echo 
"Order-ID: ".$order->getIncrementId();

How could i get the order id?

//Edit: Its not about Order id, i want to get order no. sorry

cheers

Stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

ok, what i found out:

Mage::getSingleton('checkout/session')->getQuote()->getIncrementId();

returns a value. But theres a behavior i cant explain. For example my last orderno in admin was 100..020, the output of Mage::getSingleton(’checkout/session’)->getQuote()->getIncrementId(); was 100..00u. Acutal order no is 100..026 in admin. The
output is 100000012? Could anyone explain that?

cheers

Stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
dikomo
Jr. Member
 
Total Posts:  9
Joined:  2008-01-29
 
[m><p> zentrale” date= -

ok, what i found out:

Mage::getSingleton('checkout/session')->getQuote()->getIncrementId();

returns a value. But theres a behavior i cant explain. For example my last orderno in admin was 100..020, the output of Mage::getSingleton(’checkout/session’)->getQuote()->getIncrementId(); was 100..00u. Acutal order no is 100..026 in admin. The
output is 100000012? Could anyone explain that?

cheers

Stefan

the number (increment_id) you got is from sales_quote table, not the sales_order table.

From my understanding is while payment authorization in process , the sales_order is not saved into database yet, that’s why the $order->getIncrementId() in Authorizenet.php returns nothing when you place the order. The increment_id will have value for the orders that had already placed, that $order->getIncrementId() in Authorizenet.php will work for void, refund but not the authorize action.

Hope Moshe can clarify this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

thanks for that hint, in my paymentmodule i added in authorize method

$payment->getOrder()->save();

For me it works, but i dont know if its dirty made or not smile

KR

Stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
dikomo
Jr. Member
 
Total Posts:  9
Joined:  2008-01-29
 
[m><p> zentrale” date= -

thanks for that hint, in my paymentmodule i added in authorize method

$payment->getOrder()->save();

For me it works, but i dont know if its dirty made or not smile

KR

Stefan

Wouldn’t that make the order is seen as completed even though the payment authorization may be declined?

 
Magento Community Magento Community
Magento Community
Magento Community
 
bendtsen
Jr. Member
 
Total Posts:  17
Joined:  2007-09-23
 

Im having the same problem with getting the ordernumber and yes, if its done like m-zentrale suggests it will create a non completed order. Any hints on how to do it the right way?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

yes, iam confirming that behavior, you are right, i didnt test it for declined authorization coz i was too happy that it worked with authorized payment smile. If
authorization is declined i delete current order useing

$payment->getOrder()->delete();

Thats also semi optimal coz if i try 10 times with declined authorization the order-no increases...!

Cheers

Stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Has anyone figured out a good fix for this yet?  We’re using Authorize.net as well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

not yet.. but within authorizenet module there is set a transaction id which could be the identifier
for the order in admin area of authorizenet.

cheers

Stefan

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