Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(router): [Adyen] prevent partial submission of billing address and add required fields for all payment methods (#5660)

AkshayaFoiger6d606179dcb0
diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs
index b2d9707d0b..9a2af153ee 100644
--- a/crates/router/src/configs/defaults.rs
+++ b/crates/router/src/configs/defaults.rs
@@ -350,7 +350,25 @@ impl Default for super::settings::RequiredFields {
field_type: enums::FieldType::UserCardCvc,
value: None,
}
- )
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
]
),
}
@@ -3148,7 +3166,25 @@ impl Default for super::settings::RequiredFields {
field_type: enums::FieldType::UserCardCvc,
value: None,
}
- )
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
]
),
}
@@ -5893,6 +5929,196 @@ impl Default for super::settings::RequiredFields {
]),
},
),
+ (
+ enums::PaymentMethodType::Trustly,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::OnlineBankingCzechRepublic,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from([
+ (
+ "payment_method_data.bank_redirect.open_banking_czech_republic.issuer".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_redirect.open_banking_czech_republic.issuer".to_string(),
+ display_name: "issuer".to_string(),
+ field_type: enums::FieldType::UserBank,
+ value: None,
+ }
+ )
+ ]),
+ common: HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::OnlineBankingFinland,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ ]),
+ common: HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::OnlineBankingPoland,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from([
+ (
+ "payment_method_data.bank_redirect.open_banking_poland.issuer".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_redirect.open_banking_poland.issuer".to_string(),
+ display_name: "issuer".to_string(),
+ field_type: enums::FieldType::UserBank,
+ value: None,
+ }
+ ),
+
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ ]),
+ common: HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::OnlineBankingSlovakia,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from([
+ (
+ "payment_method_data.bank_redirect.open_banking_slovakia.issuer".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_redirect.open_banking_slovakia.issuer".to_string(),
+ display_name: "issuer".to_string(),
+ field_type: enums::FieldType::UserBank,
+ value: None,
+ }
+ ),
+ ]),
+ common: HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::OnlineBankingFpx,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from([
+ (
+ "payment_method_data.bank_redirect.open_banking_fpx.issuer".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_redirect.open_banking_fpx.issuer".to_string(),
+ display_name: "issuer".to_string(),
+ field_type: enums::FieldType::UserBank,
+ value: None,
+ }
+ )
+ ]),
+ common: HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::OnlineBankingThailand,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from([
+ (
+ "payment_method_data.bank_redirect.open_banking_thailand.issuer".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_redirect.open_banking_thailand.issuer".to_string(),
+ display_name: "issuer".to_string(),
+ field_type: enums::FieldType::UserBank,
+ value: None,
+ }
+ )
+ ]),
+ common: HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Bizum,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
(
enums::PaymentMethodType::Przelewy24,
ConnectorFields {
@@ -7262,6 +7488,14 @@ impl Default for super::settings::RequiredFields {
common: HashMap::new(),
}
),
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
(
enums::Connector::Bankofamerica,
RequiredFieldFinal {
@@ -7589,7 +7823,8 @@ impl Default for super::settings::RequiredFields {
),
common: HashMap::new(),
}
- )
+ ),
+
]),
},
),
@@ -8120,6 +8355,14 @@ impl Default for super::settings::RequiredFields {
common: HashMap::new(),
}
),
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
]),
},
),
@@ -8135,45 +8378,241 @@ impl Default for super::settings::RequiredFields {
common: HashMap::new(),
}
),
- ]),
- },
- ),
- (
- // Added shipping fields for the SDK flow to accept it from wallet directly,
- // this won't show up in SDK in payment's sheet but will be used in the background
- enums::PaymentMethodType::Paypal,
- ConnectorFields {
- fields: HashMap::from([
(
- enums::Connector::Braintree,
+ enums::Connector::Adyen,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::new(),
common: HashMap::new(),
}
),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::AliPayHk,
+ ConnectorFields {
+ fields: HashMap::from([
(
- enums::Connector::Paypal,
+ enums::Connector::Adyen,
RequiredFieldFinal {
mandate: HashMap::new(),
- non_mandate: HashMap::new(
- ),
+ non_mandate: HashMap::new(),
common: HashMap::new(),
}
),
- ]),
+ ]),
},
),
(
- enums::PaymentMethodType::Mifinity,
+ enums::PaymentMethodType::MbWay,
ConnectorFields {
fields: HashMap::from([
(
- enums::Connector::Mifinity,
+ enums::Connector::Adyen,
RequiredFieldFinal {
mandate: HashMap::new(),
- non_mandate: HashMap::new(),
- common: HashMap::from([
+ common: HashMap::new(),
+ non_mandate: HashMap::from([
+ (
+ "payment_method_data.billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "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,
+ }
+ ),
+ ]
+ ),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::KakaoPay,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Twint,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Gcash,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Vipps,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Dana,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Momo,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Swish,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::TouchNGo,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ // Added shipping fields for the SDK flow to accept it from wallet directly,
+ // this won't show up in SDK in payment's sheet but will be used in the background
+ enums::PaymentMethodType::Paypal,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ )]
+ ),
+ }
+ ),
+ (
+ enums::Connector::Braintree,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ (
+ enums::Connector::Paypal,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(
+ ),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Mifinity,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Mifinity,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::from([
(
"payment_method_data.wallet.mifinity.date_of_birth".to_string(),
RequiredFieldInfo {
@@ -8482,6 +8921,59 @@ impl Default for super::settings::RequiredFields {
value: None,
}
),
+ (
+ "shipping.address.city".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.city".to_string(),
+ display_name: "city".to_string(),
+ field_type: enums::FieldType::UserShippingAddressCity,
+ value: None,
+ }
+ ),
+ (
+ "shipping.address.zip".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.zip".to_string(),
+ display_name: "zip".to_string(),
+ field_type: enums::FieldType::UserShippingAddressPincode,
+ value: None,
+ }
+ ),
+ (
+ "shipping.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserShippingAddressCountry{
+ options: vec![
+ "GB".to_string(),
+ "AU".to_string(),
+ "CA".to_string(),
+ "US".to_string(),
+ "NZ".to_string(),
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "shipping.address.line1".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.line1".to_string(),
+ display_name: "line1".to_string(),
+ field_type: enums::FieldType::UserShippingAddressLine1,
+ value: None,
+ }
+ ),
+ (
+ "shipping.address.line2".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.line2".to_string(),
+ display_name: "line2".to_string(),
+ field_type: enums::FieldType::UserShippingAddressLine2,
+ value: None,
+ }
+ ),
]),
common : HashMap::new(),
}
@@ -8521,21 +9013,50 @@ impl Default for super::settings::RequiredFields {
}
),
(
- enums::Connector::Klarna,
+ enums::Connector::Adyen,
RequiredFieldFinal {
- mandate: HashMap::new(),
- non_mandate: HashMap::new(),
- common: HashMap::from([
+ mandate : HashMap::new(),
+ non_mandate: HashMap::new(),
+ common : HashMap::from([
+ ( "payment_method_data.pay_later.klarna.billing_country".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.pay_later.klarna.billing_country".to_string(),
+ display_name: "billing_country".to_string(),
+ field_type: enums::FieldType::UserAddressCountry{
+ options: vec![
+ "ALL".to_string(),
+ ]
+ },
+ value: None,
+ }),
(
- "billing.address.country".to_string(),
+ "billing.email".to_string(),
RequiredFieldInfo {
- required_field: "payment_method_data.billing.address.country".to_string(),
- display_name: "country".to_string(),
- field_type: enums::FieldType::UserAddressCountry{
- options: vec![
- "AU".to_string(),
- "AT".to_string(),
- "BE".to_string(),
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ ]),
+ }
+ ),
+ (
+ enums::Connector::Klarna,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::from([
+ (
+ "billing.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserAddressCountry{
+ options: vec![
+ "AU".to_string(),
+ "AT".to_string(),
+ "BE".to_string(),
"CA".to_string(),
"CZ".to_string(),
"DK".to_string(),
@@ -8578,100 +9099,1122 @@ impl Default for super::settings::RequiredFields {
common: HashMap::new(),
}
),
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from(
+ [
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.city".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.city".to_string(),
+ display_name: "city".to_string(),
+ field_type: enums::FieldType::UserAddressCity,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.state".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.state".to_string(),
+ display_name: "state".to_string(),
+ field_type: enums::FieldType::UserAddressState,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.zip".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.zip".to_string(),
+ display_name: "zip".to_string(),
+ field_type: enums::FieldType::UserAddressPincode,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserAddressCountry{
+ options: vec![
+ "US".to_string(),
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "billing.phone.number".to_string(),
+ display_name: "phone_number".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line1".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line1".to_string(),
+ display_name: "line1".to_string(),
+ field_type: enums::FieldType::UserAddressLine1,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line2".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line2".to_string(),
+ display_name: "line2".to_string(),
+ field_type: enums::FieldType::UserAddressLine2,
+ value: None,
+ }
+ )
+ ]
+ ),
+ common: HashMap::new(),
+ }
+ ),
]),
},
),
- ])),
- ),
- (
- enums::PaymentMethod::Crypto,
- PaymentMethodType(HashMap::from([
(
- enums::PaymentMethodType::CryptoCurrency,
+ enums::PaymentMethodType::PayBright,
ConnectorFields {
fields: HashMap::from([
(
- enums::Connector::Cryptopay,
+ enums::Connector::Adyen,
RequiredFieldFinal {
- mandate : HashMap::new(),
- non_mandate: HashMap::from([
- (
- "payment_method_data.crypto.pay_currency".to_string(),
- RequiredFieldInfo {
- required_field: "payment_method_data.crypto.pay_currency".to_string(),
- display_name: "currency".to_string(),
- field_type: enums::FieldType::UserCurrency{
- options: vec![
- "BTC".to_string(),
- "LTC".to_string(),
- "ETH".to_string(),
- "XRP".to_string(),
- "XLM".to_string(),
- "BCH".to_string(),
- "ADA".to_string(),
- "SOL".to_string(),
- "SHIB".to_string(),
- "TRX".to_string(),
- "DOGE".to_string(),
- "BNB".to_string(),
- "USDT".to_string(),
- "USDC".to_string(),
- "DAI".to_string(),
- ]
- },
- value: None,
- }
- ),
- (
- "payment_method_data.crypto.network".to_string(),
- RequiredFieldInfo {
- required_field: "payment_method_data.crypto.network".to_string(),
- display_name: "network".to_string(),
- field_type: enums::FieldType::UserCryptoCurrencyNetwork,
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from(
+ [
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.city".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.city".to_string(),
+ display_name: "city".to_string(),
+ field_type: enums::FieldType::UserAddressCity,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.state".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.state".to_string(),
+ display_name: "state".to_string(),
+ field_type: enums::FieldType::UserAddressState,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.zip".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.zip".to_string(),
+ display_name: "zip".to_string(),
+ field_type: enums::FieldType::UserAddressPincode,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserAddressCountry{
+ options: vec![
+ "CA".to_string(),
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "billing.phone.number".to_string(),
+ display_name: "phone_number".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line1".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line1".to_string(),
+ display_name: "line1".to_string(),
+ field_type: enums::FieldType::UserAddressLine1,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line2".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line2".to_string(),
+ display_name: "line2".to_string(),
+ field_type: enums::FieldType::UserAddressLine2,
+ value: None,
+ }
+ ),
+ (
+ "shipping.address.city".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.city".to_string(),
+ display_name: "city".to_string(),
+ field_type: enums::FieldType::UserShippingAddressCity,
+ value: None,
+ }
+ ),
+ (
+ "shipping.address.zip".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.zip".to_string(),
+ display_name: "zip".to_string(),
+ field_type: enums::FieldType::UserShippingAddressPincode,
+ value: None,
+ }
+ ),
+ (
+ "shipping.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserShippingAddressCountry{
+ options: vec![
+ "ALL".to_string(),
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "shipping.address.line1".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.line1".to_string(),
+ display_name: "line1".to_string(),
+ field_type: enums::FieldType::UserShippingAddressLine1,
+ value: None,
+ }
+ ),
+ (
+ "shipping.address.line2".to_string(),
+ RequiredFieldInfo {
+ required_field: "shipping.address.line2".to_string(),
+ display_name: "line2".to_string(),
+ field_type: enums::FieldType::UserShippingAddressLine2,
+ value: None,
+ }
+ ),
+ ]
+ ),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Walley,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from(
+ [
+ (
+ "billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.phone.number".to_string(),
+ display_name: "phone".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ ]
+ ),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Alma,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from(
+ [
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.city".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.city".to_string(),
+ display_name: "city".to_string(),
+ field_type: enums::FieldType::UserAddressCity,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.state".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.state".to_string(),
+ display_name: "state".to_string(),
+ field_type: enums::FieldType::UserAddressState,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.zip".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.zip".to_string(),
+ display_name: "zip".to_string(),
+ field_type: enums::FieldType::UserAddressPincode,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserAddressCountry{
+ options: vec![
+ "FR".to_string(),
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "billing.phone.number".to_string(),
+ display_name: "phone_number".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line1".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line1".to_string(),
+ display_name: "line1".to_string(),
+ field_type: enums::FieldType::UserAddressLine1,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line2".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line2".to_string(),
+ display_name: "line2".to_string(),
+ field_type: enums::FieldType::UserAddressLine2,
+ value: None,
+ }
+ )
+ ]
+ ),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Atome,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from(
+ [
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.city".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.city".to_string(),
+ display_name: "city".to_string(),
+ field_type: enums::FieldType::UserAddressCity,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.state".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.state".to_string(),
+ display_name: "state".to_string(),
+ field_type: enums::FieldType::UserAddressState,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.zip".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.zip".to_string(),
+ display_name: "zip".to_string(),
+ field_type: enums::FieldType::UserAddressPincode,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserAddressCountry{
+ options: vec![
+ "MY".to_string(),
+ "SG".to_string()
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "billing.phone.number".to_string(),
+ display_name: "phone_number".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line1".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line1".to_string(),
+ display_name: "line1".to_string(),
+ field_type: enums::FieldType::UserAddressLine1,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line2".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line2".to_string(),
+ display_name: "line2".to_string(),
+ field_type: enums::FieldType::UserAddressLine2,
+ value: None,
+ }
+ )
+ ]
+ ),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ ])),
+ ),
+ (
+ enums::PaymentMethod::Crypto,
+ PaymentMethodType(HashMap::from([
+ (
+ enums::PaymentMethodType::CryptoCurrency,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Cryptopay,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate: HashMap::from([
+ (
+ "payment_method_data.crypto.pay_currency".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.crypto.pay_currency".to_string(),
+ display_name: "currency".to_string(),
+ field_type: enums::FieldType::UserCurrency{
+ options: vec![
+ "BTC".to_string(),
+ "LTC".to_string(),
+ "ETH".to_string(),
+ "XRP".to_string(),
+ "XLM".to_string(),
+ "BCH".to_string(),
+ "ADA".to_string(),
+ "SOL".to_string(),
+ "SHIB".to_string(),
+ "TRX".to_string(),
+ "DOGE".to_string(),
+ "BNB".to_string(),
+ "USDT".to_string(),
+ "USDC".to_string(),
+ "DAI".to_string(),
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.crypto.network".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.crypto.network".to_string(),
+ display_name: "network".to_string(),
+ field_type: enums::FieldType::UserCryptoCurrencyNetwork,
+ value: None,
+ }
+ ),
+ ]),
+ common : HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ ])),
+ ),
+ (
+ enums::PaymentMethod::Voucher,
+ PaymentMethodType(HashMap::from([
+ (
+ enums::PaymentMethodType::Boleto,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "payment_method_data.voucher.boleto.social_security_number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.voucher.boleto.social_security_number".to_string(),
+ display_name: "social_security_number".to_string(),
+ field_type: enums::FieldType::Text,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.city".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.city".to_string(),
+ display_name: "city".to_string(),
+ field_type: enums::FieldType::UserAddressCity,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.state".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.state".to_string(),
+ display_name: "state".to_string(),
+ field_type: enums::FieldType::UserAddressState,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.zip".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.zip".to_string(),
+ display_name: "zip".to_string(),
+ field_type: enums::FieldType::UserAddressPincode,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserAddressCountry{
+ options: vec![
+ "BR".to_string(),
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line1".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line1".to_string(),
+ display_name: "line1".to_string(),
+ field_type: enums::FieldType::UserAddressLine1,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line2".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line2".to_string(),
+ display_name: "line2".to_string(),
+ field_type: enums::FieldType::UserAddressLine2,
+ value: None,
+ }
+ ),
+ ]),
+ common : HashMap::new(),
+ }
+ ),
+ (
+ enums::Connector::Zen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Alfamart,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ )
+ ]),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Indomaret,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ )
+ ]),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Oxxo,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::new(),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::SevenEleven,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.phone.number".to_string(),
+ display_name: "phone".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ ]
+ ),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Lawson,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.phone.number".to_string(),
+ display_name: "phone".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ ]
+ ),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::MiniStop,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.phone.number".to_string(),
+ display_name: "phone".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ ]
+ ),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::FamilyMart,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.phone.number".to_string(),
+ display_name: "phone".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ ]
+ ),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Seicomart,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.phone.number".to_string(),
+ display_name: "phone".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ ]
+ ),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::PayEasy,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
value: None,
}
),
- ]),
- common : HashMap::new(),
- }
- ),
- ]),
- },
- ),
- ])),
- ),
- (
- enums::PaymentMethod::Voucher,
- PaymentMethodType(HashMap::from([
- (
- enums::PaymentMethodType::Boleto,
- ConnectorFields {
- fields: HashMap::from([
- (
- enums::Connector::Adyen,
- RequiredFieldFinal {
- mandate : HashMap::new(),
- non_mandate : HashMap::from([
(
- "payment_method_data.voucher.boleto.social_security_number".to_string(),
+ "billing.phone.number".to_string(),
RequiredFieldInfo {
- required_field: "payment_method_data.voucher.boleto.social_security_number".to_string(),
- display_name: "social_security_number".to_string(),
- field_type: enums::FieldType::Text,
+ required_field: "payment_method_data.billing.phone.number".to_string(),
+ display_name: "phone".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
value: None,
}
),
- ]),
+ ]
+ ),
common : HashMap::new(),
}
- ),
- (
- enums::Connector::Zen,
- RequiredFieldFinal {
- mandate: HashMap::new(),
- non_mandate: HashMap::new(),
- common: HashMap::new(),
- }
)
]),
},
@@ -8728,7 +10271,50 @@ impl Default for super::settings::RequiredFields {
value: None,
}
)]),
- })]
+ }),
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::from([ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "owner_name".to_string(),
+ field_type: enums::FieldType::UserBillingName,
+ value: None,
+ }),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "owner_name".to_string(),
+ field_type: enums::FieldType::UserBillingName,
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.bank_debit.ach.account_number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_debit.ach.account_number".to_string(),
+ display_name: "bank_account_number".to_string(),
+ field_type: enums::FieldType::Text,
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.bank_debit.ach.routing_number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_debit.ach.routing_number".to_string(),
+ display_name: "bank_routing_number".to_string(),
+ field_type: enums::FieldType::Text,
+ value: None,
+ }
+ )
+ ]),
+ })
+ ]
)}
),
(
@@ -8751,6 +10337,39 @@ impl Default for super::settings::RequiredFields {
)]),
}
),
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::from([ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "owner_name".to_string(),
+ field_type: enums::FieldType::UserBillingName,
+ value: None,
+ }),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "owner_name".to_string(),
+ field_type: enums::FieldType::UserBillingName,
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.bank_debit.sepa.iban".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_debit.bacs.iban".to_string(),
+ display_name: "bank_account_number".to_string(),
+ field_type: enums::FieldType::Text,
+ value: None,
+ }
+ )
+ ]),
+ })
]),
},
),
@@ -8774,6 +10393,48 @@ impl Default for super::settings::RequiredFields {
)]),
}
),
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::from([ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "owner_name".to_string(),
+ field_type: enums::FieldType::UserBillingName,
+ value: None,
+ }),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "owner_name".to_string(),
+ field_type: enums::FieldType::UserBillingName,
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.bank_debit.bacs.account_number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_debit.bacs.account_number".to_string(),
+ display_name: "bank_account_number".to_string(),
+ field_type: enums::FieldType::Text,
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.bank_debit.bacs.sort_code".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.bank_debit.bacs.sort_code".to_string(),
+ display_name: "bank_sort_code".to_string(),
+ field_type: enums::FieldType::Text,
+ value: None,
+ }
+ )
+ ]),
+ })
]),
},
)]))),
@@ -8869,8 +10530,498 @@ impl Default for super::settings::RequiredFields {
),
}
),
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
])}),
- ])))
+ (
+ enums::PaymentMethodType::PermataBankTransfer,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ )
+ ]),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::BcaBankTransfer,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ )
+ ]),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::BniVa,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ )
+ ]),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::BriVa,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ )
+ ]),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::CimbVa,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ )
+ ]),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::DanamonVa,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ )
+ ]),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::MandiriVa,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate : HashMap::new(),
+ non_mandate : HashMap::from([
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "card_holder_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ )
+ ]),
+ common : HashMap::new(),
+ }
+ )
+ ]),
+ },
+ ),
+ ]))),
+ (
+ enums::PaymentMethod::GiftCard,
+ PaymentMethodType(HashMap::from([
+ (
+ enums::PaymentMethodType::PaySafeCard,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Givex,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from([
+
+ (
+ "payment_method_data.gift_card.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.gift_card.number".to_string(),
+ display_name: "gift_card_number".to_string(),
+ field_type: enums::FieldType::UserCardNumber,
+ value: None,
+ }
+ ),
+ (
+ "payment_method_data.gift_card.cvc".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.gift_card.cvc".to_string(),
+ display_name: "gift_card_cvc".to_string(),
+ field_type: enums::FieldType::UserCardCvc,
+ value: None,
+ }
+ ),
+ ]),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ ]))
+ ),
+ (
+ enums::PaymentMethod::CardRedirect,
+ PaymentMethodType(HashMap::from([
+ (
+ enums::PaymentMethodType::Benefit,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from(
+ [(
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "first_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "last_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.phone.number".to_string(),
+ display_name: "phone".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ )
+ ]
+ ),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::Knet,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::from(
+ [(
+ "billing.address.first_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.first_name".to_string(),
+ display_name: "first_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.last_name".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.last_name".to_string(),
+ display_name: "last_name".to_string(),
+ field_type: enums::FieldType::UserFullName,
+ value: None,
+ }
+ ),
+ (
+ "billing.phone.number".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.phone.number".to_string(),
+ display_name: "phone".to_string(),
+ field_type: enums::FieldType::UserPhoneNumber,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ )
+ ]
+ ),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ ),
+ (
+ enums::PaymentMethodType::MomoAtm,
+ ConnectorFields {
+ fields: HashMap::from([
+ (
+ enums::Connector::Adyen,
+ RequiredFieldFinal {
+ mandate: HashMap::new(),
+ non_mandate: HashMap::new(),
+ common: HashMap::new(),
+ }
+ ),
+ ]),
+ },
+ )
+ ]))
+ )
]))
}
}
diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs
index 71c5bb438d..b1caf65f39 100644
--- a/crates/router/src/connector/adyen/transformers.rs
+++ b/crates/router/src/connector/adyen/transformers.rs
@@ -26,7 +26,6 @@ use crate::{
domain,
storage::enums as storage_enums,
transformers::{ForeignFrom, ForeignTryFrom},
- PaymentsAuthorizeData,
},
utils as crate_utils,
};
@@ -708,7 +707,6 @@ pub struct OnlineBankingCzechRepublicData {
pub enum OnlineBankingCzechRepublicBanks {
KB,
CS,
- C,
}
impl TryFrom<&types::PaymentsAuthorizeRouterData> for JCSVoucherData {
@@ -729,7 +727,6 @@ impl TryFrom<&common_enums::BankNames> for OnlineBankingCzechRepublicBanks {
match bank_name {
common_enums::BankNames::KomercniBanka => Ok(Self::KB),
common_enums::BankNames::CeskaSporitelna => Ok(Self::CS),
- common_enums::BankNames::PlatnoscOnlineKartaPlatnicza => Ok(Self::C),
_ => Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Adyen"),
))?,
@@ -838,7 +835,7 @@ pub struct OnlineBankingThailandData {
#[derive(Debug, Clone, Serialize)]
pub struct OpenBankingUKData {
- issuer: OpenBankingUKIssuer,
+ issuer: Option<OpenBankingUKIssuer>,
}
#[derive(Debug, Clone, Serialize)]
@@ -1697,7 +1694,9 @@ fn get_additional_data(item: &types::PaymentsAuthorizeRouterData) -> Option<Addi
fn get_channel_type(pm_type: &Option<storage_enums::PaymentMethodType>) -> Option<Channel> {
pm_type.as_ref().and_then(|pmt| match pmt {
- storage_enums::PaymentMethodType::GoPay => Some(Channel::Web),
+ storage_enums::PaymentMethodType::GoPay | storage_enums::PaymentMethodType::Vipps => {
+ Some(Channel::Web)
+ }
_ => None,
})
}
@@ -2384,10 +2383,8 @@ impl<'a>
domain::BankRedirectData::OpenBankingUk { issuer, .. } => Ok(
AdyenPaymentMethod::OpenBankingUK(Box::new(OpenBankingUKData {
issuer: match issuer {
- Some(bank_name) => OpenBankingUKIssuer::try_from(bank_name)?,
- None => Err(errors::ConnectorError::MissingRequiredField {
- field_name: "issuer",
- })?,
+ Some(bank_name) => Some(OpenBankingUKIssuer::try_from(bank_name)?),
+ None => None,
},
})),
),
@@ -2623,13 +2620,13 @@ impl<'a>
get_recurring_processing_model(item.router_data)?;
let browser_info = get_browser_info(item.router_data)?;
let billing_address =
- get_address_info(item.router_data.get_optional_billing()).transpose()?;
+ get_address_info(item.router_data.get_optional_billing()).and_then(Result::ok);
let country_code = get_country_code(item.router_data.get_optional_billing());
let additional_data = get_additional_data(item.router_data);
let return_url = item.router_data.request.get_return_url()?;
let card_holder_name = item.router_data.get_optional_billing_full_name();
let payment_method = AdyenPaymentMethod::try_from((card_data, card_holder_name))?;
- let shopper_email = item.router_data.request.email.clone();
+ let shopper_email = item.router_data.get_optional_billing_email();
let shopper_name = get_shopper_name(item.router_data.get_optional_billing());
Ok(AdyenPaymentRequest {
@@ -2699,7 +2696,7 @@ impl<'a>
additional_data,
shopper_name: None,
shopper_locale: None,
- shopper_email: item.router_data.request.email.clone(),
+ shopper_email: item.router_data.get_optional_billing_email(),
social_security_number: None,
telephone_number: None,
billing_address: None,
@@ -2742,6 +2739,10 @@ impl<'a>
let payment_method = AdyenPaymentMethod::try_from((voucher_data, item.router_data))?;
let return_url = item.router_data.request.get_return_url()?;
let social_security_number = get_social_security_number(voucher_data);
+ let billing_address =
+ get_address_info(item.router_data.get_optional_billing()).and_then(Result::ok);
+ let shopper_name = get_shopper_name(item.router_data.get_optional_billing());
+
let request = AdyenPaymentRequest {
amount,
merchant_account: auth_type.merchant_account,
@@ -2752,12 +2753,12 @@ impl<'a>
shopper_interaction,
recurring_processing_model,
additional_data,
- shopper_name: None,
+ shopper_name,
shopper_locale: None,
- shopper_email: item.router_data.request.email.clone(),
+ shopper_email: item.router_data.get_optional_billing_email(),
social_security_number,
telephone_number: None,
- billing_address: None,
+ billing_address,
delivery_address: None,
country_code: None,
line_items: None,
@@ -2805,7 +2806,7 @@ impl<'a>
additional_data: None,
shopper_name: None,
shopper_locale: None,
- shopper_email: item.router_data.request.email.clone(),
+ shopper_email: item.router_data.get_optional_billing_email(),
social_security_number: None,
telephone_number: None,
billing_address: None,
@@ -2856,7 +2857,7 @@ impl<'a>
additional_data: None,
shopper_name: None,
shopper_locale: None,
- shopper_email: item.router_data.request.email.clone(),
+ shopper_email: item.router_data.get_optional_billing_email(),
telephone_number: None,
billing_address: None,
delivery_address: None,
@@ -2904,6 +2905,8 @@ impl<'a>
))?;
let (shopper_locale, country) = get_redirect_extra_details(item.router_data)?;
let line_items = Some(get_line_items(item));
+ let billing_address =
+ get_address_info(item.router_data.get_optional_billing()).and_then(Result::ok);
Ok(AdyenPaymentRequest {
amount,
@@ -2917,10 +2920,10 @@ impl<'a>
additional_data,
telephone_number: None,
shopper_name: None,
- shopper_email: item.router_data.request.email.clone(),
+ shopper_email: item.router_data.get_optional_billing_email(),
shopper_locale,
social_security_number: None,
- billing_address: None,
+ billing_address,
delivery_address: None,
country_code: country,
line_items,
@@ -2944,12 +2947,13 @@ fn get_redirect_extra_details(
domain::BankRedirectData::Sofort {
preferred_language, ..
} => {
- let country = item.get_billing_country()?;
- Ok((preferred_language.clone(), Some(country)))
+ let country = item.get_optional_billing_country();
+ Ok((preferred_language.clone(), country))
}
- domain::BankRedirectData::OpenBankingUk { .. } => {
- let country = item.get_billing_country()?;
- Ok((None, Some(country)))
+ domain::BankRedirectData::Trustly {}
+ | domain::BankRedirectData::OpenBankingUk { .. } => {
+ let country = item.get_optional_billing_country();
+ Ok((None, country))
}
_ => Ok((None, None)),
},
@@ -2958,20 +2962,21 @@ fn get_redirect_extra_details(
}
fn get_shopper_email(
- item: &PaymentsAuthorizeData,
+ item: &types::PaymentsAuthorizeRouterData,
is_mandate_payment: bool,
) -> errors::CustomResult<Option<Email>, errors::ConnectorError> {
if is_mandate_payment {
let payment_method_type = item
+ .request
.payment_method_type
.as_ref()
.ok_or(errors::ConnectorError::MissingPaymentMethodType)?;
match payment_method_type {
- storage_enums::PaymentMethodType::Paypal => Ok(Some(item.get_email()?)),
- _ => Ok(item.email.clone()),
+ storage_enums::PaymentMethodType::Paypal => Ok(Some(item.get_billing_email()?)),
+ _ => Ok(item.get_optional_billing_email()),
}
} else {
- Ok(item.email.clone())
+ Ok(item.get_optional_billing_email())
}
}
@@ -2999,8 +3004,9 @@ impl<'a>
let (recurring_processing_model, store_payment_method, shopper_reference) =
get_recurring_processing_model(item.router_data)?;
let return_url = item.router_data.request.get_router_return_url()?;
- let shopper_email =
- get_shopper_email(&item.router_data.request, store_payment_method.is_some())?;
+ let shopper_email = get_shopper_email(item.router_data, store_payment_method.is_some())?;
+ let billing_address =
+ get_address_info(item.router_data.get_optional_billing()).and_then(Result::ok);
Ok(AdyenPaymentRequest {
amount,
merchant_account: auth_type.merchant_account,
@@ -3016,7 +3022,7 @@ impl<'a>
shopper_email,
shopper_locale: None,
social_security_number: None,
- billing_address: None,
+ billing_address,
delivery_address: None,
country_code: None,
line_items: None,
@@ -3058,13 +3064,12 @@ impl<'a>
let (recurring_processing_model, store_payment_method, _) =
get_recurring_processing_model(item.router_data)?;
let return_url = item.router_data.request.get_return_url()?;
- let shopper_name: Option<ShopperName> =
- get_shopper_name(item.router_data.get_optional_billing());
- let shopper_email = item.router_data.request.email.clone();
+ let shopper_name = get_shopper_name(item.router_data.get_optional_billing());
+ let shopper_email = item.router_data.get_optional_billing_email();
let billing_address =
- get_address_info(item.router_data.get_optional_billing()).transpose()?;
+ get_address_info(item.router_data.get_optional_billing()).and_then(Result::ok);
let delivery_address =
- get_address_info(item.router_data.get_optional_shipping()).transpose()?;
+ get_address_info(item.router_data.get_optional_shipping()).and_then(Result::ok);
let line_items = Some(get_line_items(item));
let telephone_number = get_telephone_number(item.router_data);
let payment_method = AdyenPaymentMethod::try_from((
@@ -3127,7 +3132,7 @@ impl<'a>
let shopper_interaction = AdyenShopperInteraction::from(item.router_data);
let return_url = item.router_data.request.get_return_url()?;
let shopper_name = get_shopper_name(item.router_data.get_optional_billing());
- let shopper_email = item.router_data.request.email.clone();
+ let shopper_email = item.router_data.get_optional_billing_email();
let telephone_number = item
.router_data
.get_billing_phone()