-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Adyen: Add support for non-fractional currencies #3257
Conversation
c41e208
to
8672986
Compare
} | ||
post[:modificationAmount] = amount | ||
end | ||
|
||
# temporary method in place to support Spreedly customers switching over to sending multiplied amounts for non-fractional currency transactions, as now required for localized_amount. To avoid amount manipulation, send opt_out_multiply_amount with any non-fractional currency transaction. | ||
def what_amount(money, options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small nitpicks, though knowing this is a temporary measure, I don't feel strongly about updating these:
- use a multi-line comment / line breaks for the long comment
what_amount
->calculate_amount
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
8672986
to
0a5d734
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
0a5d734
to
5399c0b
Compare
@@ -9,6 +9,7 @@ class AdyenGateway < Gateway | |||
|
|||
self.supported_countries = ['AT', 'AU', 'BE', 'BG', 'BR', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GI', 'GR', 'HK', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MT', 'MX', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SG', 'SK', 'SI', 'US'] | |||
self.default_currency = 'USD' | |||
self.currencies_without_fractions = %w(CVE DJF GNF IDR JPY KMF KRW PYG RWF UGX VND VUV XAF XOF XPF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @jknipp @curiousepic I added a local override for currencies_without_fractions according to https://docs.adyen.com/development-resources/currency-codes/#description and added a CLP test to confirm intended behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM!
5399c0b
to
74bae85
Compare
Adds localized_amount to determine amount, to allow correct handling of non-fractional currencies. Includes a what_amount method which will protect customers already transacting on Adyen from a sudden change in their transaction amounts. what_amount will be removed after coordinating. ECS-420 Unit: 40 tests, 191 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed Remote: 60 tests, 187 assertions, 4 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 93.3333% passed Failures due to error message change, unrelated Closes activemerchant#3257
74bae85
to
bcd95f1
Compare
Adds localized_amount to determine amount, to allow correct handling of non-fractional currencies. Includes a what_amount method which will protect customers already transacting on Adyen from a sudden change in their transaction amounts. what_amount will be removed after coordinating. ECS-420 Unit: 40 tests, 191 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed Remote: 60 tests, 187 assertions, 4 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 93.3333% passed Failures due to error message change, unrelated Closes activemerchant#3257
Adds localized_amount to determine amount, to allow correct handling of
non-fractional currencies.
Includes a what_amount method which will protect customers already transacting on
Adyen from a sudden change in their transaction amounts. what_amount
will be removed after coordinating.
ECS-420
Unit:
40 tests, 189 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Remote:
60 tests, 187 assertions, 4 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
93.3333% passed
Failures due to error message change, unrelated