revert: implement NameType for name validation (#6734) (#7717)

This commit is contained in:
Sakil Mostak
2025-04-03 18:49:08 +05:30
committed by GitHub
parent b25f071a60
commit d892ee7af0
72 changed files with 364 additions and 734 deletions

View File

@ -42,7 +42,7 @@ pub struct StripeAddressDetails {
pub struct CreateCustomerRequest {
pub email: Option<Email>,
pub invoice_prefix: Option<String>,
pub name: Option<common_utils::types::NameType>,
pub name: Option<masking::Secret<String>>,
pub phone: Option<masking::Secret<String>>,
pub address: Option<StripeAddressDetails>,
pub metadata: Option<pii::SecretSerdeValue>,

View File

@ -64,7 +64,7 @@ pub struct StripeCard {
pub exp_month: masking::Secret<String>,
pub exp_year: masking::Secret<String>,
pub cvc: masking::Secret<String>,
pub holder_name: Option<common_utils::types::NameType>,
pub holder_name: Option<masking::Secret<String>>,
}
// ApplePay wallet param is not available in stripe Docs
@ -169,7 +169,7 @@ impl From<StripePaymentMethodDetails> for payments::PaymentMethodData {
#[derive(Default, Serialize, PartialEq, Eq, Deserialize, Clone, Debug)]
pub struct Shipping {
pub address: AddressDetails,
pub name: Option<common_utils::types::NameType>,
pub name: Option<masking::Secret<String>>,
pub carrier: Option<String>,
pub phone: Option<masking::Secret<String>>,
pub tracking_number: Option<masking::Secret<String>>,
@ -950,9 +950,7 @@ fn get_pmd_based_on_payment_method_type(
payments::PaymentMethodData::BankRedirect(payments::BankRedirectData::Ideal {
billing_details: billing_details.as_ref().map(|billing_data| {
payments::BankRedirectBilling {
billing_name: billing_data
.get_optional_full_name()
.map(common_utils::types::NameType::get_unchecked_from_secret), // this is unchecked because the input is coming from a checked type
billing_name: billing_data.get_optional_full_name(),
email: billing_data.email.clone(),
}
}),

View File

@ -96,9 +96,7 @@ impl From<StripeCard> for payments::Card {
card_number: card.number,
card_exp_month: card.exp_month,
card_exp_year: card.exp_year,
card_holder_name: Some(common_utils::types::NameType::get_unchecked(String::from(
"Stripe_cust",
))), // this is unchecked because valid input is being provided
card_holder_name: Some(masking::Secret::new("stripe_cust".to_owned())),
card_cvc: card.cvc,
card_issuer: None,
card_network: None,