fix(connector): [Airwallex] Remove optional fields for Ideal and Klarna pm (#9060)

Co-authored-by: Vani Gupta <vani.gupta@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Vani Gupta
2025-08-28 17:09:46 +05:30
committed by GitHub
parent 26930a47e9
commit d112179f2e
2 changed files with 16 additions and 17 deletions

View File

@ -308,8 +308,7 @@ pub struct KlarnaData {
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
pub struct KlarnaDetails { pub struct KlarnaDetails {
country_code: enums::CountryAlpha2, country_code: enums::CountryAlpha2,
language: Option<String>, billing: Option<Billing>,
billing: Billing,
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
@ -319,7 +318,7 @@ pub struct Billing {
first_name: Option<Secret<String>>, first_name: Option<Secret<String>>,
last_name: Option<Secret<String>>, last_name: Option<Secret<String>>,
phone_number: Option<Secret<String>>, phone_number: Option<Secret<String>>,
address: AddressAirwallex, address: Option<AddressAirwallex>,
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
@ -643,23 +642,19 @@ fn get_paylater_details(
field_name: "country_code", field_name: "country_code",
} }
})?, })?,
language: item billing: Some(Billing {
.router_data
.request
.get_optional_language_from_browser_info(),
billing: Billing {
date_of_birth: None, date_of_birth: None,
first_name: item.router_data.get_optional_billing_first_name(), first_name: item.router_data.get_optional_billing_first_name(),
last_name: item.router_data.get_optional_billing_last_name(), last_name: item.router_data.get_optional_billing_last_name(),
email: item.router_data.get_optional_billing_email(), email: item.router_data.get_optional_billing_email(),
phone_number: item.router_data.get_optional_billing_phone_number(), phone_number: item.router_data.get_optional_billing_phone_number(),
address: AddressAirwallex { address: Some(AddressAirwallex {
country_code: item.router_data.get_optional_billing_country(), country_code: item.router_data.get_optional_billing_country(),
city: item.router_data.get_optional_billing_city(), city: item.router_data.get_optional_billing_city(),
street: item.router_data.get_optional_billing_line1(), street: item.router_data.get_optional_billing_line1(),
postcode: item.router_data.get_optional_billing_zip(), postcode: item.router_data.get_optional_billing_zip(),
}, }),
}, }),
}, },
payment_method_type: AirwallexPaymentType::Klarna, payment_method_type: AirwallexPaymentType::Klarna,
}))) })))
@ -722,11 +717,9 @@ fn get_bankredirect_details(
payment_method_type: AirwallexPaymentType::Blik, payment_method_type: AirwallexPaymentType::Blik,
})) }))
} }
BankRedirectData::Ideal { bank_name } => { BankRedirectData::Ideal { .. } => {
AirwallexPaymentMethod::BankRedirect(AirwallexBankRedirectData::Ideal(IdealData { AirwallexPaymentMethod::BankRedirect(AirwallexBankRedirectData::Ideal(IdealData {
ideal: IdealDetails { ideal: IdealDetails { bank_name: None },
bank_name: *bank_name,
},
payment_method_type: AirwallexPaymentType::Ideal, payment_method_type: AirwallexPaymentType::Ideal,
})) }))
} }

View File

@ -1665,7 +1665,11 @@ fn get_bank_redirect_required_fields(
non_mandate: HashMap::from([ non_mandate: HashMap::from([
RequiredField::BillingUserFirstName.to_tuple(), RequiredField::BillingUserFirstName.to_tuple(),
RequiredField::BillingUserLastName.to_tuple(), RequiredField::BillingUserLastName.to_tuple(),
RequiredField::BillingAddressCountries(vec!["ALL"]).to_tuple(), RequiredField::BillingAddressCountries(vec![
"DE", "DK", "EE", "ES", "FI", "GB", "LV", "LT", "NL", "PL", "PT",
"SE", "SK",
])
.to_tuple(),
]), ]),
common: HashMap::new(), common: HashMap::new(),
}, },
@ -1899,6 +1903,7 @@ fn get_bank_redirect_required_fields(
(Connector::Globalpay, fields(vec![], vec![], vec![])), (Connector::Globalpay, fields(vec![], vec![], vec![])),
(Connector::Mollie, fields(vec![], vec![], vec![])), (Connector::Mollie, fields(vec![], vec![], vec![])),
(Connector::Nexinets, fields(vec![], vec![], vec![])), (Connector::Nexinets, fields(vec![], vec![], vec![])),
(Connector::Airwallex, fields(vec![], vec![], vec![])),
( (
Connector::Nuvei, Connector::Nuvei,
RequiredFieldFinal { RequiredFieldFinal {
@ -2845,7 +2850,8 @@ fn get_pay_later_required_fields() -> HashMap<enums::PaymentMethodType, Connecto
RequiredFieldFinal { RequiredFieldFinal {
mandate: HashMap::new(), mandate: HashMap::new(),
non_mandate: HashMap::from([RequiredField::BillingAddressCountries(vec![ non_mandate: HashMap::from([RequiredField::BillingAddressCountries(vec![
"ALL", "AT", "BE", "FI", "FR", "DE", "GR", "IE", "IT", "NL", "PT", "ES", "DK",
"NO", "PL", "SE", "CH", "GB", "CZ", "US",
]) ])
.to_tuple()]), .to_tuple()]),
common: HashMap::new(), common: HashMap::new(),