-
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
Barclaycard Smartpay: 3DS2 Support #3251
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,30 @@ def setup | |
zip: '95014', | ||
country: 'US' | ||
}) | ||
|
||
@normalized_3ds_2_options = { | ||
reference: '345123', | ||
shopper_email: '[email protected]', | ||
shopper_ip: '77.110.174.153', | ||
shopper_reference: 'John Smith', | ||
billing_address: address(), | ||
order_id: '123', | ||
stored_credential: {reason_type: 'unscheduled'}, | ||
three_ds_2: { | ||
channel: 'browser', | ||
browser_info: { | ||
accept_header: 'unknown', | ||
depth: 100, | ||
java: false, | ||
language: 'US', | ||
height: 1000, | ||
width: 500, | ||
timezone: '-120', | ||
user_agent: 'unknown' | ||
}, | ||
notification_url: 'https://example.com/notification' | ||
} | ||
} | ||
end | ||
|
||
def teardown | ||
|
@@ -176,6 +200,16 @@ def test_successful_authorize_with_3ds | |
refute response.params['paRequest'].blank? | ||
end | ||
|
||
def test_successful_authorize_with_3ds2_browser_client_data | ||
assert response = @gateway.authorize(@amount, @three_ds_enrolled_card, @normalized_3ds_2_options) | ||
assert response.test? | ||
refute response.authorization.blank? | ||
assert_equal response.params['resultCode'], 'IdentifyShopper' | ||
refute response.params['additionalData']['threeds2.threeDS2Token'].blank? | ||
refute response.params['additionalData']['threeds2.threeDSServerTransID'].blank? | ||
refute response.params['additionalData']['threeds2.threeDSMethodURL'].blank? | ||
end | ||
|
||
def test_successful_authorize_and_capture | ||
auth = @gateway.authorize(@amount, @credit_card, @options) | ||
assert_success auth | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,30 @@ def setup | |
zip: '95014', | ||
country: 'US' | ||
}) | ||
|
||
@normalized_3ds_2_options = { | ||
reference: '345123', | ||
shopper_email: '[email protected]', | ||
shopper_ip: '77.110.174.153', | ||
shopper_reference: 'John Smith', | ||
billing_address: address(), | ||
order_id: '123', | ||
stored_credential: {reason_type: 'unscheduled'}, | ||
three_ds_2: { | ||
channel: 'browser', | ||
browser_info: { | ||
accept_header: 'unknown', | ||
depth: 100, | ||
java: false, | ||
language: 'US', | ||
height: 1000, | ||
width: 500, | ||
timezone: '-120', | ||
user_agent: 'unknown' | ||
}, | ||
notification_url: 'https://example.com/notification' | ||
} | ||
} | ||
end | ||
|
||
def test_successful_purchase | ||
|
@@ -189,6 +213,18 @@ def test_successful_authorize_with_3ds | |
assert response.test? | ||
end | ||
|
||
def test_successful_authorize_with_3ds2_browser_client_data | ||
@gateway.stubs(:ssl_post).returns(successful_authorize_with_3ds2_response) | ||
|
||
assert response = @gateway.authorize(@amount, @three_ds_enrolled_card, @normalized_3ds_2_options) | ||
assert response.test? | ||
assert_equal '8815609737078177', response.authorization | ||
assert_equal response.params['resultCode'], 'IdentifyShopper' | ||
refute response.params['additionalData']['threeds2.threeDS2Token'].blank? | ||
refute response.params['additionalData']['threeds2.threeDSServerTransID'].blank? | ||
refute response.params['additionalData']['threeds2.threeDSMethodURL'].blank? | ||
end | ||
|
||
def test_failed_authorize | ||
@gateway.stubs(:ssl_post).returns(failed_authorize_response) | ||
|
||
|
@@ -395,6 +431,10 @@ def successful_authorize_with_3ds_response | |
'pspReference=8815161318854998&resultCode=RedirectShopper&issuerUrl=https%3A%2F%2Ftest.adyen.com%2Fhpp%2F3d%2Fvalidate.shtml&md=WIFa2sF3CuPyN53Txjt3U%2F%2BDuCsddzywiY5NLgEAdUAXPksHUzXL5E%2BsfvdpolkGWR8b1oh%2FNA3jNaUP9UCgfjhXqRslGFy9OGqcZ1ITMz54HHm%2FlsCKN9bTftKnYA4F7GqvOgcIIrinUZjbMvW9doGifwzSqYLo6ASOm6bARL5n7cIFV8IWtA2yPlO%2FztKSTRJt1glN4s8sMcpE57z4soWKMuycbdXdpp6d4ZRSa%2F1TPF0MnJF0zNaSAAkw9JpXqGMOz5sFF2Smpc38HXJzM%2FV%2B1mmoDhhWmXXOb5YQ0QSCS7DXKIcr8ZtuGuGmFp0QOfZiO41%2B2I2N7VhONVx8xSn%2BLu4m6vaDIg5qsnd9saxaWwbJpl9okKm6pB2MJap9ScuBCcvI496BPCrjQ2LHxvDWhk6M3Exemtv942NQIGlsiPaW0KXoC2dQvBsxWh0K&paRequest=eNpVUtuOgjAQ%2FRXj%2B1KKoIWMTVgxWR%2B8RNkPaMpEycrFUlb8%2B20B190%2BnXPm0pnTQnpRiMkJZauQwxabRpxxkmfLacQYDeiczihjgR%2BGbMrhEB%2FxxuEbVZNXJaeO63hAntSUK3kRpeYg5O19s%2BPUm%2FnBHMhIoUC1SXiKjT4URSxvba5QARlkKEWB%2FFSbgbLr41QIpXFVFUB6HWTVllo9OPNMwyeBVl35Reu6iQi53%2B9OM5Y7sipMVqmF1G9tA8QmAnlNeGgtakzjLs%2F4Pjl3u3TtbdNtZzDdJV%2FBPu7PEojNgExo5J5LmUvpfELDyPcjPwDS6yAKOxFffx4nxhXXrDwIUNt74oFQG%2FgrgLFdYSkfPFwws9WTAXZ1VaLJMPb%2BYiCvoVcf1mSpjW%2B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23wzQsAicwB9ZXXMgWbaS2OwdwsISQGOmsWrajzp7%2FvR0T4aHqJlrFvKnc9BrWEWbDi8g%2BDFZ2E2ifhFYSYhrHVA7yOIIDdTQnH3CIzaevxUAnbIyFsxrhy8USdP6R6CdJZ%2Bg0rIJ5%2FeZ5P8JjDiYJWi5FDJwy%2BNP9PQIFFim6psbELCtnAaW1m7pU1FeNwjYUGIdVD2f%2BVYJe4cWHPCaWAAsARNXTzjrfUEq%2BpEYDcs%2FLyTB8f69qSrmTSDGsCETsNNy27LY%2BtodGDKsxtW35jIqoV8l2Dra3wucman8nIZp3VTNtNvZDCqWetLXxBbFVZN6ecuoMPwhER5MBFUrkkXCSSFBK%2FNGp%2FXaEDP6A2hmUKvXikL3F9S7MIKQCUYC%2FI7K4DFYFBjTBzN4%3D&additionalData.threeds2.threeDSServerTransID=efbf9d05-5e6b-4659-a64e-f1dfa5d846c4&additionalData.threeds2.threeDSMethodURL=https%3A%2F%2Fpal-test.adyen.com%2Fthreeds2simulator%2Facs%2FstartMethod.shtml&pspReference=8815609737078177&resultCode=IdentifyShopper' | ||
end | ||
|
||
def failed_authorize_response | ||
'pspReference=7914002630895750&refusalReason=Refused&resultCode=Refused' | ||
end | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We don't need the
:execute_threed
?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 question - i was mostly leaning on what's happening for adyen, which, in the
add_3ds
method will add 3ds2 browser info if that gets passed in (whether it receives theexecute_threed
flag or not), or will check that a 3ds flag is present before falling back to adding 3ds1 dataThere 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.
👍 Might be something to monitor when it goes in production.