-
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
feat(router): Add support for retries with clear pan and network token payment method data #6905
base: main
Are you sure you want to change the base?
Conversation
{ | ||
match self { | ||
Ok(a) => a, | ||
Err(_) => func().await, |
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 should not be ignoring the error here
@@ -59,6 +59,7 @@ pub struct Profile { | |||
pub max_auto_retries_enabled: Option<i16>, | |||
pub is_click_to_pay_enabled: bool, | |||
pub authentication_product_ids: Option<serde_json::Value>, | |||
pub is_clear_pan_retries_enabled: Option<bool>, |
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.
pub is_clear_pan_retries_enabled: Option<bool>, | |
pub is_clear_pan_retries_enabled: bool, |
|
||
#[derive(Clone, serde::Serialize, Debug)] | ||
pub enum VaultData { | ||
CardVaultData(hyperswitch_domain_models::payment_method_data::Card), |
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.
nit: naming consistency
pub enum VaultData {
Card(),
NetworkToken(),
CardAndNetworkToken()
}
@@ -4432,6 +4441,47 @@ where | |||
pub tax_data: Option<TaxData>, | |||
pub session_id: Option<String>, | |||
pub service_details: Option<api_models::payments::CtpServiceDetails>, | |||
pub vault_operation: Option<PaymentMethodDataAction>, |
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.
why is the field called vault_operation where the struct says PaymentMethodDataAction?
@@ -1904,12 +1904,93 @@ pub async fn retrieve_card_with_permanent_token( | |||
todo!() | |||
} | |||
|
|||
pub enum VaultFetchAction { | |||
FetchCardDetailsFromLocker, | |||
FetchCardDetailsForNetworkTransactionFlowFromLocker, |
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.
nit:
FetchCardDetailsForNetworkTransactionFlowFromLocker, | |
FetchCardDetailsForNetworkTransactionIdFlowFromLocker, |
@@ -140,7 +142,22 @@ where | |||
break; | |||
} | |||
|
|||
let connector = super::get_connector_data(&mut connectors)?; | |||
let is_network_token = matches!( |
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.
This can be a impl based fn on PaymentMethodData
.unwrap_or(false) | ||
&& business_profile.is_clear_pan_retries_enabled; | ||
|
||
let connector = if should_retry_with_pan { |
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.
Please add relevant code comments here
&& business_profile.is_clear_pan_retries_enabled; | ||
|
||
let connector = if should_retry_with_pan { | ||
original_connector_data.clone() |
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 clone required here?
Type of Change
Description
Add support to retry a transaction with clear PAN or Network Token
Additional Changes
Motivation and Context
How did you test it?
Checklist
cargo +nightly fmt --all
cargo clippy