Page MenuHomePhabricator

CLP amounts to adyen are missing the conversion to cents
Closed, ResolvedPublic

Description

Donor example cid=63386792

Donation of CLP 10400 which should be ~$10.50 being sent to Adyen's API as:

"amount": {
  "currency": "CLP",
  "value": 10400
},

and since Adyen is expecting this in cents, it's being charged for CLP 104.00

Event Timeline

Damilare moved this task from Triage to DRI Backlog on the Fundraising-Backlog board.

We've got CLP on the list of 'NoDecimalCurrencies' along with JPY here:
https://phabricator.wikimedia.org/diffusion/WFSP/browse/master/Core/Helpers/CurrencyRoundingHelper.php$13

That's consulted in getAmountInMinorUnits, which we're calling both from Gravy and Adyen code.

At https://docs.adyen.com/development-resources/currency-codes/ they list CLP as using 2 decimal places in their API but note that it 'differs from standard', so I guess we need an adyen-specific fix here for CLP and a couple others

Change #1121084 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/SmashPig@master] Add exceptions to currency minor units for Adyen

https://gerrit.wikimedia.org/r/1121084

Change #1121084 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] Add exceptions to currency minor units for Adyen

https://gerrit.wikimedia.org/r/1121084

XenoRyet set Final Story Points to 2.