fix(connector): [ADYEN] field type fixed for required fields (#8997)

This commit is contained in:
sweta-sharma
2025-09-17 16:27:56 +05:30
committed by GitHub
parent fde51e17d4
commit b69ed06959
4 changed files with 114 additions and 32 deletions

View File

@ -4328,6 +4328,24 @@ options=["Connector"]
payment_method_type = "sofort" payment_method_type = "sofort"
[[shift4.bank_redirect]] [[shift4.bank_redirect]]
payment_method_type = "eps" payment_method_type = "eps"
[[shift4.bank_redirect]]
payment_method_type = "trustly"
[[shift4.bank_redirect]]
payment_method_type = "blik"
[[shift4.wallet]]
payment_method_type = "ali_pay"
[[shift4.wallet]]
payment_method_type = "we_chat_pay"
[[shift4.wallet]]
payment_method_type = "paysera"
[[shift4.wallet]]
payment_method_type = "skrill"
[[shift4.pay_later]]
payment_method_type = "klarna"
[[shift4.voucher]]
payment_method_type = "boleto"
[[shift4.crypto]]
payment_method_type = "crypto_currency"
[shift4.connector_auth.HeaderKey] [shift4.connector_auth.HeaderKey]
api_key="API Key" api_key="API Key"
[shift4.connector_webhook_details] [shift4.connector_webhook_details]

View File

@ -3183,6 +3183,24 @@ payment_method_type = "giropay"
payment_method_type = "sofort" payment_method_type = "sofort"
[[shift4.bank_redirect]] [[shift4.bank_redirect]]
payment_method_type = "eps" payment_method_type = "eps"
[[shift4.bank_redirect]]
payment_method_type = "trustly"
[[shift4.bank_redirect]]
payment_method_type = "blik"
[[shift4.wallet]]
payment_method_type = "ali_pay"
[[shift4.wallet]]
payment_method_type = "we_chat_pay"
[[shift4.wallet]]
payment_method_type = "paysera"
[[shift4.wallet]]
payment_method_type = "skrill"
[[shift4.pay_later]]
payment_method_type = "klarna"
[[shift4.voucher]]
payment_method_type = "boleto"
[[shift4.crypto]]
payment_method_type = "crypto_currency"
[shift4.connector_auth.HeaderKey] [shift4.connector_auth.HeaderKey]
api_key = "API Key" api_key = "API Key"
[shift4.connector_webhook_details] [shift4.connector_webhook_details]

View File

@ -4288,6 +4288,24 @@ payment_method_type = "giropay"
payment_method_type = "sofort" payment_method_type = "sofort"
[[shift4.bank_redirect]] [[shift4.bank_redirect]]
payment_method_type = "eps" payment_method_type = "eps"
[[shift4.bank_redirect]]
payment_method_type = "trustly"
[[shift4.bank_redirect]]
payment_method_type = "blik"
[[shift4.wallet]]
payment_method_type = "ali_pay"
[[shift4.wallet]]
payment_method_type = "we_chat_pay"
[[shift4.wallet]]
payment_method_type = "paysera"
[[shift4.wallet]]
payment_method_type = "skrill"
[[shift4.pay_later]]
payment_method_type = "klarna"
[[shift4.voucher]]
payment_method_type = "boleto"
[[shift4.crypto]]
payment_method_type = "crypto_currency"
[shift4.connector_auth.HeaderKey] [shift4.connector_auth.HeaderKey]
api_key = "API Key" api_key = "API Key"
[shift4.connector_webhook_details] [shift4.connector_webhook_details]

View File

@ -525,10 +525,10 @@ impl RequiredField {
}, },
), ),
Self::OpenBankingPolandIssuer => ( Self::OpenBankingPolandIssuer => (
"payment_method_data.bank_redirect.open_banking_poland.issuer".to_string(), "payment_method_data.bank_redirect.online_banking_poland.issuer".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
required_field: "payment_method_data.bank_redirect.open_banking_poland.issuer" required_field:
.to_string(), "payment_method_data.bank_redirect.online_banking_poland.issuer".to_string(),
display_name: "issuer".to_string(), display_name: "issuer".to_string(),
field_type: FieldType::UserBank, field_type: FieldType::UserBank,
value: None, value: None,
@ -924,6 +924,26 @@ fn billing_name() -> Vec<RequiredField> {
] ]
} }
#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
fn billing_email_billing_name() -> Vec<RequiredField> {
vec![
RequiredField::BillingEmail,
RequiredField::BillingFirstName("billing_first_name", FieldType::UserBillingName),
RequiredField::BillingLastName("billing_last_name", FieldType::UserBillingName),
]
}
#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
fn billing_email_billing_name_phone() -> Vec<RequiredField> {
vec![
RequiredField::BillingFirstName("billing_first_name", FieldType::UserBillingName),
RequiredField::BillingLastName("billing_last_name", FieldType::UserBillingName),
RequiredField::BillingEmail,
RequiredField::BillingPhone,
RequiredField::BillingPhoneCountryCode,
]
}
#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2 #[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
fn email() -> Vec<RequiredField> { fn email() -> Vec<RequiredField> {
[RequiredField::Email].to_vec() [RequiredField::Email].to_vec()
@ -948,17 +968,6 @@ fn billing_email_name() -> Vec<RequiredField> {
] ]
} }
#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
fn billing_email_name_phone() -> Vec<RequiredField> {
vec![
RequiredField::BillingUserFirstName,
RequiredField::BillingUserLastName,
RequiredField::BillingEmail,
RequiredField::BillingPhone,
RequiredField::BillingPhoneCountryCode,
]
}
#[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2 #[cfg_attr(feature = "v2", allow(dead_code))] // This function is not used in v2
fn billing_address() -> Vec<RequiredField> { fn billing_address() -> Vec<RequiredField> {
vec![ vec![
@ -1230,7 +1239,18 @@ impl RequiredFields {
), ),
( (
enums::PaymentMethodType::MomoAtm, enums::PaymentMethodType::MomoAtm,
connectors(vec![(Connector::Adyen, fields(vec![], vec![], vec![]))]), connectors(vec![(
Connector::Adyen,
fields(
vec![],
vec![
RequiredField::BillingEmail,
RequiredField::BillingPhone,
RequiredField::BillingPhoneCountryCode,
],
vec![],
),
)]),
), ),
])), ])),
), ),
@ -2963,8 +2983,16 @@ fn get_pay_later_required_fields() -> HashMap<enums::PaymentMethodType, Connecto
RequiredFieldFinal { RequiredFieldFinal {
mandate: HashMap::new(), mandate: HashMap::new(),
non_mandate: HashMap::from([ non_mandate: HashMap::from([
RequiredField::BillingUserFirstName.to_tuple(), RequiredField::BillingFirstName(
RequiredField::BillingUserLastName.to_tuple(), "billing_first_name",
FieldType::UserBillingName,
)
.to_tuple(),
RequiredField::BillingLastName(
"billing_last_name",
FieldType::UserBillingName,
)
.to_tuple(),
RequiredField::BillingAddressCity.to_tuple(), RequiredField::BillingAddressCity.to_tuple(),
RequiredField::BillingAddressState.to_tuple(), RequiredField::BillingAddressState.to_tuple(),
RequiredField::BillingAddressZip.to_tuple(), RequiredField::BillingAddressZip.to_tuple(),
@ -3049,14 +3077,14 @@ fn get_voucher_required_fields() -> HashMap<enums::PaymentMethodType, ConnectorF
enums::PaymentMethodType::Alfamart, enums::PaymentMethodType::Alfamart,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name(), vec![]), fields(vec![], billing_email_billing_name(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::Indomaret, enums::PaymentMethodType::Indomaret,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name(), vec![]), fields(vec![], billing_email_billing_name(), vec![]),
)]), )]),
), ),
( (
@ -3067,42 +3095,42 @@ fn get_voucher_required_fields() -> HashMap<enums::PaymentMethodType, ConnectorF
enums::PaymentMethodType::SevenEleven, enums::PaymentMethodType::SevenEleven,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name_phone(), vec![]), fields(vec![], billing_email_billing_name_phone(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::Lawson, enums::PaymentMethodType::Lawson,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name_phone(), vec![]), fields(vec![], billing_email_billing_name_phone(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::MiniStop, enums::PaymentMethodType::MiniStop,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name_phone(), vec![]), fields(vec![], billing_email_billing_name_phone(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::FamilyMart, enums::PaymentMethodType::FamilyMart,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name_phone(), vec![]), fields(vec![], billing_email_billing_name_phone(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::Seicomart, enums::PaymentMethodType::Seicomart,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name_phone(), vec![]), fields(vec![], billing_email_billing_name_phone(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::PayEasy, enums::PaymentMethodType::PayEasy,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name_phone(), vec![]), fields(vec![], billing_email_billing_name_phone(), vec![]),
)]), )]),
), ),
]) ])
@ -3471,49 +3499,49 @@ fn get_bank_transfer_required_fields() -> HashMap<enums::PaymentMethodType, Conn
enums::PaymentMethodType::PermataBankTransfer, enums::PaymentMethodType::PermataBankTransfer,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name(), vec![]), fields(vec![], billing_email_billing_name(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::BcaBankTransfer, enums::PaymentMethodType::BcaBankTransfer,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name(), vec![]), fields(vec![], billing_email_billing_name(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::BniVa, enums::PaymentMethodType::BniVa,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name(), vec![]), fields(vec![], billing_email_billing_name(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::BriVa, enums::PaymentMethodType::BriVa,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name(), vec![]), fields(vec![], billing_email_billing_name(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::CimbVa, enums::PaymentMethodType::CimbVa,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name(), vec![]), fields(vec![], billing_email_billing_name(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::DanamonVa, enums::PaymentMethodType::DanamonVa,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name(), vec![]), fields(vec![], billing_email_billing_name(), vec![]),
)]), )]),
), ),
( (
enums::PaymentMethodType::MandiriVa, enums::PaymentMethodType::MandiriVa,
connectors(vec![( connectors(vec![(
Connector::Adyen, Connector::Adyen,
fields(vec![], billing_email_name(), vec![]), fields(vec![], billing_email_billing_name(), vec![]),
)]), )]),
), ),
( (