Skip to content

Commit

Permalink
resolve comment: make stripe country req
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshayaFoiger committed Jan 18, 2024
1 parent 1717524 commit 6d65743
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/router/src/connector/aci/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/connector/paypal/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
6 changes: 4 additions & 2 deletions crates/router/src/connector/stripe/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ pub struct StripeSofort {
#[serde(rename = "payment_method_options[sofort][preferred_language]")]
preferred_language: Option<String>,
#[serde(rename = "payment_method_data[sofort][country]")]
country: Option<api_enums::CountryAlpha2>,
country: api_enums::CountryAlpha2,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
Expand Down Expand Up @@ -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(),
}),
))),
Expand Down

0 comments on commit 6d65743

Please # to comment.