-
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: Set 3DS exemptions via API #3331
Adyen: Set 3DS exemptions via API #3331
Conversation
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.
🐘
@@ -340,6 +340,10 @@ def add_3ds(post, options) | |||
post[:browserInfo] = { userAgent: options[:user_agent], acceptHeader: options[:accept_header] } | |||
post[:additionalData] = { executeThreeD: 'true' } if options[:execute_threed] | |||
end | |||
if options[:sca_exemption] && !options[:execute_threed].nil? |
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.
This logic has some subtleties that might be worth locking down in the unit test suite. Could we add a couple tests which assert the expected shape of the outgoing request via a check_request
block (a la test_update_shopper_statement_and_industry_usage_sent
) given various combinations of :sca_exemption
and :execute_threed
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.
This can be simplified by using Hash#has_key?
eg:
if options.has_key?(:sca_exception) && options.has_key?(:execute_threed)
...
end
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.
Good call 👍 Since from what i've seen, these exemptions are only relevant for 3ds2, moved this snippet of logic up to the conditional related to 3ds2 and added unit tests to check that values are sent as expected
9df0c8b
to
c894331
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.
There are a few different ways to request exemptions via Adyen. Users can let Adyen handle compliance by default, they can configure specific rules using dynamic 3dsecure, or they can set exemption flags via the API. This PR updates the Adyen gateway to allow users to set specific exemptions using the sca_exemption field, used in conjunction with the execute_threed field. Users can also now set execute_threed to false if they want to bypass 3DS on a transaction. Remote: 66 tests, 213 assertions, 2 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 96.9697% passed (2 failures unrelated, related to standalone 3ds feature) Unit: 47 tests, 228 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed
c894331
to
fca5cad
Compare
There are a few different ways to request exemptions via Adyen.
Users can let Adyen handle compliance by default, they can
configure specific rules using dynamic 3dsecure, or they can set
exemption flags via the API. This PR updates the Adyen gateway to
allow users to set specific exemptions using the sca_exemption
field, used in conjunction with the execute_threed field. Users
can also now set execute_threed to false if they want to bypass
3DS on a transaction.
Remote:
64 tests, 207 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Unit:
39 tests, 188 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed