Support for various currencies

30 views
Skip to first unread message

mariano....@gmail.com

unread,
Jan 8, 2016, 6:00:40 AM1/8/16
to ror_ecommerce
Hi all,

I'd like to start saying I'm new to rails.

I would like to know if ror_ecommerce supports payments with different currencies.
As far as i can tell by the code I've read, I guess it handles a money type with no name (maybe to leave it up to the developer to define the currency to work with according to the country).

Since it is a requirement for me to display and charge money in the currency that belongs to each country, any known best practices to do this will be very welcome.

Thank you!
 

David Henner

unread,
Jan 8, 2016, 2:28:32 PM1/8/16
to ror_ec...@googlegroups.com
Mariano,

Out of the box ror_ecommerce supports one currency.  Pick one and start from there.

If you want to use multiple I'd do the following:

remove "price" attribute from the variants.

create a "price" method in variants that takes a currency object.  (this will break a lot but they should be easily fixed one at a time)


add "base_amount" attribute to variants. (this might be a price in US and then use a currency conversion to calculate the other currency amount)

Currency Table could look like this

name
conversion_multiple (changing semi-frequently)

def price(currency)
  (currency.conversion_multiple * base_amount).round_at(2)
end

-----------------------

You might have requirements that require you to have a prices table and do this

Create a price model & Create a currency model

Prices Table could look like this

amount
currency_id

Then the Currency Table could look like this

name


----------------------

At the end of the day requirements will drive your modeling.

Ask if you want more details.  I'll do my best to help you out

Dave


--
You received this message because you are subscribed to the Google Groups "ror_ecommerce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ror_ecommerc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mariano Giagante

unread,
Jan 8, 2016, 3:06:06 PM1/8/16
to ror_ec...@googlegroups.com
Thank you for your quick reply, David!

Your insight will be very useful.

--
You received this message because you are subscribed to a topic in the Google Groups "ror_ecommerce" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ror_ecommerce/1ctgFRFw4X8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ror_ecommerc...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
# [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “Click!”
Reply all
Reply to author
Forward
0 new messages