问题
I'm trying to send request using Postman
to test Klarna
payment, According to this API DOC, We use POST /checkout/v3/orders
to send a request so that we can create order (For the testing environment they use https://api.playground.klarna.com/
+ rest of url), But when i'm trying to send the given example in the above link(on the right side), It says that
{ "error_code" : "BAD_VALUE", "error_messages" : [ "Bad value: order_tax_amount" ], "correlation_id" : "12255531-ffcb-4a91-a375-04577fca78e5" }
When i read what does it require in the documentation, It says that the value should be formatted in some formula ±1 of total_amount - total_amount * 10000 / (10000 + tax_rate)
, When i calculate that the result 4545.4545
when i change the value in the request and try again, It gives the same error.
Can anybody help me with that?
Thanks
回答1:
The docs you've linked say that order_tax_amount
should be an integer of minor currency units, so it sounds like 4545.4545
isn't a valid value!
You should choose which direction you want to round in, then send an integer value instead.
回答2:
I found the problem, I should change both total_tax_amount
and order_tax_amount
to be 4545
, What a mistake, I think they should update this in their documentation so people be more familiar with it.
来源:https://stackoverflow.com/questions/48050138/bad-value-order-tax-amount