refactor(bank-redirect): remove billing from bankredirect payment data (#4362)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Swangi Kumari
2024-05-15 13:24:28 +05:30
committed by GitHub
parent ff1c2ddf8b
commit 0958d948f9
14 changed files with 222 additions and 438 deletions

View File

@ -1450,9 +1450,9 @@ impl GetAddressFromPaymentMethodData for PaymentMethodData {
Self::CardRedirect(_) => None,
Self::Wallet(wallet_data) => wallet_data.get_billing_address(),
Self::PayLater(pay_later) => pay_later.get_billing_address(),
Self::BankRedirect(_) => None,
Self::BankRedirect(bank_redirect_data) => bank_redirect_data.get_billing_address(),
Self::BankDebit(bank_debit_data) => bank_debit_data.get_billing_address(),
Self::BankTransfer(_) => None,
Self::BankTransfer(bank_transfer_data) => bank_transfer_data.get_billing_address(),
Self::Voucher(voucher_data) => voucher_data.get_billing_address(),
Self::Crypto(_)
| Self::Reward
@ -1814,11 +1814,11 @@ pub enum BankRedirectData {
},
Interac {
/// The country for bank payment
#[schema(value_type = CountryAlpha2, example = "US")]
country: api_enums::CountryAlpha2,
#[schema(value_type = Option<CountryAlpha2>, example = "US")]
country: Option<api_enums::CountryAlpha2>,
#[schema(value_type = String, example = "john.doe@example.com")]
email: Email,
#[schema(value_type = Option<String>, example = "john.doe@example.com")]
email: Option<Email>,
},
OnlineBankingCzechRepublic {
// Issuer banks
@ -1978,7 +1978,7 @@ impl GetAddressFromPaymentMethodData for BankRedirectData {
..
} => get_billing_address_inner(billing_details.as_ref(), country.as_ref(), None),
Self::Interac { country, email } => {
get_billing_address_inner(None, Some(country), Some(email))
get_billing_address_inner(None, country.as_ref(), email.as_ref())
}
Self::OnlineBankingFinland { email } => {
get_billing_address_inner(None, None, email.as_ref())