cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 - Issues with coupon / vouchers

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..

asurrey
Member
10 REPLIES 10

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.

 
 
mmcguire
Administrator Administrator
Administrator

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...

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.

We're using it on Magento 2.2.5

Have you found the solution for this problem yet? 

@gakon104110 

 

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. 

Searching for the same. I tried every single option, but not finding anything.



_____________________________________________________________________
Honeywell Wifi Thermostats

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

@Renaissance