-
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
Updated the Adyen NT and stored credential flow. #5216
Conversation
921a35d
to
202bc07
Compare
def ecommerce_shopper_interaction?(payment, options) | ||
(options.dig(:stored_credential, :initial_transaction) && options.dig(:stored_credential, :initiator) == 'cardholder') || | ||
(payment.respond_to?(:verification_value) && payment.verification_value && options.dig(:stored_credential, :initial_transaction)) || | ||
(payment.is_a?(NetworkTokenizationCreditCard) && !options[:switch_cryptogram_mapping_nt]) |
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.
Does this mean you want to pass ecommerce if this a NetworkTokenizationCreditCard and switch_cryptogram_mapping_nt is nil?
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.
Yeah if it is nil or false.
I did this because when the flag is on I want to remove the payment.is_a?(NetworkTokenizationCreditCard) check that is there currently, and this allows the current functionality to stay the same while the flag is off.
|
||
def skip_mpi_data?(options = {}) | ||
# Skips adding the NT mpi data if it is explicitly skipped in options, or if it is MIT and not the initial transaction. | ||
options[:skip_mpi_data] == 'Y' || (!options.dig(:stored_credential, :initial_transaction) && options.dig(:stored_credential, :initiator) == 'merchant' && options[:switch_cryptogram_mapping_nt]) |
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.
Is this just because you want to test that it works all payment methods types? Because switch_cryptogram_mapping_nt is passed for all payment methods not just NT.
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, let me look at their docs and make sure I'm not missing something with other payment method types when it comes to mpi_data. I'll ensure that is in a good place before I move this closer to deployment.
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.
So the reason I am using the flag here is because I don't want to update the fields we are sending until we activate the flag. (!options.dig(:stored_credential, :initial_transaction) && options.dig(:stored_credential, :initiator) == 'merchant'
<== this portion is because Adyen's docs tell us to skip it when it is a follow-up merchant initiated transaction. I am adding the flag there because I don't want to start skipping the mpiData in new situations until we full activate this flow.
unit: 124 tests, 655 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed remote: 143 tests, 462 assertions, 13 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 90.9091% passed (Same store and unstore failures as master branch)
202bc07
to
da151c2
Compare
unit:
124 tests, 655 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed
remote:
143 tests, 462 assertions, 13 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 90.9091% passed (Same store and unstore failures as master branch)