liberapay / liberapay.com

Source code of the recurrent donations platform Liberapay
https://liberapay.com/
1.67k stars 215 forks source link

Adding money to Liberapay via direct debit cause 400 bad request #853

Closed emiljoha closed 6 years ago

emiljoha commented 6 years ago

Hi all,

After creating an account I tried to add money to liberapay via direct debit. I entered my IBAN number and selected one of the precomputed amounts. But when pressing the green Procced button I was greeted with an error page with the following message.

400 Bad Request 500 {"Message":"Internal Server Error","Type":"other","Id":"4c25fc92-2b83-4516-9a7c-55ba091e114a#1512924143","Date":1512924145.0,"errors":null}

Whatever I might have done wrong, that is not a message to show users.

Might be worth to mention that I am accessing the site from Sweden and tried to make the transaction in euro.

Changaco commented 6 years ago

Hi,

This is indeed a serious problem and you're the second person reporting it today.

The error seems to arise during mandate creation, it probably means that either Mangopay or GoCardless are malfunctioning. I haven't received any incident notification from Mangopay and I don't see any in http://status.mangopay.com/ either. Same for GoCardless, https://www.gocardless-status.com/.

Changaco commented 6 years ago

More error messages from the other person who reported this issue via email:

500 {"Message":"Internal Server Error","Type":"other","Id":"3d4a1762-10f3-41f2-b5dd-e64126ee3a09#1512912449","Date":1512912450.0,"errors":null}

500 {"Message":"Internal Server Error","Type":"other","Id":"d18f1788-877c-4deb-9e0c-e0dd94e6b42d#1512912774","Date":1512912775.0,"errors":null}

LeifSimmons commented 6 years ago

Those were the errors I reported. I actually have 4 deposits "awaiting confirmation" in my wallet from the attempts I made (I made 4 attempts). I was also accessing Librapay from Sweden and tried to make transactions in euro.

LiamDawe commented 6 years ago

@jeremyboom8 that's really not helpful or relevant.

Changaco commented 6 years ago

Mystery solved: euro direct debits actually only work inside the Eurozone, not the whole SEPA. I'm very disappointed and annoyed right now.

Changaco commented 6 years ago

More precisely: SEPA - Available countries for payment collection.

GoCardless supports organisations intending to collect SEPA Direct Debit payments from customers based in the following countries:

  • Austria
  • Belgium
  • Cyprus
  • Estonia
  • France
  • Germany
  • Ireland
  • Italy
  • Latvia
  • Luxembourg
  • Malta
  • Monaco
  • Netherlands
  • Portugal
  • San Marino
  • Slovenia
  • Spain

In some SEPA Eurozone countries, SEPA Direct Debit experiences higher failure rates. This is normally due to the way that SEPA has been implemented by local banks within each SEPA country.

In the following countries, we have observed significantly higher failure rates when collecting Direct Debit payments:

  • Finland
  • Greece
  • Lithuania
  • Slovakia

You may still collect payments from these countries successfully, but please be aware that higher failure rates have been reported. If you're interested in collecting from one of these countries, then please contact us for further info.

LeifSimmons commented 6 years ago

Ah, that explains it :) On the other hand, when they say "SEPA Eurozone" it is misleading. The Eurozone is basically a subset of SEPA.

Anyway, there's a good graph on Swedish wikipedia: https://sv.wikipedia.org/wiki/Gemensamma_eurobetalningsområdet#/media/File:Single_euro_payments_area.svg

Though the legend is unfortunately only in Swedish so I'll give a rough translation here: Blue = Eurozone Green = Member states outside the Eurozone Dark purple = European Economic Area + Switzerland Light purple = Micro states that are participating in SEPA

LeifSimmons commented 6 years ago

Any changes needed in order to resolve the pending transaction in the Wallet for those of us that have experienced this issue, or will these go away by some timeout?

Changaco commented 6 years ago

There's no timeout in this case so I'll switch the payments to "failed" manually.

Changaco commented 6 years ago

Actually I had to delete them instead. (Edit: because updating failed with ERROR: new row for relation "exchanges" violates check constraint "remote_id_null_chk".)

DELETE FROM exchanges WHERE status = 'pre-mandate' AND "timestamp" < now() - interval '1 day';
Changaco commented 6 years ago

Extra note: I noticed that the list of countries copy-pasted above contains Monaco and San Marino but not Andorra, so I sent a question to GoCardless. Here's the response:

I'm afraid that we cannot currently collect payments from Andorra.