camaraproject / CarrierBillingCheckOut

Repository to describe, develop, document and test the Carrier Billing Check Out API family
Apache License 2.0
9 stars 9 forks source link

Manage and Control the use of non-negative amounts #153

Open PedroDiez opened 1 month ago

PedroDiez commented 1 month ago

Problem description Within carrier_billing.yaml monetary amounts MUST be positive. Negative values do not make sense and also "zero" value is not indeed a payment.

Due to this, proposed solution considers to set minimum value for "amount" fields to 0.001. In the API Spec this would be:

... amount: type: number format: float **_minimum: 0.001_** multipleOf: 0.001 description: Amount to be charged or reserved. example: 100 ...

NOTE:

Possible evolution Taking advantage of Open #152, it is proposed to deal with this issue within Carrier Billing v0.3.0 and new Refund Interface.

Alternative solution Include as a Fix for carrier_billing.yaml v0.2.1 separately

Additional context

N/A

PedroDiez commented 1 month ago

cc @bigludo7, @rartych, @eragaji (please mention here Barath if he owns github account)

PedroDiez commented 1 month ago

Also to consider for taxAmount, in order to not be negative