refactor(dynamic_fields): Multiple SDK queries fixed (#7380)

This commit is contained in:
sweta-sharma
2025-03-20 15:50:24 +05:30
committed by GitHub
parent a341e82d4a
commit cbc262fbdf
6 changed files with 36 additions and 20 deletions

View File

@ -233,6 +233,7 @@ pub enum FieldType {
UserShippingAddressPincode, UserShippingAddressPincode,
UserShippingAddressState, UserShippingAddressState,
UserShippingAddressCountry { options: Vec<String> }, UserShippingAddressCountry { options: Vec<String> },
UserSocialSecurityNumber,
UserBlikCode, UserBlikCode,
UserBank, UserBank,
UserBankAccountNumber, UserBankAccountNumber,

View File

@ -66,6 +66,9 @@ impl DashboardRequestPayload {
(_, PaymentMethodType::DirectCarrierBilling) => { (_, PaymentMethodType::DirectCarrierBilling) => {
Some(api_models::enums::PaymentExperience::CollectOtp) Some(api_models::enums::PaymentExperience::CollectOtp)
} }
(_, PaymentMethodType::Cashapp) | (_, PaymentMethodType::Swish) => {
Some(api_models::enums::PaymentExperience::DisplayQrCode)
}
_ => Some(api_models::enums::PaymentExperience::RedirectToUrl), _ => Some(api_models::enums::PaymentExperience::RedirectToUrl),
}, },
} }

View File

@ -189,6 +189,7 @@ merchant_secret="Source verification key"
payment_method_type = "momo" payment_method_type = "momo"
[[adyen.wallet]] [[adyen.wallet]]
payment_method_type = "swish" payment_method_type = "swish"
payment_experience = "display_qr_code"
[[adyen.wallet]] [[adyen.wallet]]
payment_method_type = "touch_n_go" payment_method_type = "touch_n_go"
[[adyen.voucher]] [[adyen.voucher]]
@ -3329,6 +3330,7 @@ merchant_secret="Source verification key"
payment_method_type = "ali_pay" payment_method_type = "ali_pay"
[[stripe.wallet]] [[stripe.wallet]]
payment_method_type = "cashapp" payment_method_type = "cashapp"
payment_experience = "display_qr_code"
is_verifiable = true is_verifiable = true
[stripe.connector_auth.HeaderKey] [stripe.connector_auth.HeaderKey]
api_key="Secret Key" api_key="Secret Key"

View File

@ -23,10 +23,18 @@ impl Address {
.email .email
.clone() .clone()
.or(other.and_then(|other| other.email.clone())), .or(other.and_then(|other| other.email.clone())),
phone: self phone: {
.phone self.phone
.clone() .clone()
.or(other.and_then(|other| other.phone.clone())), .and_then(|phone_details| {
if phone_details.number.is_some() {
Some(phone_details)
} else {
None
}
})
.or_else(|| other.and_then(|other| other.phone.clone()))
},
} }
} }
} }

View File

