Fix · Payments
The amount charged is wrong (decimals, discounts, rounding)
Blocks your workKuwait and Gulf
What you may see
- The gateway shows 10 instead of 10.000 or 0.010
- The amount shown at KNET is different from my cart total
- The total differs from the cart by a small amount
Most likely cause
The Kuwaiti dinar has three decimals, and code that assumes two decimals, whole units, or floating-point maths changes the amount.
Check first (about two minutes)
- Write down three examples: cart total, amount sent to the gateway, amount shown by the gateway.
The fix prompt
What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.
Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.
Prompt language
Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.
After you tried it, did it work?
Steps
- Find every place that computes or formats money (cart, discount, delivery, tax, gateway request).
- Keep money as whole smallest units (fils) in code and the database, never as floating-point numbers, and convert once at the edge to the format the gateway wants (read its documentation for the exact format).
- Compute the total on the SERVER from product ids and quantities, and compare it to what the gateway reports at the end.
- Add tests: 0.001, 1.005, 12.500, 99.999, discounts, and quantities.
Do not do this
- Do not use the browser's total as the amount to charge.
- Do not change prices in the catalogue.