mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
feat(router): payment_method block (#3056)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: shashank_attarde <shashank.attarde@juspay.in>
This commit is contained in:
41
crates/api_models/src/blocklist.rs
Normal file
41
crates/api_models/src/blocklist.rs
Normal file
@ -0,0 +1,41 @@
|
||||
use common_enums::enums;
|
||||
use common_utils::events::ApiEventMetric;
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "snake_case", tag = "type", content = "data")]
|
||||
pub enum BlocklistRequest {
|
||||
CardBin(String),
|
||||
Fingerprint(String),
|
||||
ExtendedCardBin(String),
|
||||
}
|
||||
|
||||
pub type AddToBlocklistRequest = BlocklistRequest;
|
||||
pub type DeleteFromBlocklistRequest = BlocklistRequest;
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct BlocklistResponse {
|
||||
pub fingerprint_id: String,
|
||||
pub data_kind: enums::BlocklistDataKind,
|
||||
#[serde(with = "common_utils::custom_serde::iso8601")]
|
||||
pub created_at: time::PrimitiveDateTime,
|
||||
}
|
||||
|
||||
pub type AddToBlocklistResponse = BlocklistResponse;
|
||||
pub type DeleteFromBlocklistResponse = BlocklistResponse;
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct ListBlocklistQuery {
|
||||
pub data_kind: enums::BlocklistDataKind,
|
||||
#[serde(default = "default_list_limit")]
|
||||
pub limit: u16,
|
||||
#[serde(default)]
|
||||
pub offset: u16,
|
||||
}
|
||||
|
||||
fn default_list_limit() -> u16 {
|
||||
10
|
||||
}
|
||||
|
||||
impl ApiEventMetric for BlocklistRequest {}
|
||||
impl ApiEventMetric for BlocklistResponse {}
|
||||
impl ApiEventMetric for ListBlocklistQuery {}
|
||||
@ -3,6 +3,7 @@ pub mod admin;
|
||||
pub mod analytics;
|
||||
pub mod api_keys;
|
||||
pub mod bank_accounts;
|
||||
pub mod blocklist;
|
||||
pub mod cards_info;
|
||||
pub mod conditional_configs;
|
||||
pub mod connector_onboarding;
|
||||
|
||||
@ -2274,6 +2274,9 @@ pub struct PaymentsResponse {
|
||||
|
||||
/// List of incremental authorizations happened to the payment
|
||||
pub incremental_authorizations: Option<Vec<IncrementalAuthorizationResponse>>,
|
||||
|
||||
/// Payment Fingerprint
|
||||
pub fingerprint: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user