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

Braintree and Worldpay: support overriding NTID #5129

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

aenand
Copy link
Contributor

@aenand aenand commented May 21, 2024

COMP-160

Adds support for the Braintree Blue and Worldpay gateways for merchants to override and bring their own NTID instead of relying on the standardized NTID framework

Test Summary
Local:
5908 tests, 79610 assertions, 0 failures, 23 errors, 0 pendings, 0 omissions, 0 notifications 99.6107% passed
Unit:
Worldpay:
119 tests, 672 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed
Braintree:
104 tests, 219 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed
Remote:
Worldpay:
104 tests, 447 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 97.1154% passed
Braintree:
120 tests, 646 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed

@aenand aenand requested review from travismorrison and a team May 22, 2024 18:40
Copy link

@travismorrison travismorrison left a comment

Choose a reason for hiding this comment

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

looks straightforward and good. I do have a code design ask that I feel sufficiently in my bones that I can't approve. however it may be misguided, lmk

@@ -949,13 +949,13 @@ def stored_credentials_v1(parameters, stored_credential)
end
end

def add_external_vault(parameters, stored_credential)
def add_external_vault(parameters, stored_credential, options = {})
Copy link

@travismorrison travismorrison May 24, 2024

Choose a reason for hiding this comment

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

I would suggest changing this signature to def add_external_vault(parameters, credential) (note loss of stored_ rather than a third argument, and choose which credential you want to send in earlier in the flow.

passing in options is a little confusing because options is from whence stored_credential[:network_transaction_id] comes from. So you got a function where argument 2 is a child of argument 3. unless I'm missing something.

Furthermore... there is this up top:

return unless (stored_credential = options[:stored_credential])

does this need to be updated now that options[:network_transaction_id] is a thing? Or is the "old style" still the sole table stakes to moving forward in this control flow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AM's pattern prefers options over alternate naming if it's the full options hash. I do get your point about argument 2 is from argument 3 so I'll drop the stored_credential one.

Additionally the upper conditional does not need to be modified because we still need to make sure the stored credential mappings are in place before adding a NTID which is what the return unless (stored_credential = options[:stored_credential]) logic checks.

Copy link

@travismorrison travismorrison left a comment

Choose a reason for hiding this comment

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

I would love another AM veteran's approval on this before deploy, but from my angle, it looks sensible.

Copy link
Contributor

@curiousepic curiousepic left a comment

Choose a reason for hiding this comment

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

Nice and simple, looks good.

COMP-160

Adds support for the Braintree Blue and Worldpay gateways for
merchants to override and bring their own NTID instead of relying
on the standardized NTID framework

Test Summary
Local:
5908 tests, 79610 assertions, 0 failures, 23 errors, 0 pendings, 0 omissions, 0 notifications
99.6107% passed
Unit:
Worldpay:
119 tests, 672 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Braintree:
104 tests, 219 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Remote:
Worldpay:
104 tests, 447 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
97.1154% passed
Braintree:
120 tests, 646 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
@aenand aenand merged commit 283127f into master Jun 5, 2024
5 checks passed
@aenand aenand deleted the COMP-160_override_ntid branch June 5, 2024 18:10
edgarv09 pushed a commit that referenced this pull request Jun 6, 2024
* Braintree and Worldpay: support overriding NTID

COMP-160

Adds support for the Braintree Blue and Worldpay gateways for
merchants to override and bring their own NTID instead of relying
on the standardized NTID framework

Test Summary
Local:
5908 tests, 79610 assertions, 0 failures, 23 errors, 0 pendings, 0 omissions, 0 notifications
99.6107% passed
Unit:
Worldpay:
119 tests, 672 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Braintree:
104 tests, 219 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Remote:
Worldpay:
104 tests, 447 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
97.1154% passed
Braintree:
120 tests, 646 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

* PR feedback

* changelog
bryansquadup pushed a commit to givehub/active_merchant that referenced this pull request Aug 21, 2024
* Braintree and Worldpay: support overriding NTID

COMP-160

Adds support for the Braintree Blue and Worldpay gateways for
merchants to override and bring their own NTID instead of relying
on the standardized NTID framework

Test Summary
Local:
5908 tests, 79610 assertions, 0 failures, 23 errors, 0 pendings, 0 omissions, 0 notifications
99.6107% passed
Unit:
Worldpay:
119 tests, 672 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Braintree:
104 tests, 219 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Remote:
Worldpay:
104 tests, 447 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
97.1154% passed
Braintree:
120 tests, 646 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

* PR feedback

* changelog
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