I have a downstream service (Stripe) which requires I send currency in the smallest currency unit (zero-decimal currency in their docs). I.e. to charge $1 I would send { "currency": "USD", amount: 100 } and to charge ¥100 I would send { "currency": "YEN", amount: 100 }
My upstream applications do not want to handle the currency in this way and want to use standard currency formats. Is there a means of transforming javax.money.MonetaryAmount
into a zero decimal currency format?
Or am I going to have to write the conversions manually?