From 6d65743147ffde9fdc9947714d5233dabab73f59 Mon Sep 17 00:00:00 2001 From: AkshayaFoiger Date: Thu, 18 Jan 2024 16:28:23 +0530 Subject: [PATCH] resolve comment: make stripe country req --- crates/router/src/connector/aci/transformers.rs | 2 +- crates/router/src/connector/paypal/transformers.rs | 2 +- crates/router/src/connector/stripe/transformers.rs | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/router/src/connector/aci/transformers.rs b/crates/router/src/connector/aci/transformers.rs index 41007aeb2702..97cef72b02a7 100644 --- a/crates/router/src/connector/aci/transformers.rs +++ b/crates/router/src/connector/aci/transformers.rs @@ -204,7 +204,7 @@ impl payment_brand: PaymentBrand::Sofortueberweisung, bank_account_country: Some(country.to_owned().ok_or( errors::ConnectorError::MissingRequiredField { - field_name: "country", + field_name: "sofort.country", }, )?), bank_account_bank_name: None, diff --git a/crates/router/src/connector/paypal/transformers.rs b/crates/router/src/connector/paypal/transformers.rs index bbe7c9a83254..baf8f48279d9 100644 --- a/crates/router/src/connector/paypal/transformers.rs +++ b/crates/router/src/connector/paypal/transformers.rs @@ -367,7 +367,7 @@ fn get_payment_source( })? .get_billing_name()?, country_code: country.ok_or(errors::ConnectorError::MissingRequiredField { - field_name: "sofort.billing_details.country", + field_name: "sofort.country", })?, experience_context: ContextStruct { return_url: item.request.complete_authorize_url.clone(), diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index 26a7b7cc4a0e..90d5bda84fed 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -292,7 +292,7 @@ pub struct StripeSofort { #[serde(rename = "payment_method_options[sofort][preferred_language]")] preferred_language: Option, #[serde(rename = "payment_method_data[sofort][country]")] - country: Option, + country: api_enums::CountryAlpha2, } #[derive(Debug, Eq, PartialEq, Serialize)] @@ -1648,7 +1648,9 @@ impl TryFrom<&payments::BankRedirectData> for StripePaymentMethodData { } => Ok(Self::BankRedirect(StripeBankRedirectData::StripeSofort( Box::new(StripeSofort { payment_method_data_type, - country: *country, + country: country.ok_or(errors::ConnectorError::MissingRequiredField { + field_name: "sofort.country", + })?, preferred_language: preferred_language.clone(), }), ))),