mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
feat(pm_list): [Trustpay] add bank_redirect - blik pm type required field info for trustpay (#2390)
This commit is contained in:
@ -868,7 +868,7 @@ pub enum BankRedirectData {
|
|||||||
Bizum {},
|
Bizum {},
|
||||||
Blik {
|
Blik {
|
||||||
// Blik Code
|
// Blik Code
|
||||||
blik_code: String,
|
blik_code: Option<String>,
|
||||||
},
|
},
|
||||||
Eps {
|
Eps {
|
||||||
/// The billing details for bank redirection
|
/// The billing details for bank redirection
|
||||||
|
|||||||
@ -3840,6 +3840,85 @@ impl Default for super::settings::RequiredFields {
|
|||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
enums::PaymentMethodType::Blik,
|
||||||
|
ConnectorFields {
|
||||||
|
fields: HashMap::from([
|
||||||
|
(
|
||||||
|
enums::Connector::Adyen,
|
||||||
|
RequiredFieldFinal {
|
||||||
|
mandate: HashMap::new(),
|
||||||
|
non_mandate: HashMap::new(),
|
||||||
|
common: HashMap::from([
|
||||||
|
(
|
||||||
|
"payment_method_data.bank_redirect.blik.blik_code".to_string(),
|
||||||
|
RequiredFieldInfo {
|
||||||
|
required_field: "payment_method_data.bank_redirect.blik.blik_code".to_string(),
|
||||||
|
display_name: "blik_code".to_string(),
|
||||||
|
field_type: enums::FieldType::UserBlikCode,
|
||||||
|
value: None,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
(
|
||||||
|
enums::Connector::Stripe,
|
||||||
|
RequiredFieldFinal {
|
||||||
|
mandate: HashMap::new(),
|
||||||
|
non_mandate: HashMap::new(),
|
||||||
|
common: HashMap::from([
|
||||||
|
(
|
||||||
|
"payment_method_data.bank_redirect.blik.blik_code".to_string(),
|
||||||
|
RequiredFieldInfo {
|
||||||
|
required_field: "payment_method_data.bank_redirect.blik.blik_code".to_string(),
|
||||||
|
display_name: "blik_code".to_string(),
|
||||||
|
field_type: enums::FieldType::UserBlikCode,
|
||||||
|
value: None,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
(
|
||||||
|
enums::Connector::Trustpay,
|
||||||
|
RequiredFieldFinal {
|
||||||
|
mandate: HashMap::new(),
|
||||||
|
non_mandate: HashMap::new(),
|
||||||
|
common: HashMap::from([
|
||||||
|
(
|
||||||
|
"billing.address.first_name".to_string(),
|
||||||
|
RequiredFieldInfo {
|
||||||
|
required_field: "billing.address.first_name".to_string(),
|
||||||
|
display_name: "billing_first_name".to_string(),
|
||||||
|
field_type: enums::FieldType::UserBillingName,
|
||||||
|
value: None,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"billing.address.last_name".to_string(),
|
||||||
|
RequiredFieldInfo {
|
||||||
|
required_field: "billing.address.last_name".to_string(),
|
||||||
|
display_name: "billing_last_name".to_string(),
|
||||||
|
field_type: enums::FieldType::UserBillingName,
|
||||||
|
value: None,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"email".to_string(),
|
||||||
|
RequiredFieldInfo {
|
||||||
|
required_field: "email".to_string(),
|
||||||
|
display_name: "email".to_string(),
|
||||||
|
field_type: enums::FieldType::UserEmailAddress,
|
||||||
|
value: None,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
},
|
||||||
|
),
|
||||||
])),
|
])),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2034,7 +2034,11 @@ impl<'a> TryFrom<&api_models::payments::BankRedirectData> for AdyenPaymentMethod
|
|||||||
api_models::payments::BankRedirectData::Blik { blik_code } => {
|
api_models::payments::BankRedirectData::Blik { blik_code } => {
|
||||||
Ok(AdyenPaymentMethod::Blik(Box::new(BlikRedirectionData {
|
Ok(AdyenPaymentMethod::Blik(Box::new(BlikRedirectionData {
|
||||||
payment_type: PaymentType::Blik,
|
payment_type: PaymentType::Blik,
|
||||||
blik_code: blik_code.to_string(),
|
blik_code: blik_code.clone().ok_or(
|
||||||
|
errors::ConnectorError::MissingRequiredField {
|
||||||
|
field_name: "blik_code",
|
||||||
|
},
|
||||||
|
)?,
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
api_models::payments::BankRedirectData::Eps { bank_name, .. } => Ok(
|
api_models::payments::BankRedirectData::Eps { bank_name, .. } => Ok(
|
||||||
|
|||||||
@ -1582,7 +1582,7 @@ impl TryFrom<&payments::BankRedirectData> for StripePaymentMethodData {
|
|||||||
type Error = error_stack::Report<errors::ConnectorError>;
|
type Error = error_stack::Report<errors::ConnectorError>;
|
||||||
fn try_from(bank_redirect_data: &payments::BankRedirectData) -> Result<Self, Self::Error> {
|
fn try_from(bank_redirect_data: &payments::BankRedirectData) -> Result<Self, Self::Error> {
|
||||||
let payment_method_data_type = StripePaymentMethodType::try_from(bank_redirect_data)?;
|
let payment_method_data_type = StripePaymentMethodType::try_from(bank_redirect_data)?;
|
||||||
match bank_redirect_data.deref() {
|
match bank_redirect_data {
|
||||||
payments::BankRedirectData::BancontactCard { .. } => Ok(Self::BankRedirect(
|
payments::BankRedirectData::BancontactCard { .. } => Ok(Self::BankRedirect(
|
||||||
StripeBankRedirectData::StripeBancontactCard(Box::new(StripeBancontactCard {
|
StripeBankRedirectData::StripeBancontactCard(Box::new(StripeBancontactCard {
|
||||||
payment_method_data_type,
|
payment_method_data_type,
|
||||||
@ -1591,7 +1591,11 @@ impl TryFrom<&payments::BankRedirectData> for StripePaymentMethodData {
|
|||||||
payments::BankRedirectData::Blik { blik_code } => Ok(Self::BankRedirect(
|
payments::BankRedirectData::Blik { blik_code } => Ok(Self::BankRedirect(
|
||||||
StripeBankRedirectData::StripeBlik(Box::new(StripeBlik {
|
StripeBankRedirectData::StripeBlik(Box::new(StripeBlik {
|
||||||
payment_method_data_type,
|
payment_method_data_type,
|
||||||
code: blik_code.to_owned(),
|
code: blik_code.clone().ok_or(
|
||||||
|
errors::ConnectorError::MissingRequiredField {
|
||||||
|
field_name: "blik_code",
|
||||||
|
},
|
||||||
|
)?,
|
||||||
})),
|
})),
|
||||||
)),
|
)),
|
||||||
payments::BankRedirectData::Eps { bank_name, .. } => Ok(Self::BankRedirect(
|
payments::BankRedirectData::Eps { bank_name, .. } => Ok(Self::BankRedirect(
|
||||||
|
|||||||
@ -2911,12 +2911,10 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"blik": {
|
"blik": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
|
||||||
"blik_code"
|
|
||||||
],
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"blik_code": {
|
"blik_code": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"nullable": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user