refactor(connector): [Mifinity] add a field language_preference in payment request for mifinity payment method data (#5326)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Swangi Kumari
2024-07-15 21:40:58 +05:30
committed by GitHub
parent 0f70473a3a
commit e4a0ff1c19
6 changed files with 80 additions and 0 deletions

View File

@ -8224,6 +8224,51 @@ impl Default for super::settings::RequiredFields {
value: None,
}
),
(
"payment_method_data.wallet.mifinity.language_preference".to_string(),
RequiredFieldInfo {
required_field: "payment_method_data.wallet.mifinity.language_preference".to_string(),
display_name: "language_preference".to_string(),
field_type: enums::FieldType::LanguagePreference{
options: vec![
"BR".to_string(),
"PT_BR".to_string(),
"CN".to_string(),
"ZH_CN".to_string(),
"DE".to_string(),
"DK".to_string(),
"DA".to_string(),
"DA_DK".to_string(),
"EN".to_string(),
"ES".to_string(),
"FI".to_string(),
"FR".to_string(),
"GR".to_string(),
"EL".to_string(),
"EL_GR".to_string(),
"HR".to_string(),
"IT".to_string(),
"JP".to_string(),
"JA".to_string(),
"JA_JP".to_string(),
"LA".to_string(),
"ES_LA".to_string(),
"NL".to_string(),
"NO".to_string(),
"PL".to_string(),
"PT".to_string(),
"RU".to_string(),
"SV".to_string(),
"SE".to_string(),
"SV_SE".to_string(),
"ZH".to_string(),
"TW".to_string(),
"ZH_TW".to_string(),
]
},
value: None,
}
),
]),
}
),

View File

@ -63,6 +63,8 @@ pub struct MifinityPaymentsRequest {
destination_account_number: Secret<String>,
brand_id: Secret<String>,
return_url: String,
#[serde(skip_serializing_if = "Option::is_none")]
language_preference: Option<String>,
}
#[derive(Debug, Serialize, PartialEq)]
@ -136,6 +138,7 @@ impl TryFrom<&MifinityRouterData<&types::PaymentsAuthorizeRouterData>> for Mifin
let destination_account_number = metadata.destination_account_number;
let trace_id = item.router_data.connector_request_reference_id.clone();
let brand_id = metadata.brand_id;
let language_preference = data.language_preference;
Ok(Self {
money,
client,
@ -147,6 +150,7 @@ impl TryFrom<&MifinityRouterData<&types::PaymentsAuthorizeRouterData>> for Mifin
destination_account_number,
brand_id,
return_url: item.router_data.request.get_router_return_url()?,
language_preference,
})
}
domain::WalletData::AliPayQr(_)