Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pm_list): add required fields for bancontact_card for Mollie, Adyen and Stripe #3035

Merged
merged 3 commits into from
Dec 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 73 additions & 1 deletion crates/router/src/configs/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4125,13 +4125,85 @@ impl Default for super::settings::RequiredFields {
ConnectorFields {
fields: HashMap::from([
(
enums::Connector::Stripe,
enums::Connector::Mollie,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::new(),
common: HashMap::new(),
}
),
(
enums::Connector::Stripe,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::from([
(
"payment_method_data.bank_redirect.bancontact_card.billing_details.email".to_string(),
RequiredFieldInfo {
required_field: "payment_method_data.bank_redirect.bancontact_card.billing_details.email".to_string(),
display_name: "email".to_string(),
field_type: enums::FieldType::UserEmailAddress,
value: None,
}
),
(
"payment_method_data.bank_redirect.bancontact_card.billing_details.billing_name".to_string(),
RequiredFieldInfo {
required_field: "payment_method_data.bank_redirect.bancontact_card.billing_details.billing_name".to_string(),
display_name: "billing_name".to_string(),
field_type: enums::FieldType::UserBillingName,
value: None,
}
)
]),
common: HashMap::new(),
}
),
(
enums::Connector::Adyen,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::from([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if these fields are needed for mandates? if yes, move this to common since mandates are implemented for Adyen.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check for stripe as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I did checked for Stripe and Adyen. They support mandates too.
I made the required changes.
Please review it once more

(
"payment_method_data.bank_redirect.bancontact_card.card_number".to_string(),
RequiredFieldInfo {
required_field: "payment_method_data.bank_redirect.bancontact_card.card_number".to_string(),
display_name: "card_number".to_string(),
field_type: enums::FieldType::UserCardNumber,
value: None,
}
),
(
"payment_method_data.bank_redirect.bancontact_card.card_exp_month".to_string(),
RequiredFieldInfo {
required_field: "payment_method_data.bank_redirect.bancontact_card.card_exp_month".to_string(),
display_name: "card_exp_month".to_string(),
field_type: enums::FieldType::UserCardExpiryMonth,
value: None,
}
),
(
"payment_method_data.bank_redirect.bancontact_card.card_exp_year".to_string(),
RequiredFieldInfo {
required_field: "payment_method_data.bank_redirect.bancontact_card.card_exp_year".to_string(),
display_name: "card_exp_year".to_string(),
field_type: enums::FieldType::UserCardExpiryYear,
value: None,
}
),
(
"payment_method_data.bank_redirect.bancontact_card.card_holder_name".to_string(),
RequiredFieldInfo {
required_field: "payment_method_data.bank_redirect.bancontact_card.card_holder_name".to_string(),
display_name: "card_holder_name".to_string(),
field_type: enums::FieldType::UserFullName,
value: None,
}
)
]),
common: HashMap::new(),
}
)
]),
},
),
Expand Down
Loading