when ever we've got a transaction with a coupon we get an error such as:
'code' => 'E00003',
'text' => 'The \'AnetApi/xml/v1/schema/AnetApiSchema.xsd:unitPrice\' element is invalid - The value '-78.05' is invalid according to its datatype \'Decimal\' - The MinInclusive constraint failed.',
I am guessing the extension is added an itemline for the discount, which gets refused due to it being a negative value.
This is causing a huge headache..
07-30-2019 02:43 PM
The xsd is available here:
https://apitest.authorize.net/xml/v1/schema/AnetApiSchema.xsd
I'm not allowed to copy the element code here - but you can search the xsd in a browser for "unitPrice". unitPrice has a minimum of 0.00.
07-30-2019 03:41 PM
I'm aware of that, but I have no idea where this negative value is coming from.
All the products have positive values inside magento - the anet log doesn't log unitPrice so I can't tell which row has the negative value, or why it's negative. It's shouldn't be...
07-31-2019 03:21 AM
Same orders work fine with paypal and other payment methods, if we use a coupon code with this anet extension we get issues with negative values of unitPrice as stated above.
this must be related to the extenion.
07-31-2019 04:49 AM
We're using it on Magento 2.2.5
07-31-2019 04:50 AM
Have you found the solution for this problem yet?
09-12-2019 10:01 PM
I haven't seen this software or the issue, but I can tell you that the root cause is a discount being treated as if a product. UnitPrice is a property of line items. You would need the discount to be reflected somewhere other than the line items of the order. You may want to apply the discount to the line item directly, for instance instead of-
Widget $10.00
Widget discount -$1.00
Order total $9.00
You may want-
Widget (10% discount applied) $9.00
the 10% can be added to the item description. How to integrate that with your specific magento I do not know, but that is the nuts and bolts of what is supposed to happen.
09-15-2019 01:59 AM
Searching for the same. I tried every single option, but not finding anything.
_____________________________________________________________________
Honeywell Wifi Thermostats
09-16-2019 05:06 AM
Somehow this is related to the Coupon Code with Freeshipping.
Normal coupon code works fine. I guess we have to handle the logic in Magento then, unless you have any other suggestion
10-10-2019 08:51 AM
I found the problem with this... It is in the magento-module-core/gateway/request/AbstractRequestBuilder.php; function prepareLineItem where it setUnitPrice
It is calling the $item->getBasePriceInclTax() - $item->getBaseDiscountAmount(). The base discount amount is the discount amount of the whole line item.
Let's say if my item is $2.03 and it has 48 quantity in the line item. Then the total will be 97.44. But after 10% discount which is $9.74, I received the error -7.71 is invalid from Authorize Net.
It was -7.71 because it uses the BasePriceIncludeTax - BaseDiscountAmount ( 2.03 - 9.74)
10-10-2019 11:51 AM