Money
sale_price: 5075 means 50.75, in agorot for ILS and cents for USD or EUR (MON-01).
What goes wrong
generate-sale does not refuse a decimal. It rounds it and then checks the range. These are from the sandbox:
| You send | PayMe does |
|---|---|
600.75 |
Creates a sale for 601, which charges 6.01 |
50.75 |
Rounds to 51, then refuses it with error 352 |
An amount in whole currency units is also accepted when it's in range, and charges a hundredth of what you meant: 600 charges 6.00, not 600.00. These mistakes produce a working integration that charges the wrong amount, so check them yourself before calling PayMe (MON-03).
Limits
- The default
sale_pricerange is500to4000000, the same in every currency. PayMe can set different limits per account. sale_refund_amountmust be within the same range.- A token sale has its price set by PayMe.
sale_type: seller-tokenansweredprice: 100in the sandbox whatever was sent. - On
capture-sale, a decimalsale_pricecan fail with error 42.
The one display value
Hosted Fields total.amount.value is a decimal string such as "50.75". It only sets what the buyer sees. The amount charged comes from the sale on your server, so keep the two equal.
In your code
- Keep integer minor units everywhere, and convert only at the display edge.
- Use an integer type for
sale_price. A client generated from OpenAPI may type it as a number or float. - Search your code for
/ 100and* 100outside the display layer. - Accept digits only when parsing minor units. A general number parser also accepts
5e2,0x1f4and values with spaces.
reference/money.ts and test-vectors/money.json in the integration kit implement and pin these rules.