Discount codes not working with Authorize.net

  • Posts: 241
  • Thank you received: 5
8 years 4 months ago #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

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

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
8 years 4 months ago #222674

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:

$vars["x_line_item"][]='coupon<|>'.JText::_('HIKASHOP_COUPON').'<|>'.JText::_('HIKASHOP_COUPON').'<|>1<|>-'.round($order->cart->coupon->discount_value,(int)$this->currency->currency_locale['int_frac_digits']).'<|>N';
to:
$vars["x_line_item"][]='coupon<|>'.JText::_('HIKASHOP_COUPON').'<|>'.JText::_('HIKASHOP_COUPON').'<|>1<|>'.round($order->cart->coupon->discount_value,(int)$this->currency->currency_locale['int_frac_digits']).'<|>N';
in the file plugins/hikashoppayment/authorize/authorize.php

Last edit: 8 years 4 months ago by Jerome.
The following user(s) said Thank You: solia

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0
8 years 4 months ago #223137

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 or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
8 years 4 months ago #223142

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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: solia

Please Log in or Create an account to join the conversation.

  • Posts: 30
  • Thank you received: 2
8 years 3 months ago #224934

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 or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
8 years 3 months ago #224954

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

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum