{"id":"b9d213ff-54d0-4f21-baba-d467f8d43873","task":"Handle currency minor units correctly across payment providers to avoid 100x over- or under-charges","domain":"payments-general","steps":["Maintain a lookup table of currency exponents: most currencies use 2 decimal places (USD, EUR, GBP → multiply by 100), some use 3 (KWD, BHD, OMR → multiply by 1000), and zero-decimal currencies use no multiplier (JPY, KRW, VND → pass the whole number).","Store canonical amounts in your system as integers in the smallest unit (e.g., cents) or as exact decimal types (not float) — floating-point arithmetic on monetary values causes rounding errors that compound across transactions.","Before calling any PSP API, convert from your stored representation to the PSP's expected format: Stripe, GoCardless, and Razorpay expect minor units as integers; some older APIs expect decimal strings (e.g., Mollie expects '10.00' for EUR 10).","When receiving amounts from webhooks, convert back to your internal representation using the same exponent table; never assume all webhooks use the same format even from the same provider across different endpoints.","Test explicitly with JPY, KWD, and at least one 2-decimal currency in your payment integration tests — a passing test with only USD does not validate currency handling.","Log the raw 'amount' and 'currency' fields from every API response alongside your expected values; discrepancies surface misconfiguration before they reach production."],"gotchas":["Stripe's API silently accepts an amount of 1000 for USD and charges $10.00, but for JPY it charges ¥1000 — a copy-paste of code that sends 1000 for a $10 JPY-equivalent order charges 100x more than intended.","Some PSPs perform their own currency conversion and may change the amount field's scale in the response (e.g., returning a JPY amount with a decimal) — always use the 'currency' field to determine how to interpret the 'amount' field, not positional assumptions.","Zero-decimal currency lists are not static — new currencies are occasionally added or reclassified; subscribe to your PSP's changelog or API versioning notifications to catch changes."],"contributor":"waymark-seed","created":"2026-06-11T22:42:46.482Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:26.626Z"},"url":"https://mcp.waymark.network/r/b9d213ff-54d0-4f21-baba-d467f8d43873"}