Money Struct
Payment integrations are often confusing due to different formats in which payment amount is accepted and processed. A small error can cause large ramifications in terms of business impact. The money framework eliminates the confusion and streamlines the acceptance format for the most important parameter in the payment workflow.
For example:
Stripe wants cents:
amount: 1000means $10.00.Adyen wants minor units but uses different field names.
Some payment processors use floats (to be honest, it is quite dangerous!!).
And a lot of them simply use strings.
You send {"minor_amount": 1000, "currency": "USD"}. Prism handles the rest. No more wondering if Stripe wants cents or dollars. No more Adyen amount-in-minus conversion bugs. One format. Every processor.
What Are the Typical Problems While Handling Amount?
Diversity in the payment processor spec causes three types of bugs:
The Off-by-100x Bug: Sending
10instead of1000charges $0.10 for a $10 product. You lose money on every transaction. Sending100000instead of1000attempts to charge $1,000 — there are high chances that the customer abandons the checkout or you may have to refund angry customers.Floating-Point Arithmetic Bug: When two floats are added it is bound to cause tiny errors which magnify at scale. For example, 10.99 + 20.99 = 31.980000000000004 (not 31.98)
Currency Confusion: Passing
"amount": 1000without specifying currency. Is this $10.00 USD or ¥1,000 JPY?
How Money Struct Solves for It?
The Prism standardizes on one representation for amount — in minor units, with ISO standard currency, and very importantly — in integer.
{
"minor_amount": 1000,
"currency": "USD"
}minor_amount
int64
Amount in smallest currency unit. USD: cents. JPY: yen (no decimals). BHD: 1/1000th dinar.
currency
Currency
ISO 4217 three-letter code: USD, EUR, GBP, JPY, INR, etc.
The payment request is then transformed into each processor's native format, and tested for final verification. The amount reflecting on the payment processor dashboard should read exactly the same as the amount intended to be processed. Just verifying the API response from the processor may not be enough!!
More Information
Zero decimal currencies
Some currencies have no decimal places. The Prism handles this automatically.
JPY
1 yen
{"minor_amount": 1000, "currency": "JPY"} = ¥1,000
KRW
1 won
{"minor_amount": 10000, "currency": "KRW"} = ₩10,000
VND
1 đồng
{"minor_amount": 50000, "currency": "VND"} = ₫50,000
However, you still send amounts in minor units. Prism adjusts for processors that expect whole units for these currencies.
Supported Currencies
The Prism supports 160+ currencies via the ISO 4217 standard:
Major Currencies: USD, EUR, GBP, JPY, AUD, CAD, CHF, CNY, INR and more
Regional: AED, BRL, DKK, HKD, MXN, NOK, NZD, PLN, SEK, SGD, ZAR and more
Recommended Best Practices
Always specify currency explicitly — Never rely on defaults.
Store amounts in minor units — In your database, store
5999not59.99. Floats cause rounding errors.Validate before sending — Check
minor_amount > 0and currency code length is 3.Display formatting is a UX concern — Convert
5999to$59.99in your frontend to improve readability for the user. Do not do the conversion in your API calls.Handling currency conversions — Prism does not convert between currencies. If you authorize in
USD, you capture inUSD. If you need forex, handle it before triggering the Prism. For multi-currency applications, track the original currency and amount. Do not convert for storage — you'll lose precision.
Last updated
Was this helpful?

