-
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
Braintree and Worldpay: support overriding NTID #5129
Conversation
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.
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 = {}) |
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.
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?
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.
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.
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.
I would love another AM veteran's approval on this before deploy, but from my angle, it looks sensible.
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.
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
2b7644c
to
c59da4f
Compare
* 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
* 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
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