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

#   Discount codes not working with Authorize.net

##

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

Less More

- Posts: 241
- Thank you received: 5
-
-

10 years 11 months ago [\#222556](#222556) by [cberry1971](/forum/user/13211-cberry1971 "View cberry1971's Profile")  *[Discount codes not working with Authorize.net](/forum/3-bug-report/880809-discount-codes-not-working-with-authorize-net#222556 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  After upgrading to hikashop 2.6.0 my discount codes do not work using Authorize.net (it works with PayPal).  After adding the code, accepting terms and conditions and selecting Authorize.net the user faces a white screen with  You can use the url provided and login using demo1/demo1234 to test for yourself... use coupon code test1  see below from our developer:  &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;  After contacting authorize and doing many tests, I see (suppose) that the problem is in hikashop system, there is an error in the form created by hikashop system to be submitted to Authorize system, it is exactly in x&#95;line&#95;item that contains the data about the coupon, the item price is negative in live (new update) while it is positive in older versions.. I suppose. I believe that the price should be always positive, so Authorize system is throwing an error (270) Line item 2 is invalid .Please let them (hikashop) know about that so they can understand the problem and hopefully solve it easily.")* was created by *[cberry1971](/forum/user/13211-cberry1971 "View cberry1971's Profile")*

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5

After upgrading to hikashop 2.6.0 my discount codes do not work using Authorize.net (it works with PayPal).

After adding the code, accepting terms and conditions and selecting Authorize.net the user faces a white screen with

> The following errors have occurred.
> (270) Line item 2 is invalid.

You can use the url provided and login using demo1/demo1234 to test for yourself... use coupon code test1

see below from our developer:

____________________

After contacting authorize and doing many tests, I see (suppose) that the problem is in hikashop system, there is an error in the form created by hikashop system to be submitted to Authorize system, it is exactly in x_line_item that contains the data about the coupon, the item price is negative in live (new update) while it is positive in older versions.. I suppose. I believe that the price should be always positive, so Authorize system is throwing an error (270) Line item 2 is invalid .Please let them (hikashop) know about that so they can understand the problem and hopefully solve it easily.

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODA4MDktZGlzY291bnQtY29kZXMtbm90LXdvcmtpbmctd2l0aC1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14276
-
-

10 years 10 months ago -  10 years 10 months ago [\#222674](#222674) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount codes not working with Authorize.net](/forum/3-bug-report/880809-discount-codes-not-working-with-authorize-net#222674 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  After upgrading to hikashop 2.6.0 my discount codes do not work using Authorize.net (it works with PayPal).  After adding the code, accepting terms and conditions and selecting Authorize.net the user faces a white screen with  You can use the url provided and login using demo1/demo1234 to test for yourself... use coupon code test1  see below from our developer:  &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;  After contacting authorize and doing many tests, I see (suppose) that the problem is in hikashop system, there is an error in the form created by hikashop system to be submitted to Authorize system, it is exactly in x&#95;line&#95;item that contains the data about the coupon, the item price is negative in live (new update) while it is positive in older versions.. I suppose. I believe that the price should be always positive, so Authorize system is throwing an error (270) Line item 2 is invalid .Please let them (hikashop) know about that so they can understand the problem and hopefully solve it easily.")*

Hi,

The problem comes from a fix we had to do for the Payeezy payment gateway.
The Payeezy payment gateway check that the amounts sent by the website match with the full total and requires that the coupon value is negative or the total doesn't match.
But it seems that this interfers Authorize.net which doesn't like negative values...
I guess we'll have to add yet another option...

In the mean time, just change the line: Code:

$vars["x_line_item"][]='coupon&lt;&#124;&gt;'.JText::_('HIKASHOP_COUPON').'&lt;&#124;&gt;'.JText::_('HIKASHOP_COUPON').'&lt;&#124;&gt;1&lt;&#124;&gt;-'.round($order-&gt;cart-&gt;coupon-&gt;discount_value,(int)$this-&gt;currency-&gt;currency_locale['int_frac_digits']).'&lt;&#124;&gt;N';

to: Code:

$vars["x_line_item"][]='coupon&lt;&#124;&gt;'.JText::_('HIKASHOP_COUPON').'&lt;&#124;&gt;'.JText::_('HIKASHOP_COUPON').'&lt;&#124;&gt;1&lt;&#124;&gt;'.round($order-&gt;cart-&gt;coupon-&gt;discount_value,(int)$this-&gt;currency-&gt;currency_locale['int_frac_digits']).'&lt;&#124;&gt;N';

in the file plugins/hikashoppayment/authorize/authorize.php

Last edit: 10 years 10 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODA4MDktZGlzY291bnQtY29kZXMtbm90LXdvcmtpbmctd2l0aC1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 1
- Thank you received: 0
-
-

10 years 10 months ago [\#223137](#223137) by [screenbites](/forum/user/24533-screenbites "View screenbites's Profile")  Replied by *[screenbites](/forum/user/24533-screenbites "View screenbites's Profile")* on topic *[Discount codes not working with Authorize.net](/forum/3-bug-report/880809-discount-codes-not-working-with-authorize-net#223137 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  After upgrading to hikashop 2.6.0 my discount codes do not work using Authorize.net (it works with PayPal).  After adding the code, accepting terms and conditions and selecting Authorize.net the user faces a white screen with  You can use the url provided and login using demo1/demo1234 to test for yourself... use coupon code test1  see below from our developer:  &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;  After contacting authorize and doing many tests, I see (suppose) that the problem is in hikashop system, there is an error in the form created by hikashop system to be submitted to Authorize system, it is exactly in x&#95;line&#95;item that contains the data about the coupon, the item price is negative in live (new update) while it is positive in older versions.. I suppose. I believe that the price should be always positive, so Authorize system is throwing an error (270) Line item 2 is invalid .Please let them (hikashop) know about that so they can understand the problem and hopefully solve it easily.")*

We are having the same problem. If they dont use the codes, transaction goes as planned, and notworking with coupon... ill have our IT update the cdin

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODA4MDktZGlzY291bnQtY29kZXMtbm90LXdvcmtpbmctd2l0aC1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

10 years 10 months ago [\#223142](#223142) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Discount codes not working with Authorize.net](/forum/3-bug-report/880809-discount-codes-not-working-with-authorize-net#223142 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  After upgrading to hikashop 2.6.0 my discount codes do not work using Authorize.net (it works with PayPal).  After adding the code, accepting terms and conditions and selecting Authorize.net the user faces a white screen with  You can use the url provided and login using demo1/demo1234 to test for yourself... use coupon code test1  see below from our developer:  &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;  After contacting authorize and doing many tests, I see (suppose) that the problem is in hikashop system, there is an error in the form created by hikashop system to be submitted to Authorize system, it is exactly in x&#95;line&#95;item that contains the data about the coupon, the item price is negative in live (new update) while it is positive in older versions.. I suppose. I believe that the price should be always positive, so Authorize system is throwing an error (270) Line item 2 is invalid .Please let them (hikashop) know about that so they can understand the problem and hopefully solve it easily.")*

Hi,

Nicolas already made a patch for the plugin ; so the discount will be send with the "Authorize.net" compatibility and Payzee users could have the compatibility by activating a setting in the plugin instance configuration.
And that updated plugin will be in the next HikaShop release (which should be made during this month).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODA4MDktZGlzY291bnQtY29kZXMtbm90LXdvcmtpbmctd2l0aC1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[solia](/forum/user/10273-solia "View solia's Profile")**
- [![solia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar10273.jpg)](/forum/user/10273-solia "View solia's Profile")
- [ Offline](/forum/user/10273-solia)

Less More

- Posts: 30
- Thank you received: 2
-
-

10 years 10 months ago [\#224934](#224934) by [solia](/forum/user/10273-solia "View solia's Profile")  Replied by *[solia](/forum/user/10273-solia "View solia's Profile")* on topic *[Discount codes not working with Authorize.net](/forum/3-bug-report/880809-discount-codes-not-working-with-authorize-net#224934 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  After upgrading to hikashop 2.6.0 my discount codes do not work using Authorize.net (it works with PayPal).  After adding the code, accepting terms and conditions and selecting Authorize.net the user faces a white screen with  You can use the url provided and login using demo1/demo1234 to test for yourself... use coupon code test1  see below from our developer:  &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;  After contacting authorize and doing many tests, I see (suppose) that the problem is in hikashop system, there is an error in the form created by hikashop system to be submitted to Authorize system, it is exactly in x&#95;line&#95;item that contains the data about the coupon, the item price is negative in live (new update) while it is positive in older versions.. I suppose. I believe that the price should be always positive, so Authorize system is throwing an error (270) Line item 2 is invalid .Please let them (hikashop) know about that so they can understand the problem and hopefully solve it easily.")*

Thank you for this fix.
Just to note, as of today (22 Dec), downloading the current version of 2.6 did not work.
However, code edits worked just fine.
With kind regards, Nadine

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODA4MDktZGlzY291bnQtY29kZXMtbm90LXdvcmtpbmctd2l0aC1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14276
-
-

10 years 10 months ago [\#224954](#224954) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount codes not working with Authorize.net](/forum/3-bug-report/880809-discount-codes-not-working-with-authorize-net#224954 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  After upgrading to hikashop 2.6.0 my discount codes do not work using Authorize.net (it works with PayPal).  After adding the code, accepting terms and conditions and selecting Authorize.net the user faces a white screen with  You can use the url provided and login using demo1/demo1234 to test for yourself... use coupon code test1  see below from our developer:  &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;  After contacting authorize and doing many tests, I see (suppose) that the problem is in hikashop system, there is an error in the form created by hikashop system to be submitted to Authorize system, it is exactly in x&#95;line&#95;item that contains the data about the coupon, the item price is negative in live (new update) while it is positive in older versions.. I suppose. I believe that the price should be always positive, so Authorize system is throwing an error (270) Line item 2 is invalid .Please let them (hikashop) know about that so they can understand the problem and hopefully solve it easily.")*

Yes, the modification was not added to the package yet.
We'll do that today.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84ODA4MDktZGlzY291bnQtY29kZXMtbm90LXdvcmtpbmctd2l0aC1hdXRob3JpemUtbmV0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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.159 seconds

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

[](#top)
