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: Fail unexpected 3DS responses #3546

Conversation

curiousepic
Copy link
Contributor

There are certain situations where the initiator of a transaction is not
expecting or prepared to complete a 3DS challenge flow, yet an authorize
transaction triggers a 3DS auth response from Adyen.

Previously, if a 3DS flow was not expected, a Purchase was initiated,
and the auth step received a 3ds authentication response, the adapter
would assume the auth step succeeded, and perform the capture, for which
Adyen's response is not sufficient to indicate the money was actually
moved. This means the Purchase would be assumed to succeed when in fact
it was stalled at the 3DS auth step.

This change recognizes these situations and fails the transaction with a
meaningful message.

Remote:
82 tests, 276 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Unit:
59 tests, 279 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

@curiousepic curiousepic requested a review from a team February 25, 2020 18:39
@curiousepic curiousepic force-pushed the ECS_1015_adyen_3ds_kerfuffle branch 3 times, most recently from 9bd4572 to 7b863ae Compare February 25, 2020 20:36
@@ -520,7 +520,12 @@ def request_headers(options)
headers
end

def success_from(action, response)
def success_from(action, response, options)
if response.dig('resultCode') == 'RedirectShopper' && !options[:execute_threed] && !options[:threed_dynamic]
Copy link
Contributor

Choose a reason for hiding this comment

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

I know it's possible sometimes to have a direct challenge that skips the RedirectShooper result code and goes straight to ChallengeShopper - would that be possible in the dynamic 3ds scenario and do we need to check for that as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great question, I'm not sure if it's possible but it seems like a good idea to add it to the criteria.

There are certain situations where the initiator of a transaction is not
expecting or prepared to complete a 3DS challenge flow, yet an authorize
transaction triggers a 3DS auth response from Adyen.

Previously, if a 3DS flow was not expected, a Purchase was initiated,
and the auth step received a 3ds authentication response, the adapter
would assume the auth step succeeded, and perform the capture, for which
Adyen's response is not sufficient to indicate the money was actually
moved. This means the Purchase would be assumed to succeed when in fact
it was stalled at the 3DS auth step.

This change recognizes these situations and fails the transaction with a
meaningful message.

Remote:
82 tests, 276 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Unit:
59 tests, 279 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Copy link
Contributor

@britth britth 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, this change makes sense to me 👍

@curiousepic curiousepic requested a review from a team February 27, 2020 16:50
@curiousepic curiousepic marked this pull request as ready for review February 28, 2020 15:57
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.

None yet

3 participants