Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement multiple currencies #182

Closed
Changaco opened this issue Feb 23, 2016 · 32 comments
Closed

Implement multiple currencies #182

Changaco opened this issue Feb 23, 2016 · 32 comments
Assignees
Labels
Payday issues about the weekly “pay day” payments issues about money transfers UI issues concerning the User Interface

Comments

@Changaco
Copy link
Member

Changaco commented Feb 23, 2016

I just realized that we didn't actually have an open issue for this, so here it is.

MangoPay currently supports the following currencies in addition to euros: GBP, CAD, SEK, NOK, DKK, CHF, ZAR, PLN, USD, AUD.

Fees become a lot more complicated when we introduce other currencies into the equation.

@Changaco Changaco added UI issues concerning the User Interface Payday issues about the weekly “pay day” payments issues about money transfers labels Feb 23, 2016
@Changaco
Copy link
Member Author

I think this is still not a priority (previous statement: #44 (comment)).

@Changaco
Copy link
Member Author

I asked MangoPay if they were planning to add support for currency conversion to their API, they said no.

Not having currency conversion means that it would be more likely that a donor could find themselves in the annoying situation of having money in their Liberapay account but still needing to add more because the person they want to give to only accepts other currencies.

@MartinDelille
Copy link
Contributor

Would it be possible to rely on another service for conversion?

@Changaco
Copy link
Member Author

Would it be possible to rely on another service for conversion?

Assuming that such a service exists, it would be complicated and probably not instantaneous. There would also be the problem of bypassing MangoPay's fees.

We could allow users to trade currencies between themselves, but that wouldn't guarantee always being able to convert your money when you want to.

@aggsol
Copy link
Contributor

aggsol commented Feb 9, 2017

Does this include Bitcoin (XBT)?

@Changaco
Copy link
Member Author

Changaco commented Feb 9, 2017

Does this include Bitcoin (XBT)?

Not directly, but implementing native support of Bitcoins requires multiple currencies accounting. That's why #364 is tagged as Blocked on this issue.

@aggsol
Copy link
Contributor

aggsol commented Mar 21, 2017

If the incoming money would always exchanged to Euro then no multiple currency accounting would be necessary. Like the the provider would accept Bitcoin, USD etc. on Liberapays behalf, exchange it to Euros.

@Changaco
Copy link
Member Author

Automatic currency conversion is built into credit card systems, Liberapay donors whose bank accounts aren't denominated in euros can pay by card. This issue is about implementing multiple currencies in Liberapay itself.

@aggsol
Copy link
Contributor

aggsol commented Oct 12, 2017

Just to be clear: Running everything in EUR and just displaying a converted amount in an another currency is not an option?

@Changaco
Copy link
Member Author

No, we want real support for multiple currencies, it's the big missing piece of our internationalization efforts.

@Changaco
Copy link
Member Author

The priority is US dollars, and we can start by only supporting one currency per account if that simplifies things.

@Changaco
Copy link
Member Author

I've sent a message to Mangopay asking for clarifications on how exactly billing works for transactions in foreign currencies.

@Changaco
Copy link
Member Author

One of the first steps here is to introduce currencies into the DB schema. If https://github.com/samv/pg-currency was still alive it would have been a nice solution.

@Changaco
Copy link
Member Author

I see two possibilities:

  • create our own composite type (amount, currency) in SQL
  • use separate currency columns

@Changaco
Copy link
Member Author

Changaco commented Oct 14, 2017

Regarding exchange rates, I guess we can use the reference rates from the European Central Bank, specifically this XML file which is updated daily around 16:00 CET.

Other options: https://stackoverflow.com/questions/3139879/how-do-i-get-currency-exchange-rates-via-an-api-such-as-google-finance.

@Changaco Changaco self-assigned this Oct 14, 2017
@Changaco
Copy link
Member Author

Changaco commented Oct 15, 2017

Regarding mixed-currency situations (e.g. when a European wants to donate to a US-based person), I'm thinking we could have the following user preferences to determine what to do:

  • main_currency
  • accept_foreign_currencies | Accept currencies other than main_currency? If not then the burden is on the donors, which can deter donations but simplifies things for the recipient.

As previously mentioned in #182 (comment) we could also implement currency swapping, and have the following preferences:

  • convert_foreign_currencies | Attempt to automatically swap foreign currencies with users willing to swap in the other direction?
  • trade_currencies | Participate in currency swapping even if convert_foreign_currencies is turned off?

@Changaco
Copy link
Member Author

WIP status: 26 commits, 83 files changed, 1291 insertions(+), 698 deletions(-).

This was referenced Oct 26, 2017
@Changaco
Copy link
Member Author

Changaco commented Nov 1, 2017

Total of the first 3 pull requests: 38 commits, 97 files changed, 2261 insertions(+), 1161 deletions(-).

@Changaco
Copy link
Member Author

Changaco commented Nov 1, 2017

Deployment went badly, we have lots of errors, including DB self-check failures.

@Changaco
Copy link
Member Author

Changaco commented Nov 1, 2017

I've managed to fix almost everything. The remaining issues aren't critical.

@Changaco
Copy link
Member Author

Changaco commented Nov 3, 2017

Payments in USD weren't actually working because the currency wasn't enabled in our production account. I contacted mangopay and they've just enabled it.

@Changaco
Copy link
Member Author

Changaco commented Nov 3, 2017

What should the default currency be once our support of the US dollar has improved and stabilized?

A relevant map: https://en.wikipedia.org/wiki/File:DOLLAR_AND_EURO_IN_THE_WORLD.svg

@mattbk
Copy link
Contributor

mattbk commented Nov 8, 2017

Is this working and documented yet?

@Changaco
Copy link
Member Author

Changaco commented Nov 8, 2017

The work isn't complete. I've started writing a blog post to announce the support of USD, but first I need to implement:

  • changing the main_currency and accept_all_currencies settings of one's account
  • proper handling of multiple currencies when adding or withdrawing money

@mattbk
Copy link
Contributor

mattbk commented Nov 8, 2017

Thanks, just trying to keep up.

@Changaco
Copy link
Member Author

Changaco commented Nov 10, 2017

I've been working on adapting the Giving page to multiple currencies. Here's what I have:

liberapay-2017-11-10-giving-page

@Changaco
Copy link
Member Author

Changaco commented Dec 2, 2017

Screenshot of the currency settings form I've been working on

@Changaco
Copy link
Member Author

Changaco commented Dec 7, 2017

Draft announcement: https://medium.com/@liberapay/liberapay-now-supports-us-dollars-f9484e3008f8

@Changaco
Copy link
Member Author

Changaco commented Dec 7, 2017

Wondering if I should publish now or wait.

@Changaco
Copy link
Member Author

Changaco commented Dec 7, 2017

@Changaco
Copy link
Member Author

Changaco commented Dec 7, 2017

Let's call this done and move to new issues for the rest of the work.

@Changaco
Copy link
Member Author

Changaco commented Dec 9, 2017

Spanish translation of the blog post by @jorgesumle: Liberapay ya acepta dólares americanos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Payday issues about the weekly “pay day” payments issues about money transfers UI issues concerning the User Interface
Development

No branches or pull requests

4 participants