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

Updated the Adyen NT and stored credential flow. #5216

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

DustinHaefele
Copy link
Contributor

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)

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])

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?

Copy link
Contributor Author

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])

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.

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, 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.

Copy link
Contributor Author

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)
@DustinHaefele DustinHaefele merged commit a92bd42 into master Aug 29, 2024
5 checks passed
@DustinHaefele DustinHaefele deleted the adyen_update_nt_flow branch August 29, 2024 11: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.

2 participants