[Skip to main content](#vessel-content)

#   plugin not sending order\_id to authorize.net

##

- **[miracell](/forum/user/7176-miracell "View miracell's Profile")**
- [![miracell's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7176-miracell "View miracell's Profile") Topic Author
- [ Offline](/forum/user/7176-miracell)

Less More

- Posts: 5
- Thank you received: 0
-
-

14 years 6 months ago -  14 years 6 months ago [\#48406](#48406) by [miracell](/forum/user/7176-miracell "View miracell's Profile")  *[plugin not sending order\_id to authorize.net](/forum/2-general-talk-about-hikashop/48406-plugin-not-sending-order-id-to-authorize-net#48406 "I'm using authorize.net and the order&#95;id is not being sent.  In authorize.php, the &#95;loadStandardVars loads $order-&gt;order&#95;id into $vars&#91;&quot;x&#95;invoice&#95;num&quot;&#93; if order&#95;id is not empty. However, it appears this is called before order&#95;id is set.  I've verified that x&#95;invoice&#95;num is correctly transmitted to authorize.net when order&#95;id is set by hardcoding text into $vars&#91;&quot;x&#95;invoice&#95;num&quot;&#93; in the &#95;loadStandardVars function. However, I don't know where the class is called from and haven't found other code to figure out where the problem is. Any suggestions on how to make this work? Thanks!")* was created by *[miracell](/forum/user/7176-miracell "View miracell's Profile")*

I'm using authorize.net and the order_id is not being sent.

In authorize.php, the _loadStandardVars loads $order-&gt;order_id into $vars["x_invoice_num"] if order_id is not empty. However, it appears this is called before order_id is set.

I've verified that x_invoice_num is correctly transmitted to authorize.net when order_id is set by hardcoding text into $vars["x_invoice_num"] in the _loadStandardVars function. However, I don't know where the class is called from and haven't found other code to figure out where the problem is. Any suggestions on how to make this work? Thanks!

Last edit: 14 years 6 months ago by [miracell](/forum/user/7176-miracell "View miracell's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzQ4NDA2LXBsdWdpbi1ub3Qtc2VuZGluZy1vcmRlci1pZC10by1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

14 years 6 months ago [\#48440](#48440) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: plugin not sending order\_id to authorize.net](/forum/2-general-talk-about-hikashop/48406-plugin-not-sending-order-id-to-authorize-net#48440 "I'm using authorize.net and the order&#95;id is not being sent.  In authorize.php, the &#95;loadStandardVars loads $order-&gt;order&#95;id into $vars&#91;&quot;x&#95;invoice&#95;num&quot;&#93; if order&#95;id is not empty. However, it appears this is called before order&#95;id is set.  I've verified that x&#95;invoice&#95;num is correctly transmitted to authorize.net when order&#95;id is set by hardcoding text into $vars&#91;&quot;x&#95;invoice&#95;num&quot;&#93; in the &#95;loadStandardVars function. However, I don't know where the class is called from and haven't found other code to figure out where the problem is. Any suggestions on how to make this work? Thanks!")*

If you're using the SIM API, the order_id will be sent to authorize.net

You must be using the AIM API where the payment is validated BEFORE creating the order and that's why you don't have the order_id sent to authorize.net since the order does not exist yet. So it's totally normal that it works like that.

If you really want to have the order id and use the AIM API, you will have to add some code to get the latest order id and increment it and hopefully that number will be the order id attributed to that order when it will create the order after the payment is accepted.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzQ4NDA2LXBsdWdpbi1ub3Qtc2VuZGluZy1vcmRlci1pZC10by1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[miracell](/forum/user/7176-miracell "View miracell's Profile")**
- [![miracell's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7176-miracell "View miracell's Profile") Topic Author
- [ Offline](/forum/user/7176-miracell)

Less More

- Posts: 5
- Thank you received: 0
-
-

14 years 6 months ago [\#48497](#48497) by [miracell](/forum/user/7176-miracell "View miracell's Profile")  Replied by *[miracell](/forum/user/7176-miracell "View miracell's Profile")* on topic *[Re: plugin not sending order\_id to authorize.net](/forum/2-general-talk-about-hikashop/48406-plugin-not-sending-order-id-to-authorize-net#48497 "I'm using authorize.net and the order&#95;id is not being sent.  In authorize.php, the &#95;loadStandardVars loads $order-&gt;order&#95;id into $vars&#91;&quot;x&#95;invoice&#95;num&quot;&#93; if order&#95;id is not empty. However, it appears this is called before order&#95;id is set.  I've verified that x&#95;invoice&#95;num is correctly transmitted to authorize.net when order&#95;id is set by hardcoding text into $vars&#91;&quot;x&#95;invoice&#95;num&quot;&#93; in the &#95;loadStandardVars function. However, I don't know where the class is called from and haven't found other code to figure out where the problem is. Any suggestions on how to make this work? Thanks!")*

Yes, I'm using AIM and I want the order_id sent. It is very helpful for accounting to have the online order ID on both the online order and the authorize.net billing. I don't mind working on the code, so any help you can give to point me in the right direction is appreciated. Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzQ4NDA2LXBsdWdpbi1ub3Qtc2VuZGluZy1vcmRlci1pZC10by1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

14 years 6 months ago [\#48553](#48553) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: plugin not sending order\_id to authorize.net](/forum/2-general-talk-about-hikashop/48406-plugin-not-sending-order-id-to-authorize-net#48553 "I'm using authorize.net and the order&#95;id is not being sent.  In authorize.php, the &#95;loadStandardVars loads $order-&gt;order&#95;id into $vars&#91;&quot;x&#95;invoice&#95;num&quot;&#93; if order&#95;id is not empty. However, it appears this is called before order&#95;id is set.  I've verified that x&#95;invoice&#95;num is correctly transmitted to authorize.net when order&#95;id is set by hardcoding text into $vars&#91;&quot;x&#95;invoice&#95;num&quot;&#93; in the &#95;loadStandardVars function. However, I don't know where the class is called from and haven't found other code to figure out where the problem is. Any suggestions on how to make this work? Thanks!")*

You can change: Code:

if(!empty($order-&gt;order_id)){ $vars["x_invoice_num"] = $order-&gt;order_id; $vars["x_po_num"] = $vars["x_invoice_num"]; }

to: Code:

if(!empty($order-&gt;order_id)){ $vars["x_invoice_num"] = $order-&gt;order_id; $vars["x_po_num"] = $vars["x_invoice_num"]; }else{ $db =&amp; JFactory::getDBO(); $db-&gt;setQuery('SELECT max(order_id) FROM #__hikashop_order'); $vars["x_invoice_num"] = $db-&gt;loadresult()+1; $vars["x_po_num"] = $vars["x_invoice_num"]; }

in the plugins/hikashoppayment/authorize.php file.

The following user(s) said Thank You: [miracell](/forum/user/7176-miracell "View miracell's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzQ4NDA2LXBsdWdpbi1ub3Qtc2VuZGluZy1vcmRlci1pZC10by1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.057 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