@ -3595,9 +3595,9 @@ impl Default for settings::RequiredFields {
} }
), ),
( (
"payment_method_data.billing.phone.number".to_string(), "billing.phone.number".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
required_field: "billing.phone.number".to_string(), required_field: "payment_method_data.billing.phone.number".to_string(),
display_name: "phone_number".to_string(), display_name: "phone_number".to_string(),
field_type: enums::FieldType::UserPhoneNumber, field_type: enums::FieldType::UserPhoneNumber,
value: None, value: None,
@ -7186,9 +7186,9 @@ impl Default for settings::RequiredFields {
} }
), ),
( (
"payment_method_data.billing.phone.number".to_string(), "billing.phone.number".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
required_field: "billing.phone.number".to_string(), required_field: "payment_method_data.billing.phone.number".to_string(),
display_name: "phone_number".to_string(), display_name: "phone_number".to_string(),
field_type: enums::FieldType::UserPhoneNumber, field_type: enums::FieldType::UserPhoneNumber,
value: None, value: None,
@ -9964,9 +9964,9 @@ impl Default for settings::RequiredFields {
common: HashMap::new(), common: HashMap::new(),
non_mandate: HashMap::from([ non_mandate: HashMap::from([
( (
"payment_method_data.billing.phone.number".to_string(), "billing.phone.number".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
required_field: "billing.phone.number".to_string(), required_field: "payment_method_data.billing.phone.number".to_string(),
display_name: "phone_number".to_string(), display_name: "phone_number".to_string(),
field_type: enums::FieldType::UserPhoneNumber, field_type: enums::FieldType::UserPhoneNumber,
value: None, value: None,
@ -11309,7 +11309,7 @@ impl Default for settings::RequiredFields {
} }
), ),
( (
"payment_method_data.billing.phone.number".to_string(), "billing.phone.number".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
required_field: "payment_method_data.billing.phone.number".to_string(), required_field: "payment_method_data.billing.phone.number".to_string(),
display_name: "phone_number".to_string(), display_name: "phone_number".to_string(),
@ -11539,9 +11539,9 @@ impl Default for settings::RequiredFields {
} }
), ),
( (
"payment_method_data.billing.phone.number".to_string(), "billing.phone.number".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
required_field: "billing.phone.number".to_string(), required_field: "payment_method_data.billing.phone.number".to_string(),
display_name: "phone_number".to_string(), display_name: "phone_number".to_string(),
field_type: enums::FieldType::UserPhoneNumber, field_type: enums::FieldType::UserPhoneNumber,
value: None, value: None,
@ -11661,9 +11661,9 @@ impl Default for settings::RequiredFields {
} }
), ),
( (
"payment_method_data.billing.phone.number".to_string(), "billing.phone.number".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
required_field: "billing.phone.number".to_string(), required_field: "payment_method_data.billing.phone.number".to_string(),
display_name: "phone_number".to_string(), display_name: "phone_number".to_string(),
field_type: enums::FieldType::UserPhoneNumber, field_type: enums::FieldType::UserPhoneNumber,
value: None, value: None,
@ -11789,7 +11789,7 @@ impl Default for settings::RequiredFields {
RequiredFieldInfo { RequiredFieldInfo {
required_field: "payment_method_data.voucher.boleto.social_security_number".to_string(), required_field: "payment_method_data.voucher.boleto.social_security_number".to_string(),
display_name: "social_security_number".to_string(), display_name: "social_security_number".to_string(),
field_type: enums::FieldType::Text, field_type: enums::FieldType::UserSocialSecurityNumber,
value: None, value: None,
} }
), ),
@ -13431,7 +13431,7 @@ impl Default for settings::RequiredFields {
( (
"payment_method_data.gift_card.number".to_string(), "payment_method_data.gift_card.number".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
required_field: "payment_method_data.gift_card.number".to_string(), required_field: "payment_method_data.gift_card.givex.number".to_string(),
display_name: "gift_card_number".to_string(), display_name: "gift_card_number".to_string(),
field_type: enums::FieldType::UserCardNumber, field_type: enums::FieldType::UserCardNumber,
value: None, value: None,
@ -13440,7 +13440,7 @@ impl Default for settings::RequiredFields {
( (
"payment_method_data.gift_card.cvc".to_string(), "payment_method_data.gift_card.cvc".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
required_field: "payment_method_data.gift_card.cvc".to_string(), required_field: "payment_method_data.gift_card.givex.cvc".to_string(),
display_name: "gift_card_cvc".to_string(), display_name: "gift_card_cvc".to_string(),
field_type: enums::FieldType::UserCardCvc, field_type: enums::FieldType::UserCardCvc,
value: None, value: None,

View File

@ -4563,8 +4563,10 @@ where
(router_data, should_continue_payment) (router_data, should_continue_payment)
} }
} }
Some(domain::PaymentMethodData::GiftCard(_)) => { Some(domain::PaymentMethodData::GiftCard(gift_card_data)) => {
if connector.connector_name == router_types::Connector::Adyen { if connector.connector_name == router_types::Connector::Adyen
&& matches!(gift_card_data.deref(), domain::GiftCardData::Givex(..))
{
router_data = router_data.preprocessing_steps(state, connector).await?; router_data = router_data.preprocessing_steps(state, connector).await?;
let is_error_in_response = router_data.response.is_err(); let is_error_in_response = router_data.response.is_err();