djaodjin / djaodjin-saas

Django application for software-as-service and subscription businesses
Other
564 stars 124 forks source link

Enables all currency units supported by Stripe #277

Closed smirolo closed 11 months ago

smirolo commented 1 year ago

Right now currency units are hardcoded at various places in the code to support 'usd', 'cad' and 'eur' - ex: https://github.com/djaodjin/djaodjin-saas/blob/d2ab75d184822b5ee2b2850b388e0386e86a464e/saas/forms.py#L264

It would be great to be able to pick any currency units supported by Stripe, refactoring the code to get those units from a single place, maybe in settings.py, models,py or humanize.py. The refactoring most likely involves rewriting functions like humanize.as_money to use standard and/or libraries for i18n and localization of money amounts.