refactor(FRM): refactor frm configs (#4581)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
chikke srujan
2024-05-17 15:53:13 +05:30
committed by GitHub
parent a62f69d447
commit 853f3b4854
32 changed files with 137 additions and 148 deletions

View File

@ -729,8 +729,11 @@ pub struct FrmPaymentMethod {
///payment methods(card, wallet, etc) that can be used in the payment
#[schema(value_type = PaymentMethod,example = "card")]
pub payment_method: Option<common_enums::PaymentMethod>,
///payment method types(credit, debit) that can be used in the payment
pub payment_method_types: Vec<FrmPaymentMethodType>,
///payment method types(credit, debit) that can be used in the payment. This field is deprecated. It has not been removed to provide backward compatibility.
pub payment_method_types: Option<Vec<FrmPaymentMethodType>>,
///frm flow type to be used, can be pre/post
#[schema(value_type = Option<FrmPreferredFlowTypes>)]
pub flow: Option<api_enums::FrmPreferredFlowTypes>,
}
///Details of FrmPaymentMethodType are mentioned here... it should be passed in payment connector create api call, and stored in merchant_connector_table
@ -743,7 +746,7 @@ pub struct FrmPaymentMethodType {
///card networks(like visa mastercard) types that can be used in the payment
#[schema(value_type = CardNetwork)]
pub card_networks: Option<Vec<common_enums::CardNetwork>>,
///frm flow type to be used...can be pre/post
///frm flow type to be used, can be pre/post
#[schema(value_type = FrmPreferredFlowTypes)]
pub flow: api_enums::FrmPreferredFlowTypes,
///action that the frm would take, in case fraud is detected

View File

@ -464,7 +464,8 @@ pub struct PaymentsRequest {
pub session_expiry: Option<u32>,
/// additional data related to some frm connectors
pub frm_metadata: Option<serde_json::Value>,
#[schema(value_type = Option<Object>, example = r#"{ "coverage_request" : "fraud", "fulfillment_method" : "delivery" }"#)]
pub frm_metadata: Option<pii::SecretSerdeValue>,
/// Whether to perform external authentication (if applicable)
#[schema(example = true)]
@ -3410,6 +3411,10 @@ pub struct PaymentsResponse {
#[schema(example = "2022-09-10T10:11:12Z")]
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub updated: Option<PrimitiveDateTime>,
/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. FRM Metadata is useful for storing additional, structured information on an object related to FRM.
#[schema(value_type = Option<Object>, example = r#"{ "fulfillment_method" : "deliver", "coverage_request" : "fraud" }"#)]
pub frm_metadata: Option<pii::SecretSerdeValue>,
}
#[derive(Setter, Clone, Default, Debug, PartialEq, serde::Serialize, ToSchema)]