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

feat(connector): [Novalnet] Add zero auth mandate #6631

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cookieg13
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Added zero auth mandates for Novalnet

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Tested manually
https://docs.google.com/document/d/1i4SSX837Dh9ipfOz24bDwJF8osR_UPmfPLWUbLP3bh0/edit?usp=sharing

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@cookieg13 cookieg13 requested review from a team as code owners November 21, 2024 11:30
Copy link

semanticdiff-com bot commented Nov 21, 2024

@cookieg13 cookieg13 self-assigned this Nov 21, 2024
@cookieg13 cookieg13 changed the title Add novalnet zero auth mandate feat(connector): [Novalnet] Add zero auth mandate Nov 21, 2024
srujanchikke
srujanchikke previously approved these changes Nov 25, 2024
Comment on lines 1403 to 1410
let enforce_3d = match item.auth_type {
enums::AuthenticationType::ThreeDs => Some(1),
enums::AuthenticationType::NoThreeDs => None,
};
let test_mode = match item.test_mode {
Some(true) => 1,
Some(false) | None => 0,
};
Copy link
Member

Choose a reason for hiding this comment

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

Should we consider using constants or enums here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, sure

mobile: item.get_optional_billing_phone_number(),
billing: Some(billing),
// no_nc is used to indicate if minimal customer data is passed or not
no_nc: 1,
Copy link
Member

Choose a reason for hiding this comment

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

We can use constants here.

let custom = NovalnetCustom { lang };
let hook_url = item.request.get_webhook_url()?;
let return_url = item.request.get_return_url()?;
let create_token = Some(1);
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

Comment on lines +3040 to +3050
let webhook_url = Some(helpers::create_webhook_url(
router_base_url,
&attempt.merchant_id,
connector_name,
));
Copy link
Member

Choose a reason for hiding this comment

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

@Narayanbhat166 @sai-harsha-vardhan Should we consider passing MerchantConnectorAccountId here, instead of the connector name? Basically update the create_webhook_url() function as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it's always recommended to use MerchantConnectorAccountId in webhook url

Copy link
Contributor Author

@cookieg13 cookieg13 Nov 26, 2024

Choose a reason for hiding this comment

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

@sai-harsha-vardhan @SanchithHegde I made a new fn create_webhook_url_using_mca_id ,but only used it in line 226 (crates/router/src/core/payments/transformers.rs:226) . In the other places where create_webhook_url() is currently used the MerchantConnectorAccountId value is Optional, so we cant replace connector name with simply MerchantConnectorAccountId.

Copy link
Member

Choose a reason for hiding this comment

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

we will always have the merchant_connector_id when constructing the router data. So if it is not found you can raise an internal server error.

I do not see any harm in updating the existing webhook function.

SanchithHegde
SanchithHegde previously approved these changes Nov 27, 2024
crates/router/src/core/payments/helpers.rs Outdated Show resolved Hide resolved
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.

5 participants