laravel / cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.
https://laravel.com/docs/cashier-paddle
MIT License
238 stars 57 forks source link

Fix Japanese Yen amounts #184

Closed driesvints closed 1 year ago

driesvints commented 1 year ago

This fixes an issue where Japanese Yen amounts weren't displayed properly. Since Japanese Yen doesn't have cent amounts, they don't need the * 100 modifier before being parsed into a money format. This PR checks if the currency is Japanese Yen and fixes the displayed value to the proper amount.

Fixes https://github.com/laravel/cashier-paddle/issues/183

patrickomeara commented 1 year ago

@driesvints KRW will need the same treatment, it also uses integers. I'll make a PR, are you open to moving this logic into Cashier::formatAmount()? all paths lead there and we also have the currency.

driesvints commented 1 year ago

@patrickomeara that would be a breaking change unfortunate. Right now the formatAmount method expects the value with a * 100 modifier. So if you change that, anyone using it directly will see their values changed. Feel free to submit a PR with additional currencies that need this 👍