aviabird / gringotts

A complete payment library for Elixir and Phoenix Framework
https://hexdocs.pm/gringotts/Gringotts.html
MIT License
482 stars 53 forks source link

Currency list we are passing in config as string can be atoms #55

Closed pkrawat1 closed 6 years ago

pkrawat1 commented 6 years ago

Currently, we are passing currency as a string "USD" in the application config :global_config.

This can be improved to use atoms like :usd or something which can be driven and controlled by the library instead of a plane string.

oyeb commented 6 years ago

Atoms are best suited for keys (in a map or keyword), as far as I've read. We'll have to convert these atoms to upcase strings when making requests to the gateway anyways. There's a thread on elixirforum discussing serialisation and atoms.

SagarKarwande commented 6 years ago

As there is limit on atoms count in erlang. link

oyeb commented 6 years ago

This is now obsolete because of #62 and #71. It's the Money lib's responsibility to provide a sane/nice interface to create Money objects.