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

Adyen: Add support for non-fractional currencies #3257

Merged
merged 1 commit into from
Jun 26, 2019

Conversation

molbrown
Copy link
Contributor

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

@molbrown molbrown requested a review from a team June 26, 2019 14:01
@molbrown molbrown force-pushed the ECS-420_adyen_jpy branch from c41e208 to 8672986 Compare June 26, 2019 14:14
}
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)
Copy link
Member

@jknipp jknipp Jun 26, 2019

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:

  1. use a multi-line comment / line breaks for the long comment
  2. what_amount -> calculate_amount ??

Copy link
Member

@jknipp jknipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@molbrown molbrown force-pushed the ECS-420_adyen_jpy branch from 8672986 to 0a5d734 Compare June 26, 2019 18:02
Copy link
Contributor

@curiousepic curiousepic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@molbrown molbrown force-pushed the ECS-420_adyen_jpy branch from 0a5d734 to 5399c0b Compare June 26, 2019 18:47
@@ -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)
Copy link
Contributor Author

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.

Copy link
Member

@jknipp jknipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM!

@molbrown molbrown force-pushed the ECS-420_adyen_jpy branch from 5399c0b to 74bae85 Compare June 26, 2019 19:01
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
@molbrown molbrown force-pushed the ECS-420_adyen_jpy branch from 74bae85 to bcd95f1 Compare June 26, 2019 19:17
@molbrown molbrown merged commit bcd95f1 into activemerchant:master Jun 26, 2019
whitby3001 pushed a commit to whitby3001/active_merchant that referenced this pull request Sep 3, 2019
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
@molbrown molbrown deleted the ECS-420_adyen_jpy branch July 1, 2020 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants