Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Order id within payment authorization process
 
[m] zentrale
Guru
 
Avatar
Total Posts:  400
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

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
[m] zentrale
Guru
 
Avatar
Total Posts:  400
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

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dikomo
Jr. Member
 
Total Posts:  6
Joined:  2008-01-29
 
-

zentrale” date="1206643539"]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

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
 
[m] zentrale
Guru
 
Avatar
Total Posts:  400
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

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dikomo
Jr. Member
 
Total Posts:  6
Joined:  2008-01-29
 
-

zentrale” date="1206718258"]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

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:  12
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
 
[m] zentrale
Guru
 
Avatar
Total Posts:  400
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

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Enthusiast
 
Avatar
Total Posts:  871
Joined:  2007-12-14
Illinois, USA
 

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

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Current Projects: TECH USA & IHSA State Finals • Currently Running: PHP 5.2.5/MySQL 5.0.45/Magento 1.1.6 on HostGator

 
Magento Community Magento Community
Magento Community
Magento Community
 
[m] zentrale
Guru
 
Avatar
Total Posts:  400
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

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
52317 users|483 users currently online|105643 forum posts