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

Barclaycard Smartpay: 3DS2 Support #3251

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

britth
Copy link
Contributor

@britth britth commented Jun 21, 2019

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)

@britth britth requested review from nfarve and jeremywrowe June 21, 2019 19:56
@@ -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)
Copy link

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?

Copy link
Contributor Author

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

Copy link

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.

Copy link

@nfarve nfarve left a 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|
Copy link
Contributor

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?

Copy link
Contributor Author

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'
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good :D

@britth britth force-pushed the barclaycard-3ds2 branch 3 times, most recently from 04a8d42 to 5fef6f1 Compare June 25, 2019 15:29
Copy link
Contributor

@jeremywrowe jeremywrowe left a comment

Choose a reason for hiding this comment

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

@britth britth force-pushed the barclaycard-3ds2 branch from 5fef6f1 to 8e274a2 Compare June 25, 2019 16:41
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
@britth britth force-pushed the barclaycard-3ds2 branch from 8e274a2 to 0bf63dd Compare June 25, 2019 16:43
@britth britth merged commit 0bf63dd into activemerchant:master Jun 25, 2019
whitby3001 pushed a commit to whitby3001/active_merchant that referenced this pull request Sep 3, 2019
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
@britth britth deleted the barclaycard-3ds2 branch October 29, 2019 18:03
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