mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 04:04:43 +08:00
refactor(router): add phone and country_code in dynamic fields (#5968)
This commit is contained in:
@ -12335,6 +12335,24 @@ pub fn get_billing_required_fields() -> HashMap<String, RequiredFieldInfo> {
|
||||
value: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"billing.phone.number".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.phone.number".to_string(),
|
||||
display_name: "phone_number".to_string(),
|
||||
field_type: enums::FieldType::UserPhoneNumber,
|
||||
value: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"billing.phone.country_code".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.phone.country_code".to_string(),
|
||||
display_name: "dialing_code".to_string(),
|
||||
field_type: enums::FieldType::UserPhoneNumberCountryCode,
|
||||
value: None,
|
||||
},
|
||||
),
|
||||
])
|
||||
}
|
||||
|
||||
@ -12405,6 +12423,24 @@ pub fn get_shipping_required_fields() -> HashMap<String, RequiredFieldInfo> {
|
||||
value: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"shipping.phone.number".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "shipping.phone.number".to_string(),
|
||||
display_name: "phone_number".to_string(),
|
||||
field_type: enums::FieldType::UserPhoneNumber,
|
||||
value: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"shipping.phone.country_code".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "shipping.phone.country_code".to_string(),
|
||||
display_name: "dialing_code".to_string(),
|
||||
field_type: enums::FieldType::UserPhoneNumberCountryCode,
|
||||
value: None,
|
||||
},
|
||||
),
|
||||
])
|
||||
}
|
||||
|
||||
|
||||
@ -3840,7 +3840,11 @@ fn should_collect_shipping_or_billing_details_from_wallet_connector(
|
||||
mut required_fields_hs: HashMap<String, RequiredFieldInfo>,
|
||||
) -> HashMap<String, RequiredFieldInfo> {
|
||||
match (payment_method, payment_experience_optional) {
|
||||
(api_enums::PaymentMethod::Wallet, Some(api_enums::PaymentExperience::InvokeSdkClient)) => {
|
||||
(api_enums::PaymentMethod::Wallet, Some(api_enums::PaymentExperience::InvokeSdkClient))
|
||||
| (
|
||||
api_enums::PaymentMethod::PayLater,
|
||||
Some(api_enums::PaymentExperience::InvokeSdkClient),
|
||||
) => {
|
||||
let always_send_billing_details = business_profile.and_then(|business_profile| {
|
||||
business_profile.always_collect_billing_details_from_wallet_connector
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user