Reply
Member
Posts: 4
Registered: ‎07-30-2019

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

Authorize.Net Wizard
Posts: 109
Registered: ‎11-29-2017

Re: Magento 2 - Issues with coupon / vouchers

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.

 
 
Member
Posts: 4
Registered: ‎07-30-2019

Re: Magento 2 - Issues with coupon / vouchers

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

Member
Posts: 4
Registered: ‎07-30-2019

Re: Magento 2 - Issues with coupon / vouchers

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.

Member
Posts: 4
Registered: ‎07-30-2019

Re: Magento 2 - Issues with coupon / vouchers

We're using it on Magento 2.2.5

Member
Posts: 3
Registered: ‎09-12-2019

Re: Magento 2 - Issues with coupon / vouchers

Have you found the solution for this problem yet? 

All Star
Posts: 685
Registered: ‎11-05-2018

Re: Magento 2 - Issues with coupon / vouchers

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

Member
Posts: 3
Registered: ‎09-14-2019

Re: Magento 2 - Issues with coupon / vouchers

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



_____________________________________________________________________
Honeywell Wifi Thermostats

Member
Posts: 3
Registered: ‎09-12-2019

Re: Magento 2 - Issues with coupon / vouchers

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

Member
Posts: 3
Registered: ‎09-12-2019

Re: Magento 2 - Issues with coupon / vouchers

@Renaissance