Skip to content

Commit

Permalink
chore: use generic phone numbers instead (#5142)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate authored Jun 27, 2024
1 parent d4dba55 commit 57055ec
Show file tree
Hide file tree
Showing 144 changed files with 420 additions and 420 deletions.
114 changes: 57 additions & 57 deletions .github/testcases/ui_tests.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"phone": {
"country_code": "+91",
"number": "8056594427"
"number": "9123456789"
}
},
"currency": "USD",
Expand Down Expand Up @@ -107,7 +107,7 @@
"email": "[email protected]",
"id": "cus_abcdefgh",
"name": "John Dough",
"phone": "9999999999"
"phone": "9123456789"
},
"description": "Its my first payment request",
"metadata": {
Expand Down Expand Up @@ -254,7 +254,7 @@
},
"phone": {
"country_code": "+91",
"number": "8056594427"
"number": "9123456789"
}
}
}
Expand Down Expand Up @@ -8481,7 +8481,7 @@
"phone": {
"type": "string",
"description": "The customer's phone number",
"example": "3141592653",
"example": "9123456789",
"nullable": true,
"maxLength": 10
},
Expand Down Expand Up @@ -8524,7 +8524,7 @@
"phone": {
"type": "string",
"description": "The customer's phone number",
"example": "3141592653",
"example": "9123456789",
"nullable": true,
"maxLength": 10
},
Expand Down Expand Up @@ -8733,7 +8733,7 @@
"phone": {
"type": "string",
"description": "The customer's phone number",
"example": "9999999999",
"example": "9123456789",
"nullable": true,
"maxLength": 255
},
Expand Down Expand Up @@ -8797,7 +8797,7 @@
"phone": {
"type": "string",
"description": "The customer's phone number",
"example": "9999999999",
"example": "9123456789",
"nullable": true,
"maxLength": 255
},
Expand Down Expand Up @@ -10686,7 +10686,7 @@
"phone_number": {
"type": "string",
"description": "The telephone number for Japanese convenience stores",
"example": "9999999999",
"example": "9123456789",
"nullable": true
}
}
Expand Down Expand Up @@ -15647,7 +15647,7 @@
"type": "string",
"description": "The customer's phone number\nThis field will be deprecated soon, use the customer object instead",
"deprecated": true,
"example": "3141592653",
"example": "9123456789",
"nullable": true,
"maxLength": 255
},
Expand Down Expand Up @@ -16184,7 +16184,7 @@
"type": "string",
"description": "The customer's phone number\nThis field will be deprecated soon. Please refer to `customer.phone` object",
"deprecated": true,
"example": "3141592653",
"example": "9123456789",
"nullable": true,
"maxLength": 255
},
Expand Down Expand Up @@ -17222,7 +17222,7 @@
"phone": {
"type": "string",
"description": "The customer's phone number",
"example": "3141592653",
"example": "9123456789",
"nullable": true,
"maxLength": 255
},
Expand Down Expand Up @@ -17401,7 +17401,7 @@
"phone": {
"type": "string",
"description": "The customer's phone number",
"example": "3141592653",
"example": "9123456789",
"nullable": true,
"maxLength": 255
},
Expand Down Expand Up @@ -17929,7 +17929,7 @@
"number": {
"type": "string",
"description": "The contact number",
"example": "9999999999",
"example": "9123456789",
"nullable": true
},
"country_code": {
Expand Down Expand Up @@ -19312,7 +19312,7 @@
},
"bic": {
"type": "string",
"example": "1024419982"
"example": "9123456789"
},
"country": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions crates/api_models/src/customers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct CustomerRequest {
#[schema(value_type = Option<String>, max_length = 255, example = "[email protected]")]
pub email: Option<pii::Email>,
/// The customer's phone number
#[schema(value_type = Option<String>, max_length = 255, example = "9999999999")]
#[schema(value_type = Option<String>, max_length = 255, example = "9123456789")]
pub phone: Option<Secret<String>>,
/// An arbitrary string that you can attach to a customer object.
#[schema(max_length = 255, example = "First Customer")]
Expand Down Expand Up @@ -52,7 +52,7 @@ pub struct CustomerResponse {
#[schema(value_type = Option<String>,max_length = 255, example = "[email protected]")]
pub email: crypto::OptionalEncryptableEmail,
/// The customer's phone number
#[schema(value_type = Option<String>,max_length = 255, example = "9999999999")]
#[schema(value_type = Option<String>,max_length = 255, example = "9123456789")]
pub phone: crypto::OptionalEncryptablePhone,
/// The country code for the customer phone number
#[schema(max_length = 255, example = "+65")]
Expand Down
14 changes: 7 additions & 7 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub struct CustomerDetails {
pub email: Option<Email>,

/// The customer's phone number
#[schema(value_type = Option<String>, max_length = 10, example = "3141592653")]
#[schema(value_type = Option<String>, max_length = 10, example = "9123456789")]
pub phone: Option<Secret<String>>,

/// The country code for the customer's phone number
Expand All @@ -217,7 +217,7 @@ pub struct CustomerDetailsResponse {
pub email: Option<Email>,

/// The customer's phone number
#[schema(value_type = Option<String>, max_length = 10, example = "3141592653")]
#[schema(value_type = Option<String>, max_length = 10, example = "9123456789")]
pub phone: Option<Secret<String>>,

/// The country code for the customer's phone number
Expand Down Expand Up @@ -321,7 +321,7 @@ pub struct PaymentsRequest {

/// The customer's phone number
/// This field will be deprecated soon, use the customer object instead
#[schema(value_type = Option<String>, max_length = 255, example = "3141592653", deprecated)]
#[schema(value_type = Option<String>, max_length = 255, example = "9123456789", deprecated)]
#[remove_in(PaymentsUpdateRequest, PaymentsCreateRequest, PaymentsConfirmRequest)]
pub phone: Option<Secret<String>>,

Expand Down Expand Up @@ -2136,7 +2136,7 @@ pub struct JCSVoucherData {
#[schema(value_type = Option<String>, example = "[email protected]")]
pub email: Option<Email>,
/// The telephone number for Japanese convenience stores
#[schema(value_type = Option<String>, example = "9999999999")]
#[schema(value_type = Option<String>, example = "9123456789")]
pub phone_number: Option<String>,
}

Expand Down Expand Up @@ -3013,7 +3013,7 @@ impl AddressDetails {
#[derive(Debug, Clone, Default, Eq, PartialEq, ToSchema, serde::Deserialize, serde::Serialize)]
pub struct PhoneDetails {
/// The contact number
#[schema(value_type = Option<String>, example = "9999999999")]
#[schema(value_type = Option<String>, example = "9123456789")]
pub number: Option<Secret<String>>,
/// The country code attached to the number
#[schema(example = "+1")]
Expand Down Expand Up @@ -3234,7 +3234,7 @@ pub enum BankTransferInstructions {
pub struct SepaBankTransferInstructions {
#[schema(value_type = String, example = "Jane Doe")]
pub account_holder_name: Secret<String>,
#[schema(value_type = String, example = "1024419982")]
#[schema(value_type = String, example = "9123456789")]
pub bic: Secret<String>,
pub country: String,
#[schema(value_type = String, example = "123456789")]
Expand Down Expand Up @@ -3447,7 +3447,7 @@ pub struct PaymentsResponse {

/// The customer's phone number
/// This field will be deprecated soon. Please refer to `customer.phone` object
#[schema(value_type = Option<String>, max_length = 255, example = "3141592653", deprecated)]
#[schema(value_type = Option<String>, max_length = 255, example = "9123456789", deprecated)]
pub phone: crypto::OptionalEncryptablePhone,

/// The URL to redirect after the completion of the operation
Expand Down
8 changes: 4 additions & 4 deletions crates/api_models/src/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct PayoutCreateRequest {
"first_name": "John",
"last_name": "Doe"
},
"phone": { "number": "8056594427", "country_code": "+1" }
"phone": { "number": "9123456789", "country_code": "+1" }
}"#))]
pub billing: Option<payments::Address>,

Expand All @@ -102,7 +102,7 @@ pub struct PayoutCreateRequest {
pub name: Option<Secret<String>>,

/// The customer's phone number
#[schema(value_type = Option<String>, max_length = 255, example = "3141592653")]
#[schema(value_type = Option<String>, max_length = 255, example = "9123456789")]
pub phone: Option<Secret<String>>,

/// The country code for the customer phone number
Expand Down Expand Up @@ -393,7 +393,7 @@ pub struct PayoutCreateResponse {
"first_name": "John",
"last_name": "Doe"
},
"phone": { "number": "8056594427", "country_code": "+1" }
"phone": { "number": "9123456789", "country_code": "+1" }
}"#))]
pub billing: Option<payments::Address>,

Expand All @@ -414,7 +414,7 @@ pub struct PayoutCreateResponse {
pub name: crypto::OptionalEncryptableName,

/// The customer's phone number
#[schema(value_type = Option<String>, max_length = 255, example = "3141592653")]
#[schema(value_type = Option<String>, max_length = 255, example = "9123456789")]
pub phone: crypto::OptionalEncryptablePhone,

/// The country code for the customer phone number
Expand Down
2 changes: 1 addition & 1 deletion crates/cards/src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ mod tests {

#[test]
fn test_invalid_card_number_masking() {
let secret: Secret<String, CardNumberStrategy> = Secret::new("1234567890".to_string());
let secret: Secret<String, CardNumberStrategy> = Secret::new("9123456789".to_string());
assert_eq!("*** alloc::string::String ***", format!("{secret:?}"));
}

Expand Down
2 changes: 1 addition & 1 deletion crates/common_utils/src/pii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ mod pii_masking_strategy_tests {
/*
#[test]
fn test_valid_phone_number_masking() {
let secret: Secret<String, PhoneNumber> = Secret::new("9922992299".to_string());
let secret: Secret<String, PhoneNumber> = Secret::new("9123456789".to_string());
assert_eq!("99*****299", format!("{}", secret));
}
Expand Down
2 changes: 1 addition & 1 deletion crates/common_utils/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mod tests {
assert!(validate_phone_number(phone_number).is_ok());
}

#[test_case("0745323456" ; "Romanian invalid phone number")]
#[test_case("9123456789" ; "Romanian invalid phone number")]
fn test_invalid_phone_number(phone_number: &str) {
let res = validate_phone_number(phone_number);
assert!(res.is_err());
Expand Down
6 changes: 3 additions & 3 deletions crates/openapi/src/routes/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"customer": {
"id": "cus_abcdefgh",
"name": "John Dough",
"phone": "9999999999",
"phone": "9123456789",
"email": "[email protected]"
},
"description": "Its my first payment request",
Expand Down Expand Up @@ -181,7 +181,7 @@
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"number": "9123456789",
"country_code": "+91"
}
}
Expand Down Expand Up @@ -257,7 +257,7 @@ pub fn payments_retrieve() {}
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"number": "9123456789",
"country_code": "+91"
}
},
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/aci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData {
..Default::default()
}),
phone: Some(PhoneDetails {
number: Some(Secret::new("8056594427".to_string())),
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+351".to_string()),
}),
email: None,
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/adyen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl AdyenTest {
last_name: Some(Secret::new("Dough".to_string())),
}),
phone: Some(PhoneDetails {
number: Some(Secret::new("8056594427".to_string())),
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+351".to_string()),
}),
email: None,
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/bitpay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn get_default_payment_info() -> Option<utils::PaymentInfo> {
..Default::default()
}),
phone: Some(api::PhoneDetails {
number: Some(Secret::new("1234567890".to_string())),
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+91".to_string()),
}),
email: None,
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/coinbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn get_default_payment_info() -> Option<utils::PaymentInfo> {
..Default::default()
}),
phone: Some(api::PhoneDetails {
number: Some(Secret::new("1234567890".to_string())),
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+91".to_string()),
}),
email: None,
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/cryptopay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn get_default_payment_info() -> Option<utils::PaymentInfo> {
..Default::default()
}),
phone: Some(api::PhoneDetails {
number: Some(Secret::new("1234567890".to_string())),
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+91".to_string()),
}),
email: None,
Expand Down
4 changes: 2 additions & 2 deletions crates/router/tests/connectors/cybersource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn get_default_payment_info() -> Option<utils::PaymentInfo> {
..Default::default()
}),
phone: Some(api::PhoneDetails {
number: Some(Secret::new("1234567890".to_string())),
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+91".to_string()),
}),
email: None,
Expand Down Expand Up @@ -202,7 +202,7 @@ async fn should_fail_payment_for_invalid_card_cvc() {
.make_payment(
Some(types::PaymentsAuthorizeData {
payment_method_data: domain::PaymentMethodData::Card(domain::Card {
card_cvc: Secret::new("2131233213".to_string()),
card_cvc: Secret::new("9123456789".to_string()),
..utils::CCardType::default().0
}),
..get_default_payment_authorize_data().unwrap()
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/forte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn get_default_payment_info() -> Option<utils::PaymentInfo> {
..Default::default()
}),
phone: Some(api::PhoneDetails {
number: Some(Secret::new("1234567890".to_string())),
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+91".to_string()),
}),
email: None,
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/iatapay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn get_default_payment_info() -> Option<utils::PaymentInfo> {
..Default::default()
}),
phone: Some(api::PhoneDetails {
number: Some(Secret::new("1234567890".to_string())),
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+91".to_string()),
}),
email: None,
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/nmi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ async fn should_fail_capture_for_invalid_payment() {
.unwrap();
assert_eq!(sync_response.status, enums::AttemptStatus::Authorized);
let capture_response = CONNECTOR
.capture_payment("7899353591".to_string(), None, None)
.capture_payment("9123456789".to_string(), None, None)
.await
.unwrap();
assert_eq!(capture_response.status, enums::AttemptStatus::CaptureFailed);
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/opennode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn get_default_payment_info() -> Option<utils::PaymentInfo> {
..Default::default()
}),
phone: Some(api::PhoneDetails {
number: Some(Secret::new("1234567890".to_string())),
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+91".to_string()),
}),
email: None,
Expand Down
Loading

0 comments on commit 57055ec

Please sign in to comment.