Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(connector): [Airwallex] Remove optional fields for Ideal and Klarna pm (#9060)
Vani Guptad112179f2efe
diff --git a/crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs b/crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rsindex 60ac4ae5a4..9d3029b6db 100644--- a/crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs@@ -308,8 +308,7 @@ pub struct KlarnaData {#[derive(Debug, Serialize)]pub struct KlarnaDetails {country_code: enums::CountryAlpha2,- language: Option<String>,- billing: Billing,+ billing: Option<Billing>,}#[derive(Debug, Serialize)]@@ -319,7 +318,7 @@ pub struct Billing {first_name: Option<Secret<String>>,last_name: Option<Secret<String>>,phone_number: Option<Secret<String>>,- address: AddressAirwallex,+ address: Option<AddressAirwallex>,}#[derive(Debug, Serialize)]@@ -643,23 +642,19 @@ fn get_paylater_details(field_name: "country_code",}})?,- language: item- .router_data- .request- .get_optional_language_from_browser_info(),- billing: Billing {+ billing: Some(Billing {date_of_birth: None,first_name: item.router_data.get_optional_billing_first_name(),last_name: item.router_data.get_optional_billing_last_name(),email: item.router_data.get_optional_billing_email(),phone_number: item.router_data.get_optional_billing_phone_number(),- address: AddressAirwallex {+ address: Some(AddressAirwallex {country_code: item.router_data.get_optional_billing_country(),city: item.router_data.get_optional_billing_city(),street: item.router_data.get_optional_billing_line1(),postcode: item.router_data.get_optional_billing_zip(),- },- },+ }),+ }),},payment_method_type: AirwallexPaymentType::Klarna,})))@@ -722,11 +717,9 @@ fn get_bankredirect_details(payment_method_type: AirwallexPaymentType::Blik,}))}- BankRedirectData::Ideal { bank_name } => {+ BankRedirectData::Ideal { .. } => {AirwallexPaymentMethod::BankRedirect(AirwallexBankRedirectData::Ideal(IdealData {- ideal: IdealDetails {- bank_name: *bank_name,- },+ ideal: IdealDetails { bank_name: None },payment_method_type: AirwallexPaymentType::Ideal,}))}diff --git a/crates/payment_methods/src/configs/payment_connector_required_fields.rs b/crates/payment_methods/src/configs/payment_connector_required_fields.rsindex 732b188900..e9ce3fed08 100644--- a/crates/payment_methods/src/configs/payment_connector_required_fields.rs+++ b/crates/payment_methods/src/configs/payment_connector_required_fields.rs@@ -1665,7 +1665,11 @@ fn get_bank_redirect_required_fields(non_mandate: HashMap::from([RequiredField::BillingUserFirstName.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(),},@@ -1899,6 +1903,7 @@ fn get_bank_redirect_required_fields((Connector::Globalpay, fields(vec![], vec![], vec![])),(Connector::Mollie, fields(vec![], vec![], vec![])),(Connector::Nexinets, fields(vec![], vec![], vec![])),+ (Connector::Airwallex, fields(vec![], vec![], vec![])),(Connector::Nuvei,RequiredFieldFinal {@@ -2845,7 +2850,8 @@ fn get_pay_later_required_fields() -> HashMap<enums::PaymentMethodType, ConnectoRequiredFieldFinal {mandate: HashMap::new(),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()]),common: HashMap::new(),