Skip to content

Commit

Permalink
refactor: remove useless struct
Browse files Browse the repository at this point in the history
  • Loading branch information
swangi-kumari committed May 13, 2024
1 parent de5e5e8 commit 3ddd2cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 34 deletions.
12 changes: 0 additions & 12 deletions crates/router/src/connector/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1508,18 +1508,6 @@ impl AddressDetailsData for api::AddressDetails {
}
}

pub trait BankRedirectBillingData {
fn get_billing_name(&self) -> Result<Secret<String>, Error>;
}

impl BankRedirectBillingData for domain::BankRedirectBilling {
fn get_billing_name(&self) -> Result<Secret<String>, Error> {
self.billing_name
.clone()
.ok_or_else(missing_field_err("billing_details.billing_name"))
}
}

pub trait MandateData {
fn get_end_date(&self, format: date_time::DateFormat) -> Result<String, Error>;
fn get_metadata(&self) -> Result<pii::SecretSerdeValue, Error>;
Expand Down
25 changes: 3 additions & 22 deletions crates/router/src/types/domain/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,6 @@ pub enum BankRedirectData {
},
}

#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct BankRedirectBilling {
pub billing_name: Option<Secret<String>>,
pub email: Option<Email>,
}

#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct CryptoData {
Expand Down Expand Up @@ -707,16 +701,12 @@ impl From<api_models::payments::BankRedirectData> for BankRedirectData {
bank_account_iban,
..
} => Self::Giropay {
// billing_details: billing_details.map(BankRedirectBilling::from),
bank_account_bic,
bank_account_iban,
// country,
},
api_models::payments::BankRedirectData::Ideal { bank_name, .. } => Self::Ideal {
// billing_details: billing_details.map(BankRedirectBilling::from),
bank_name,
// country,
},
api_models::payments::BankRedirectData::Ideal { bank_name, .. } => {
Self::Ideal { bank_name }
}
api_models::payments::BankRedirectData::Interac { .. } => Self::Interac {},
api_models::payments::BankRedirectData::OnlineBankingCzechRepublic { issuer } => {
Self::OnlineBankingCzechRepublic { issuer }
Expand Down Expand Up @@ -750,15 +740,6 @@ impl From<api_models::payments::BankRedirectData> for BankRedirectData {
}
}

impl From<api_models::payments::BankRedirectBilling> for BankRedirectBilling {
fn from(billing: api_models::payments::BankRedirectBilling) -> Self {
Self {
billing_name: billing.billing_name,
email: billing.email,
}
}
}

impl From<api_models::payments::CryptoData> for CryptoData {
fn from(value: api_models::payments::CryptoData) -> Self {
let api_models::payments::CryptoData { pay_currency } = value;
Expand Down

0 comments on commit 3ddd2cb

Please sign in to comment.