Skip to content

Commit

Permalink
resolve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshayaFoiger committed Jan 18, 2024
1 parent 701affa commit ab92bbf
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
14 changes: 13 additions & 1 deletion crates/router/src/configs/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4451,6 +4451,18 @@ impl Default for super::settings::RequiredFields {
field_type: enums::FieldType::Text,
value: None,
}
),
(
"payment_method_data.bank_redirect.giropay.country".to_string(),
RequiredFieldInfo {
required_field: "payment_method_data.bank_redirect.giropay.country".to_string(),
display_name: "bank_account_iban".to_string(),
field_type: enums::FieldType::UserCountry {
options: vec![
"DE".to_string(),
]},
value: None,
}
)
]),
common: HashMap::new(),
Expand Down Expand Up @@ -4564,7 +4576,7 @@ impl Default for super::settings::RequiredFields {
RequiredFieldInfo {
required_field: "payment_method_data.bank_redirect.giropay.billing_details.billing_name".to_string(),
display_name: "billing_name".to_string(),
field_type: enums::FieldType::UserFullName,
field_type: enums::FieldType::UserBillingName,
value: None,
}
)
Expand Down
3 changes: 2 additions & 1 deletion crates/router/src/connector/aci/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ impl
api_models::payments::BankRedirectData::Giropay {
bank_account_bic,
bank_account_iban,
country,
..
} => Self::BankRedirect(Box::new(BankRedirectionPMData {
payment_brand: PaymentBrand::Giropay,
bank_account_country: Some(api_models::enums::CountryAlpha2::DE),
bank_account_country: *country,
bank_account_bank_name: None,
bank_account_bic: bank_account_bic.clone(),
bank_account_iban: bank_account_iban.clone(),
Expand Down
11 changes: 5 additions & 6 deletions crates/router/src/connector/stripe/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use uuid::Uuid;
use crate::{
collect_missing_value_keys,
connector::utils::{
self as connector_util, ApplePay, ApplePayDecrypt, PaymentsPreProcessingData, RouterData,
self as connector_util, ApplePay, ApplePayDecrypt, PaymentsPreProcessingData, RouterData, BankRedirectBillingData,
},
core::errors,
services,
Expand Down Expand Up @@ -1083,7 +1083,7 @@ impl From<&payments::BankDebitBilling> for StripeBillingAddress {
}

impl TryFrom<&payments::BankRedirectData> for StripeBillingAddress {
type Error = errors::ConnectorError;
type Error = error_stack::Report<errors::ConnectorError>;

fn try_from(bank_redirection_data: &payments::BankRedirectData) -> Result<Self, Self::Error> {
match bank_redirection_data {
Expand All @@ -1096,14 +1096,13 @@ impl TryFrom<&payments::BankRedirectData> for StripeBillingAddress {
payments::BankRedirectData::Giropay {
billing_details, ..
} => Ok(Self {
name: billing_details
name: Some(billing_details
.clone()
.ok_or(errors::ConnectorError::MissingRequiredField {
field_name: "giropay.billing_details",
})?
.billing_name
.clone(),
..Self::default()
.get_billing_name()?),
..Self::default()
}),
payments::BankRedirectData::Ideal {
billing_details, ..
Expand Down
8 changes: 2 additions & 6 deletions crates/router/src/connector/worldline/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
use url::Url;

use crate::{
connector::utils::{self, CardData},
connector::utils::{self, CardData, BankRedirectBillingData},
core::errors,
services,
types::{
Expand Down Expand Up @@ -388,11 +388,7 @@ fn make_bank_redirect_request(
.ok_or(errors::ConnectorError::MissingRequiredField {
field_name: "giropay.billing_details",
})?
.billing_name
.clone()
.ok_or(errors::ConnectorError::MissingRequiredField {
field_name: "billing_details.billing_name",
})?,
.get_billing_name()?,
iban: bank_account_iban.clone(),
},
}))
Expand Down

0 comments on commit ab92bbf

Please sign in to comment.