Skip to content

Commit

Permalink
refactor(connector): revert changes to bankdebit()
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshayaFoiger committed Feb 18, 2024
1 parent c1c097a commit af5de90
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions crates/router/src/connector/stripe/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,7 @@ impl TryFrom<(&payments::BankRedirectData, Option<bool>)> for StripeBillingAddre

fn get_bank_debit_data(
bank_debit_data: &payments::BankDebitData,
) -> Result<(StripePaymentMethodType, BankDebitData, StripeBillingAddress), errors::ConnectorError>
{
) -> (StripePaymentMethodType, BankDebitData, StripeBillingAddress) {
match bank_debit_data {
payments::BankDebitData::AchBankDebit {
billing_details,
Expand All @@ -1206,7 +1205,7 @@ fn get_bank_debit_data(
};

let billing_data = StripeBillingAddress::from(billing_details);
Ok((StripePaymentMethodType::Ach, ach_data, billing_data))
(StripePaymentMethodType::Ach, ach_data, billing_data)
}
payments::BankDebitData::SepaBankDebit {
billing_details,
Expand All @@ -1218,7 +1217,7 @@ fn get_bank_debit_data(
};

let billing_data = StripeBillingAddress::from(billing_details);
Ok((StripePaymentMethodType::Sepa, sepa_data, billing_data))
(StripePaymentMethodType::Sepa, sepa_data, billing_data)
}
payments::BankDebitData::BecsBankDebit {
billing_details,
Expand All @@ -1232,7 +1231,7 @@ fn get_bank_debit_data(
};

let billing_data = StripeBillingAddress::from(billing_details);
Ok((StripePaymentMethodType::Becs, becs_data, billing_data))
(StripePaymentMethodType::Becs, becs_data, billing_data)
}
payments::BankDebitData::BacsBankDebit {
billing_details,
Expand All @@ -1246,7 +1245,7 @@ fn get_bank_debit_data(
};

let billing_data = StripeBillingAddress::from(billing_details);
Ok((StripePaymentMethodType::Bacs, bacs_data, billing_data))
(StripePaymentMethodType::Bacs, bacs_data, billing_data)
}
}
}
Expand Down Expand Up @@ -1309,7 +1308,7 @@ fn create_stripe_payment_method(
))
}
payments::PaymentMethodData::BankDebit(bank_debit_data) => {
let (pm_type, bank_debit_data, billing_address) = get_bank_debit_data(bank_debit_data)?;
let (pm_type, bank_debit_data, billing_address) = get_bank_debit_data(bank_debit_data);

let pm_data = StripePaymentMethodData::BankDebit(StripeBankDebitData {
bank_specific_data: bank_debit_data,
Expand Down Expand Up @@ -3519,7 +3518,7 @@ impl
Ok(Self::try_from((wallet_data, None))?)
}
api::PaymentMethodData::BankDebit(bank_debit_data) => {
let (_pm_type, bank_data, _) = get_bank_debit_data(&bank_debit_data)?;
let (_pm_type, bank_data, _) = get_bank_debit_data(&bank_debit_data);

Ok(Self::BankDebit(StripeBankDebitData {
bank_specific_data: bank_data,
Expand Down

0 comments on commit af5de90

Please sign in to comment.