-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix(connector): send valid sdk information in authentication flow netcetera #4474
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab9825b
fix(connector): send sdk information in authentication flow netcetera
hrithikesh026 40c2098
fix: send country_code after trimming + prefix
hrithikesh026 b3b6fbc
fix: down.sql query
hrithikesh026 23b0347
fix: fix app based authentication flow
hrithikesh026 4ead2ac
address comments
hrithikesh026 fa42b0b
fix: do state to code conversion only if state is sent as full string
hrithikesh026 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,7 +154,9 @@ impl | |
.acs_reference_number, | ||
acs_trans_id: response.authentication_response.acs_trans_id, | ||
three_dsserver_trans_id: Some(response.three_ds_server_trans_id), | ||
acs_signed_content: None, | ||
acs_signed_content: response | ||
.authentication_response | ||
.acs_signed_content, | ||
}, | ||
)) | ||
} | ||
|
@@ -430,7 +432,7 @@ pub struct NetceteraAuthenticationRequest { | |
pub acquirer: Option<netcetera_types::AcquirerData>, | ||
pub merchant: Option<netcetera_types::MerchantData>, | ||
pub broad_info: Option<String>, | ||
pub device_render_options: Option<String>, | ||
pub device_render_options: Option<netcetera_types::DeviceRenderingOptionsSupported>, | ||
pub message_extension: Option<Vec<netcetera_types::MessageExtensionAttribute>>, | ||
pub challenge_message_extension: Option<Vec<netcetera_types::MessageExtensionAttribute>>, | ||
pub browser_information: Option<netcetera_types::Browser>, | ||
|
@@ -552,6 +554,22 @@ impl TryFrom<&NetceteraRouterData<&types::authentication::ConnectorAuthenticatio | |
}; | ||
let browser_information = request.browser_details.map(netcetera_types::Browser::from); | ||
let sdk_information = request.sdk_information.map(netcetera_types::Sdk::from); | ||
let device_render_options = match request.device_channel { | ||
api_models::payments::DeviceChannel::App => { | ||
Some(netcetera_types::DeviceRenderingOptionsSupported { | ||
// hard-coded until core provides these values. | ||
sdk_interface: netcetera_types::SdkInterface::Both, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should always be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per netcetera we are supposed to send this value. |
||
sdk_ui_type: vec![ | ||
netcetera_types::SdkUiType::Text, | ||
netcetera_types::SdkUiType::SingleSelect, | ||
netcetera_types::SdkUiType::MultiSelect, | ||
netcetera_types::SdkUiType::Oob, | ||
netcetera_types::SdkUiType::HtmlOther, | ||
], | ||
}) | ||
} | ||
api_models::payments::DeviceChannel::Browser => None, | ||
}; | ||
Ok(Self { | ||
preferred_protocol_version: Some(pre_authn_data.message_version), | ||
enforce_preferred_protocol_version: None, | ||
|
@@ -567,15 +585,15 @@ impl TryFrom<&NetceteraRouterData<&types::authentication::ConnectorAuthenticatio | |
three_ds_server_trans_id: pre_authn_data.threeds_server_transaction_id, | ||
three_ds_requestor_url: Some(request.three_ds_requestor_url), | ||
cardholder_account, | ||
cardholder: Some(netcetera_types::Cardholder::from(( | ||
cardholder: Some(netcetera_types::Cardholder::try_from(( | ||
request.billing_address, | ||
request.shipping_address, | ||
))), | ||
))?), | ||
purchase: Some(purchase), | ||
acquirer: Some(acquirer_details), | ||
merchant: Some(merchant_data), | ||
broad_info: None, | ||
device_render_options: None, | ||
device_render_options, | ||
message_extension: None, | ||
challenge_message_extension: None, | ||
browser_information, | ||
|
@@ -625,6 +643,7 @@ pub struct AuthenticationResponse { | |
pub acs_reference_number: Option<String>, | ||
#[serde(rename = "acsTransID")] | ||
pub acs_trans_id: Option<String>, | ||
pub acs_signed_content: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Serialize, Clone)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
migrations/2024-04-28-095920_make_error_message_field_text/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- This file should undo anything in `up.sql` | ||
ALTER TABLE authentication ALTER COLUMN error_message TYPE VARCHAR(64); |
2 changes: 2 additions & 0 deletions
2
migrations/2024-04-28-095920_make_error_message_field_text/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- Your SQL goes here | ||
ALTER TABLE authentication ALTER COLUMN error_message TYPE TEXT; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We need not call
to_state_code_as_optional
here if it's already sent as state code, we should check and call this fn only if required (asstate
in our request is a String and any value can be sent there)