paytrail / api-documentation

Paytrail Payment API documentation
MIT License
6 stars 11 forks source link

Should item.units be a floating number? #31

Closed asiksami closed 9 months ago

asiksami commented 2 years ago

Describe the bug

Document https://docs.paytrail.com/#/?id=item says that item.units should be a integer.

Let's say my client sells a steel bar that would be cutted in customers needs. Customer could select length in 0.3 metric intervals and the per item price is 1 meter. Now sending this to Paytrail you need to make item.units as an integer which atleast would mess up the calculations in Paytrail's end, where amount must match with total sum of items.

Well I think this could be fixed meddling with the prices before sending, but why not item.units be a floating number?

Expected behaviour

The field item.units should be a floating point number?

Actual behaviour

According to the documents, field units must be integer for payment payload item. This wont work ideally for items that has fractions in items quantity.