-
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
Conversation
@@ -37,7 +37,7 @@ def authorize(money, creditcard, options = {}) | |||
post[:card] = credit_card_hash(creditcard) | |||
post[:billingAddress] = billing_address_hash(options) if options[:billing_address] | |||
post[:deliveryAddress] = shipping_address_hash(options) if options[:shipping_address] | |||
add_3ds(post, options) if options[:execute_threed] | |||
add_3ds(post, 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.
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 the execute_threed
flag or not), or will check that a 3ds flag is present before falling back to adding 3ds1 data
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.
👍 Might be something to monitor when it goes in production.
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.
🐘
key, val = x.split('=', 2) | ||
[key.split('.').last, CGI.unescape(val)] | ||
parsed_response = {} | ||
response.split('&').map do |x| |
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.
It's really confusing what this is doing - can't we just use: http://ruby-doc.org/stdlib-2.6.3/libdoc/cgi/rdoc/CGI.html#method-c-parse?
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 - updated 👍 Outside of this spot, does the rest of the method seem overly complex (creating the nested hash)?
if device_channel = three_ds_2_options[:channel] | ||
post[:threeDS2RequestData] = { | ||
deviceChannel: device_channel, | ||
notificationURL: three_ds_2_options[:notification_url] || 'https://example.com/notification' |
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.
The fallback URL is problematic - we should remove it from Adyen also. This is being done for tests as a convenience.
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.
removed fallback and added value within 3ds2_options hash passed in tests
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.
Sounds good :D
04a8d42
to
5fef6f1
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.
This preps Barclaycard Smartpay for 3DS2 integration. The api version is bumped up to 40 to get relevant 3DS2 functionality, and additional browser_info is captured. The parse method is also updated so that it can return a nested hash with an additionalData field for 3DS2. Unit: 28 tests, 142 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed Remote: 34 tests, 76 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 97.0588% passed (failed `test_successful_third_party_payout` - unrelated invalid credentials error) Closes activemerchant#3251
This preps Barclaycard Smartpay for 3DS2 integration. The api version is bumped up to 40 to get relevant 3DS2 functionality, and additional browser_info is captured. The parse method is also updated so that it can return a nested hash with an additionalData field for 3DS2. Unit: 28 tests, 142 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed Remote: 34 tests, 76 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 97.0588% passed (failed `test_successful_third_party_payout` - unrelated invalid credentials error) Closes activemerchant#3251
This preps Barclaycard Smartpay for 3DS2 integration. The api version
is bumped up to 40 to get relevant 3DS2 functionality, and additional
browser_info is captured. The parse method is also updated so that it
can return a nested hash with an additionalData field for 3DS2.
Unit:
28 tests, 142 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Remote:
34 tests, 76 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
97.0588% passed
(failed
test_successful_third_party_payout
- unrelated invalid credentials error)