mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
refactor(router): add support to store signature_network and is_regulated in payment attempts (#8891)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -319,6 +319,8 @@ pub struct PaymentMetricsBucketValue {
|
||||
pub debit_routed_transaction_count: Option<u64>,
|
||||
pub debit_routing_savings: Option<u64>,
|
||||
pub debit_routing_savings_in_usd: Option<u64>,
|
||||
pub signature_network: Option<String>,
|
||||
pub is_issuer_regulated: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
|
||||
@ -124,6 +124,13 @@ impl CoBadgedCardNetworks {
|
||||
pub fn get_card_networks(&self) -> Vec<common_enums::CardNetwork> {
|
||||
self.0.iter().map(|info| info.network.clone()).collect()
|
||||
}
|
||||
|
||||
pub fn get_signature_network(&self) -> Option<common_enums::CardNetwork> {
|
||||
self.0
|
||||
.iter()
|
||||
.find(|info| info.network.is_signature_network())
|
||||
.map(|info| info.network.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&DebitRoutingOutput> for payment_methods::CoBadgedCardData {
|
||||
|
||||
@ -1229,6 +1229,8 @@ impl From<CardDetailFromLocker> for payments::AdditionalCardInfo {
|
||||
card_holder_name: item.card_holder_name,
|
||||
payment_checks: None,
|
||||
authentication_data: None,
|
||||
is_regulated: None,
|
||||
signature_network: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1252,6 +1254,8 @@ impl From<CardDetailFromLocker> for payments::AdditionalCardInfo {
|
||||
card_holder_name: item.card_holder_name,
|
||||
payment_checks: None,
|
||||
authentication_data: None,
|
||||
is_regulated: None,
|
||||
signature_network: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2970,6 +2970,15 @@ pub struct AdditionalCardInfo {
|
||||
/// Details about the threeds environment.
|
||||
/// This is a free form field and the structure varies from processor to processor
|
||||
pub authentication_data: Option<serde_json::Value>,
|
||||
|
||||
/// Indicates if the card issuer is regulated under government-imposed interchange fee caps.
|
||||
/// In the United States, this includes debit cards that fall under the Durbin Amendment,
|
||||
/// which imposes capped interchange fees.
|
||||
pub is_regulated: Option<bool>,
|
||||
|
||||
/// The global signature network under which the card is issued.
|
||||
/// This represents the primary global card brand, even if the transaction uses a local network
|
||||
pub signature_network: Option<api_enums::CardNetwork>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user