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:
Prajjwal Kumar
2024-01-11 17:58:29 +05:30
committed by GitHub
parent e376f68c16
commit bb096138b5
60 changed files with 1649 additions and 38 deletions

View 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 {}

View File

@ -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;

View File

@ -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)]