From cae75314c4ed99b77eab0702b5d507f3d714cd19 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 00:25:27 +0000 Subject: [PATCH 1/9] chore(version): 2024.10.30.0 --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb6fcc8f40b6..3d5ba93dca1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to HyperSwitch will be documented here. - - - +## 2024.10.30.0 + +### Refactors + +- **connector:** Add amount conversion framework to payu ([#6199](https://github.com/juspay/hyperswitch/pull/6199)) ([`11ce389`](https://github.com/juspay/hyperswitch/commit/11ce389000bf53c7f740d069f7ad2262bf5b70d6)) + +### Documentation + +- Added desc. for wallets other than AP, GP ([#6452](https://github.com/juspay/hyperswitch/pull/6452)) ([`55a81eb`](https://github.com/juspay/hyperswitch/commit/55a81eb4692979036d0bfd43e445d3e1db6601e7)) + +**Full Changelog:** [`2024.10.29.0...2024.10.30.0`](https://github.com/juspay/hyperswitch/compare/2024.10.29.0...2024.10.30.0) + +- - - + ## 2024.10.29.0 ### Bug Fixes From d697def0b7cad3743db9fd70d09a45921dcbea61 Mon Sep 17 00:00:00 2001 From: Sandeep Kumar <83278309+tsdk02@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:56:26 +0530 Subject: [PATCH 2/9] feat(analytics): add `customer_id` as filter for payment intents (#6344) --- crates/analytics/src/payment_intents/core.rs | 3 +- .../analytics/src/payment_intents/filters.rs | 1 + .../analytics/src/payment_intents/metrics.rs | 7 + .../metrics/payment_processed_amount.rs | 161 ++++++++++++++++++ crates/analytics/src/payment_intents/types.rs | 5 + crates/analytics/src/query.rs | 6 + crates/analytics/src/sqlx.rs | 5 + .../src/analytics/payment_intents.rs | 3 + 8 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs diff --git a/crates/analytics/src/payment_intents/core.rs b/crates/analytics/src/payment_intents/core.rs index af46baed23ee..3e8915c60a2a 100644 --- a/crates/analytics/src/payment_intents/core.rs +++ b/crates/analytics/src/payment_intents/core.rs @@ -205,7 +205,8 @@ pub async fn get_metrics( | PaymentIntentMetrics::SessionizedPaymentsSuccessRate => metrics_builder .payments_success_rate .add_metrics_bucket(&value), - PaymentIntentMetrics::SessionizedPaymentProcessedAmount => metrics_builder + PaymentIntentMetrics::SessionizedPaymentProcessedAmount + | PaymentIntentMetrics::PaymentProcessedAmount => metrics_builder .payment_processed_amount .add_metrics_bucket(&value), PaymentIntentMetrics::SessionizedPaymentsDistribution => metrics_builder diff --git a/crates/analytics/src/payment_intents/filters.rs b/crates/analytics/src/payment_intents/filters.rs index e81b050214c5..d03d6c2a15f9 100644 --- a/crates/analytics/src/payment_intents/filters.rs +++ b/crates/analytics/src/payment_intents/filters.rs @@ -54,4 +54,5 @@ pub struct PaymentIntentFilterRow { pub status: Option>, pub currency: Option>, pub profile_id: Option, + pub customer_id: Option, } diff --git a/crates/analytics/src/payment_intents/metrics.rs b/crates/analytics/src/payment_intents/metrics.rs index e9d7f2443068..9aa7d3e97719 100644 --- a/crates/analytics/src/payment_intents/metrics.rs +++ b/crates/analytics/src/payment_intents/metrics.rs @@ -17,6 +17,7 @@ use crate::{ }; mod payment_intent_count; +mod payment_processed_amount; mod payments_success_rate; mod sessionized_metrics; mod smart_retried_amount; @@ -24,6 +25,7 @@ mod successful_smart_retries; mod total_smart_retries; use payment_intent_count::PaymentIntentCount; +use payment_processed_amount::PaymentProcessedAmount; use payments_success_rate::PaymentsSuccessRate; use smart_retried_amount::SmartRetriedAmount; use successful_smart_retries::SuccessfulSmartRetries; @@ -107,6 +109,11 @@ where .load_metrics(dimensions, auth, filters, granularity, time_range, pool) .await } + Self::PaymentProcessedAmount => { + PaymentProcessedAmount + .load_metrics(dimensions, auth, filters, granularity, time_range, pool) + .await + } Self::SessionizedSuccessfulSmartRetries => { sessionized_metrics::SuccessfulSmartRetries .load_metrics(dimensions, auth, filters, granularity, time_range, pool) diff --git a/crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs b/crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs new file mode 100644 index 000000000000..51b574f4ad38 --- /dev/null +++ b/crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs @@ -0,0 +1,161 @@ +use std::collections::HashSet; + +use api_models::analytics::{ + payment_intents::{ + PaymentIntentDimensions, PaymentIntentFilters, PaymentIntentMetricsBucketIdentifier, + }, + Granularity, TimeRange, +}; +use common_utils::errors::ReportSwitchExt; +use diesel_models::enums as storage_enums; +use error_stack::ResultExt; +use time::PrimitiveDateTime; + +use super::PaymentIntentMetricRow; +use crate::{ + enums::AuthInfo, + query::{Aggregate, GroupByClause, QueryBuilder, QueryFilter, SeriesBucket, ToSql, Window}, + types::{AnalyticsCollection, AnalyticsDataSource, MetricsError, MetricsResult}, +}; + +#[derive(Default)] +pub(super) struct PaymentProcessedAmount; + +#[async_trait::async_trait] +impl super::PaymentIntentMetric for PaymentProcessedAmount +where + T: AnalyticsDataSource + super::PaymentIntentMetricAnalytics, + PrimitiveDateTime: ToSql, + AnalyticsCollection: ToSql, + Granularity: GroupByClause, + Aggregate<&'static str>: ToSql, + Window<&'static str>: ToSql, +{ + async fn load_metrics( + &self, + dimensions: &[PaymentIntentDimensions], + auth: &AuthInfo, + filters: &PaymentIntentFilters, + granularity: &Option, + time_range: &TimeRange, + pool: &T, + ) -> MetricsResult> + { + let mut query_builder: QueryBuilder = + QueryBuilder::new(AnalyticsCollection::PaymentIntent); + + let mut dimensions = dimensions.to_vec(); + + dimensions.push(PaymentIntentDimensions::PaymentIntentStatus); + + for dim in dimensions.iter() { + query_builder.add_select_column(dim).switch()?; + } + + query_builder + .add_select_column(Aggregate::Count { + field: None, + alias: Some("count"), + }) + .switch()?; + + query_builder + .add_select_column("attempt_count == 1 as first_attempt") + .switch()?; + + query_builder.add_select_column("currency").switch()?; + + query_builder + .add_select_column(Aggregate::Sum { + field: "amount", + alias: Some("total"), + }) + .switch()?; + + query_builder + .add_select_column(Aggregate::Min { + field: "created_at", + alias: Some("start_bucket"), + }) + .switch()?; + + query_builder + .add_select_column(Aggregate::Max { + field: "created_at", + alias: Some("end_bucket"), + }) + .switch()?; + + filters.set_filter_clause(&mut query_builder).switch()?; + + auth.set_filter_clause(&mut query_builder).switch()?; + + time_range + .set_filter_clause(&mut query_builder) + .attach_printable("Error filtering time range") + .switch()?; + + for dim in dimensions.iter() { + query_builder + .add_group_by_clause(dim) + .attach_printable("Error grouping by dimensions") + .switch()?; + } + + query_builder + .add_group_by_clause("attempt_count") + .attach_printable("Error grouping by attempt_count") + .switch()?; + + query_builder + .add_group_by_clause("currency") + .attach_printable("Error grouping by currency") + .switch()?; + + if let Some(granularity) = granularity.as_ref() { + granularity + .set_group_by_clause(&mut query_builder) + .attach_printable("Error adding granularity") + .switch()?; + } + + query_builder + .add_filter_clause( + PaymentIntentDimensions::PaymentIntentStatus, + storage_enums::IntentStatus::Succeeded, + ) + .switch()?; + + query_builder + .execute_query::(pool) + .await + .change_context(MetricsError::QueryBuildingError)? + .change_context(MetricsError::QueryExecutionFailure)? + .into_iter() + .map(|i| { + Ok(( + PaymentIntentMetricsBucketIdentifier::new( + None, + i.currency.as_ref().map(|i| i.0), + i.profile_id.clone(), + TimeRange { + start_time: match (granularity, i.start_bucket) { + (Some(g), Some(st)) => g.clip_to_start(st)?, + _ => time_range.start_time, + }, + end_time: granularity.as_ref().map_or_else( + || Ok(time_range.end_time), + |g| i.end_bucket.map(|et| g.clip_to_end(et)).transpose(), + )?, + }, + ), + i, + )) + }) + .collect::, + crate::query::PostProcessingError, + >>() + .change_context(MetricsError::PostProcessingFailure) + } +} diff --git a/crates/analytics/src/payment_intents/types.rs b/crates/analytics/src/payment_intents/types.rs index 03f2a196c20e..bb5141297c56 100644 --- a/crates/analytics/src/payment_intents/types.rs +++ b/crates/analytics/src/payment_intents/types.rs @@ -30,6 +30,11 @@ where .add_filter_in_range_clause(PaymentIntentDimensions::ProfileId, &self.profile_id) .attach_printable("Error adding profile id filter")?; } + if !self.customer_id.is_empty() { + builder + .add_filter_in_range_clause("customer_id", &self.customer_id) + .attach_printable("Error adding customer id filter")?; + } Ok(()) } } diff --git a/crates/analytics/src/query.rs b/crates/analytics/src/query.rs index 7ce338f7db30..d746594e36ee 100644 --- a/crates/analytics/src/query.rs +++ b/crates/analytics/src/query.rs @@ -451,6 +451,12 @@ impl ToSql for &common_utils::id_type::PaymentId { } } +impl ToSql for common_utils::id_type::CustomerId { + fn to_sql(&self, _table_engine: &TableEngine) -> error_stack::Result { + Ok(self.get_string_repr().to_owned()) + } +} + /// Implement `ToSql` on arrays of types that impl `ToString`. macro_rules! impl_to_sql_for_to_string { ($($type:ty),+) => { diff --git a/crates/analytics/src/sqlx.rs b/crates/analytics/src/sqlx.rs index 89eb2ee0bde1..7c90e37c55fb 100644 --- a/crates/analytics/src/sqlx.rs +++ b/crates/analytics/src/sqlx.rs @@ -652,10 +652,15 @@ impl<'a> FromRow<'a, PgRow> for super::payment_intents::filters::PaymentIntentFi ColumnNotFound(_) => Ok(Default::default()), e => Err(e), })?; + let customer_id: Option = row.try_get("customer_id").or_else(|e| match e { + ColumnNotFound(_) => Ok(Default::default()), + e => Err(e), + })?; Ok(Self { status, currency, profile_id, + customer_id, }) } } diff --git a/crates/api_models/src/analytics/payment_intents.rs b/crates/api_models/src/analytics/payment_intents.rs index d018437ae8c1..60662f2e90af 100644 --- a/crates/api_models/src/analytics/payment_intents.rs +++ b/crates/api_models/src/analytics/payment_intents.rs @@ -16,6 +16,8 @@ pub struct PaymentIntentFilters { pub currency: Vec, #[serde(default)] pub profile_id: Vec, + #[serde(default)] + pub customer_id: Vec, } #[derive( @@ -62,6 +64,7 @@ pub enum PaymentIntentMetrics { SmartRetriedAmount, PaymentIntentCount, PaymentsSuccessRate, + PaymentProcessedAmount, SessionizedSuccessfulSmartRetries, SessionizedTotalSmartRetries, SessionizedSmartRetriedAmount, From 8372389671c4aefeb625365d198390df5d8f35a5 Mon Sep 17 00:00:00 2001 From: Kashif Date: Wed, 30 Oct 2024 12:57:22 +0530 Subject: [PATCH 3/9] feat(cypress-test): include worldpay's request / response structure for test suite (#6420) --- .../e2e/PaymentTest/00006-VoidPayment.cy.js | 4 +- .../e2e/PaymentTest/00013-SaveCardFlow.cy.js | 9 +- .../e2e/PaymentTest/00020-Variations.cy.js | 22 +- .../cypress/e2e/PaymentUtils/Commons.js | 21 + .../cypress/e2e/PaymentUtils/Paybox.js | 23 - .../cypress/e2e/PaymentUtils/Utils.js | 7 + .../cypress/e2e/PaymentUtils/WorldPay.js | 436 ++++++++++++++++++ .../fixtures/create-connector-body.json | 3 +- .../cypress/support/redirectionHandler.js | 14 +- 9 files changed, 499 insertions(+), 40 deletions(-) create mode 100644 cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js diff --git a/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js index 9735a74adfd1..c783f5e3d721 100644 --- a/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js +++ b/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js @@ -67,7 +67,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => { it("void-call-test", () => { let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ - "Void" + "VoidAfterConfirm" ]; let req_data = data["Request"]; let res_data = data["Response"]; @@ -178,7 +178,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => { it("void-call-test", () => { let data = getConnectorDetails(globalState.get("connectorId"))[ "card_pm" - ]["Void"]; + ]["VoidAfterConfirm"]; let req_data = data["Request"]; let res_data = data["Response"]; cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState); diff --git a/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js index 6e9289d4d0b0..e74c8fc9dd47 100644 --- a/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js +++ b/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js @@ -46,8 +46,13 @@ describe("Card - SaveCard payment flow test", () => { "automatic", globalState ); - if (should_continue) - should_continue = utils.should_continue_further(res_data); + if (should_continue) { + // Don't continue if payment status is processing during auto capture + // Payment data is tokenized only after payment is successful + let notProcessing = res_data?.body?.status != "processing"; + should_continue = + notProcessing && utils.should_continue_further(res_data); + } }); it("retrieve-payment-call-test", () => { diff --git a/cypress-tests/cypress/e2e/PaymentTest/00020-Variations.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00020-Variations.cy.js index a00a2e39f959..b24b9f10f791 100644 --- a/cypress-tests/cypress/e2e/PaymentTest/00020-Variations.cy.js +++ b/cypress-tests/cypress/e2e/PaymentTest/00020-Variations.cy.js @@ -331,7 +331,7 @@ describe("Corner cases", () => { }); it("Capture call", () => { - let data = getConnectorDetails(globalState.get("commons"))["card_pm"][ + let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ "CaptureCapturedAmount" ]; @@ -396,7 +396,7 @@ describe("Corner cases", () => { }); it("Confirm call", () => { - let data = getConnectorDetails(globalState.get("commons"))["card_pm"][ + let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ "ConfirmSuccessfulPayment" ]; let req_data = data["Request"]; @@ -460,12 +460,12 @@ describe("Corner cases", () => { }); it("Void call", () => { - // `commons` here is intentionally used as we need to pass `ResponseCustom` - let data = getConnectorDetails(globalState.get("commons"))["card_pm"][ + let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ "Void" ]; + let commonData = getConnectorDetails(globalState.get("commons"))["card_pm"]["Void"]; let req_data = data["Request"]; - let res_data = data["ResponseCustom"]; + let res_data = utils.getConnectorFlowDetails(data, commonData, "ResponseCustom"); cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState); if (should_continue) @@ -592,12 +592,12 @@ describe("Corner cases", () => { }); it("Refund call", () => { - // `commons` here is intentionally used as we need to pass `ResponseCustom` - let data = getConnectorDetails(globalState.get("commons"))["card_pm"][ + let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ "Refund" ]; + let commonData = getConnectorDetails(globalState.get("commons"))["card_pm"]["Refund"]; let req_data = data["Request"]; - let res_data = data["ResponseCustom"]; + let res_data = utils.getConnectorFlowDetails(data, commonData, "ResponseCustom"); cy.refundCallTest( fixtures.refundBody, req_data, @@ -655,12 +655,12 @@ describe("Corner cases", () => { }); it("Refund call", () => { - // `commons` here is intentionally used as we need to pass `ResponseCustom` - let data = getConnectorDetails(globalState.get("commons"))["card_pm"][ + let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ "Refund" ]; + let commonData = getConnectorDetails(globalState.get("commons"))["card_pm"]["Refund"]; let req_data = data["Request"]; - let res_data = data["ResponseCustom"]; + let res_data = utils.getConnectorFlowDetails(data, commonData, "ResponseCustom"); cy.refundCallTest( fixtures.refundBody, req_data, diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js index 73e54fee916f..01905ee05320 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js @@ -666,6 +666,27 @@ export const connectorDetails = { }, }, }), + VoidAfterConfirm: getCustomExchange({ + Request: {}, + Response: { + status: 200, + body: { + status: "cancelled", + capture_method: "manual", + }, + }, + ResponseCustom: { + status: 400, + body: { + error: { + type: "invalid_request", + message: + "You cannot cancel this payment because it has status succeeded", + code: "IR_16", + }, + }, + }, + }), Refund: getCustomExchange({ Request: { payment_method: "card", diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Paybox.js b/cypress-tests/cypress/e2e/PaymentUtils/Paybox.js index 8fbb8c0b07b7..b0550854ef87 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Paybox.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Paybox.js @@ -401,29 +401,6 @@ export const connectorDetails = { }, }, }, - CaptureCapturedAmount: { - Request: { - Request: { - payment_method: "card", - payment_method_data: { - card: successfulNo3DSCardDetails, - }, - currency: "EUR", - customer_acceptance: null, - }, - }, - Response: { - status: 400, - body: { - error: { - type: "invalid_request", - message: - "This Payment could not be captured because it has a payment.status of succeeded. The expected state is requires_capture, partially_captured_and_capturable, processing", - code: "IR_14", - }, - }, - }, - }, ConfirmSuccessfulPayment: { Request: { payment_method: "card", diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Utils.js b/cypress-tests/cypress/e2e/PaymentUtils/Utils.js index 18f4df3eb577..8848450bc61e 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Utils.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Utils.js @@ -19,6 +19,7 @@ import { connectorDetails as stripeConnectorDetails } from "./Stripe.js"; import { connectorDetails as trustpayConnectorDetails } from "./Trustpay.js"; import { connectorDetails as wellsfargoConnectorDetails } from "./WellsFargo.js"; import { connectorDetails as fiuuConnectorDetails } from "./Fiuu.js"; +import { connectorDetails as worldpayConnectorDetails } from "./WorldPay.js"; const connectorDetails = { adyen: adyenConnectorDetails, @@ -39,6 +40,7 @@ const connectorDetails = { datatrans: datatransConnectorDetails, wellsfargo: wellsfargoConnectorDetails, fiuu: fiuuConnectorDetails, + worldpay: worldpayConnectorDetails, }; export default function getConnectorDetails(connectorId) { @@ -46,6 +48,11 @@ export default function getConnectorDetails(connectorId) { return x; } +export function getConnectorFlowDetails(connectorData, commonData, key) { + let data = connectorData[key] === undefined ? commonData[key] : connectorData[key]; + return data; +} + function mergeDetails(connectorId) { const connectorData = getValueByKey(connectorDetails, connectorId); const fallbackData = getValueByKey(connectorDetails, "commons"); diff --git a/cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js b/cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js new file mode 100644 index 000000000000..70ed4fefa6c2 --- /dev/null +++ b/cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js @@ -0,0 +1,436 @@ + +const billing = { + address: { + line1: "1467", + line2: "Harrison Street", + line3: "Harrison Street", + city: "San Fransico", + state: "CA", + zip: "94122", + country: "US", + first_name: "John", + last_name: "Doe" + } +}; + +const browser_info = { + "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", + "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", + "language": "nl-NL", + "color_depth": 24, + "screen_height": 723, + "screen_width": 1536, + "time_zone": 0, + "java_enabled": true, + "java_script_enabled": true, + "ip_address": "127.0.0.1" +}; + +const successfulNo3DSCardDetails = { + card_number: "4242424242424242", + card_exp_month: "10", + card_exp_year: "2030", + card_holder_name: "morino", + card_cvc: "737", +}; + +const successfulThreeDSTestCardDetails = { + card_number: "4000000000001091", + card_exp_month: "10", + card_exp_year: "2030", + card_holder_name: "morino", + card_cvc: "737", +}; + +const payment_method_data_no3ds = { + card: { + last4: "4242", + card_type: "CREDIT", + card_network: "Visa", + card_issuer: "STRIPE PAYMENTS UK LIMITED", + card_issuing_country: "UNITEDKINGDOM", + card_isin: "424242", + card_extended_bin: null, + card_exp_month: "10", + card_exp_year: "2030", + card_holder_name: null, + payment_checks: null, + authentication_data: null + }, + billing: null +}; + +const payment_method_data_3ds = { + card: { + last4: "1091", + card_type: "CREDIT", + card_network: "Visa", + card_issuer: "INTL HDQTRS-CENTER OWNED", + card_issuing_country: "UNITEDSTATES", + card_isin: "400000", + card_extended_bin: null, + card_exp_month: "10", + card_exp_year: "2030", + card_holder_name: null, + payment_checks: null, + authentication_data: null + }, + billing: null +}; + +const singleUseMandateData = { + customer_acceptance: { + acceptance_type: "offline", + accepted_at: "1963-05-03T04:07:52.723Z", + online: { + ip_address: "125.0.0.1", + user_agent: "amet irure esse", + }, + }, + mandate_type: { + single_use: { + amount: 8000, + currency: "USD", + }, + }, +}; + +export const connectorDetails = { + card_pm: { + PaymentIntent: { + Request: { + currency: "USD", + customer_acceptance: null, + setup_future_usage: "on_session", + }, Response: { + status: 200, + body: { + status: "requires_payment_method", + setup_future_usage: "on_session", + }, + }, + }, + No3DSManualCapture: { + Request: { + payment_method: "card", + payment_method_type: "debit", + payment_method_data: { + card: successfulNo3DSCardDetails, + }, + currency: "USD", + customer_acceptance: null, + setup_future_usage: "on_session", + billing: billing, + }, + Response: { + status: 200, + body: { + status: "requires_capture", + payment_method: "card", + payment_method_type: "debit", + attempt_count: 1, + payment_method_data: payment_method_data_no3ds, + }, + }, + }, + No3DSAutoCapture: { + Request: { + payment_method: "card", + payment_method_type: "debit", + payment_method_data: { + card: successfulNo3DSCardDetails, + }, + currency: "USD", + customer_acceptance: null, + setup_future_usage: "on_session", + }, + Response: { + status: 200, + body: { + status: "processing", + payment_method: "card", + payment_method_type: "debit", + attempt_count: 1, + payment_method_data: payment_method_data_no3ds, + }, + }, + }, + Capture: { + Request: { + payment_method: "card", + payment_method_type: "debit", + payment_method_data: { + card: successfulNo3DSCardDetails, + }, + currency: "USD", + customer_acceptance: null, + }, + Response: { + status: 200, + body: { + status: "processing", + amount: 6500, + amount_capturable: 6500, + }, + }, + }, + PartialCapture: { + Request: { + payment_method: "card", + payment_method_type: "debit", + payment_method_data: { + card: successfulNo3DSCardDetails, + }, + currency: "USD", + customer_acceptance: null, + }, + Response: { + status: 200, + body: { + status: "processing", + amount: 6500, + amount_capturable: 6500, + }, + }, + }, + Void: { + Request: {}, + Response: { + status: 200, + body: { + status: "cancelled", + }, + }, + ResponseCustom: { + body: { + type: "invalid_request", + message: "You cannot cancel this payment because it has status processing", + code: "IR_16", + } + } + }, + VoidAfterConfirm: { + Request: {}, + Response: { + status: 200, + body: { + status: "processing", + }, + }, + }, + SaveCardUseNo3DSManualCapture: { + Request: { + payment_method: "card", + payment_method_data: { + card: successfulNo3DSCardDetails, + }, + currency: "USD", + setup_future_usage: "on_session", + customer_acceptance: { + acceptance_type: "offline", + accepted_at: "1963-05-03T04:07:52.723Z", + online: { + ip_address: "127.0.0.1", + user_agent: "amet irure esse", + }, + }, + }, + Response: { + status: 400, + body: { + error: { + type: "invalid_request", + message: "Missing required param: payment_method_data", + code: "IR_04" + } + }, + }, + }, + SaveCardUseNo3DSAutoCapture: { + Request: { + payment_method: "card", + payment_method_data: { + card: successfulNo3DSCardDetails, + }, + currency: "USD", + setup_future_usage: "on_session", + browser_info, + customer_acceptance: { + acceptance_type: "offline", + accepted_at: "1963-05-03T04:07:52.723Z", + online: { + ip_address: "127.0.0.1", + user_agent: "amet irure esse", + }, + }, + }, + Response: { + status: 200, + body: { + status: "processing" + }, + } + }, + "3DSManualCapture": { + Request: { + payment_method: "card", + payment_method_type: "debit", + payment_method_data: { + card: successfulThreeDSTestCardDetails, + }, + currency: "USD", + customer_acceptance: null, + setup_future_usage: "on_session", + browser_info, + }, + Response: { + status: 200, + body: { + status: "requires_customer_action", + setup_future_usage: "on_session", + payment_method_data: payment_method_data_3ds, + }, + }, + }, + "3DSAutoCapture": { + Request: { + payment_method: "card", + payment_method_type: "debit", + payment_method_data: { + card: successfulThreeDSTestCardDetails, + }, + currency: "USD", + customer_acceptance: null, + setup_future_usage: "on_session", + browser_info, + }, + Response: { + status: 200, + body: { + status: "requires_customer_action", + setup_future_usage: "on_session", + payment_method_data: payment_method_data_3ds, + }, + }, + }, + + /** + * Variation cases + */ + CaptureCapturedAmount: { + Request: { + Request: { + payment_method: "card", + payment_method_data: { + card: successfulNo3DSCardDetails, + }, + currency: "EUR", + customer_acceptance: null, + }, + }, + Response: { + status: 400, + body: { + error: { + type: "invalid_request", + message: + "This Payment could not be captured because it has a capture_method of automatic. The expected state is manual_multiple", + code: "IR_14", + }, + }, + }, + }, + ConfirmSuccessfulPayment: { + Request: { + payment_method: "card", + payment_method_data: { + card: successfulNo3DSCardDetails, + }, + currency: "USD", + customer_acceptance: null, + }, + Response: { + status: 400, + body: { + error: { + type: "invalid_request", + message: + "You cannot confirm this payment because it has status processing", + code: "IR_16", + }, + }, + }, + }, + + /** + * Not implemented or not ready for running test cases + * - Refunds + * - Mandates + */ + Refund: { + Request: {}, + Response: { + body: { + error: { + type: "invalid_request", + message: "This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured", + code: "IR_14" + } + } + }, + ResponseCustom: { + status: 400, + body: { + error: { + type: "invalid_request", + message: "This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured", + code: "IR_14", + }, + }, + }, + }, + PartialRefund: { + Request: {}, + Response: { + body: { + error: { + type: "invalid_request", + message: "This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured", + code: "IR_14" + } + } + } + }, + SyncRefund: { + Request: {}, + Response: { + body: { + error: { + type: "invalid_request", + message: "Refund does not exist in our records.", + code: "HE_02" + } + } + } + }, + ZeroAuthMandate: { + Request: { + payment_method: "card", + payment_method_data: { + card: successfulNo3DSCardDetails, + }, + currency: "USD", + mandate_data: singleUseMandateData, + }, + Response: { + body: { + error: { + type: "invalid_request", + message: "Setup Mandate flow for Worldpay is not implemented", + code: "IR_00" + } + }, + }, + }, + }, +} \ No newline at end of file diff --git a/cypress-tests/cypress/fixtures/create-connector-body.json b/cypress-tests/cypress/fixtures/create-connector-body.json index 5e0ce73aedc8..54a96d8f6ee2 100644 --- a/cypress-tests/cypress/fixtures/create-connector-body.json +++ b/cypress-tests/cypress/fixtures/create-connector-body.json @@ -13,6 +13,7 @@ "metadata": { "city": "NY", "unit": "245", - "endpoint_prefix": "AD" + "endpoint_prefix": "AD", + "merchant_name": "Cypress Test" } } diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.js index b493d11fee83..aa6db7d50747 100644 --- a/cypress-tests/cypress/support/redirectionHandler.js +++ b/cypress-tests/cypress/support/redirectionHandler.js @@ -343,7 +343,19 @@ function threeDsRedirection(redirection_url, expected_url, connectorId) { cy.get("#outcomeSelect").select("Approve").should("have.value", "Y"); cy.get('button[type="submit"]').click(); }); - } else { + } else if (connectorId === "worldpay") { + cy.get("iframe", { timeout: WAIT_TIME }) + .its("0.contentDocument.body") + .within(() => { + cy.get('form[name="cardholderInput"]', { timeout: WAIT_TIME }) + .should("exist") + .then(() => { + cy.get('input[name="challengeDataEntry"]').click().type("1234"); + cy.get('input[value="SUBMIT"]').click(); + }) + }); + } + else { // If connectorId is neither of adyen, trustpay, nmi, stripe, bankofamerica or cybersource, wait for 10 seconds cy.wait(WAIT_TIME); } From 7dcffccf3f16de5e40f61a302beb318035c3e88b Mon Sep 17 00:00:00 2001 From: Mani Chandra <84711804+ThisIsMani@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:58:41 +0530 Subject: [PATCH 4/9] feat(authz): Make info APIs support `ParentGroup` (#6440) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> --- crates/api_models/src/events/user_role.rs | 9 ++- crates/api_models/src/user_role/role.rs | 26 +++++- crates/common_enums/src/enums.rs | 20 +++-- crates/router/src/core/user_role.rs | 45 ++++++++++- crates/router/src/core/user_role/role.rs | 80 ++++++++++++++++++- crates/router/src/routes/app.rs | 12 +++ crates/router/src/routes/lock_utils.rs | 3 + crates/router/src/routes/user_role.rs | 67 ++++++++++++++++ .../router/src/services/authorization/info.rs | 26 +----- .../authorization/permission_groups.rs | 70 +++++++++++++--- .../src/services/authorization/permissions.rs | 31 +++++++ .../authorization/roles/predefined_roles.rs | 21 +++++ crates/router_env/src/logger/types.rs | 6 ++ 13 files changed, 364 insertions(+), 52 deletions(-) diff --git a/crates/api_models/src/events/user_role.rs b/crates/api_models/src/events/user_role.rs index a2c76ecc3944..e0df36a3349c 100644 --- a/crates/api_models/src/events/user_role.rs +++ b/crates/api_models/src/events/user_role.rs @@ -2,8 +2,9 @@ use common_utils::events::{ApiEventMetric, ApiEventsType}; use crate::user_role::{ role::{ - CreateRoleRequest, GetRoleRequest, ListRolesAtEntityLevelRequest, ListRolesRequest, - RoleInfoResponseNew, RoleInfoWithGroupsResponse, UpdateRoleRequest, + CreateRoleRequest, GetRoleRequest, GroupsAndResources, ListRolesAtEntityLevelRequest, + ListRolesRequest, RoleInfoResponseNew, RoleInfoWithGroupsResponse, RoleInfoWithParents, + UpdateRoleRequest, }, AuthorizationInfoResponse, DeleteUserRoleRequest, ListUsersInEntityRequest, UpdateUserRoleRequest, @@ -22,6 +23,8 @@ common_utils::impl_api_event_type!( RoleInfoResponseNew, RoleInfoWithGroupsResponse, ListUsersInEntityRequest, - ListRolesRequest + ListRolesRequest, + GroupsAndResources, + RoleInfoWithParents ) ); diff --git a/crates/api_models/src/user_role/role.rs b/crates/api_models/src/user_role/role.rs index 885ec455e4cf..7c877cd74777 100644 --- a/crates/api_models/src/user_role/role.rs +++ b/crates/api_models/src/user_role/role.rs @@ -1,5 +1,6 @@ -pub use common_enums::PermissionGroup; -use common_enums::{EntityType, RoleScope}; +use common_enums::{ + EntityType, ParentGroup, PermissionGroup, PermissionScope, Resource, RoleScope, +}; #[derive(Debug, serde::Deserialize, serde::Serialize)] pub struct CreateRoleRequest { @@ -22,6 +23,21 @@ pub struct RoleInfoWithGroupsResponse { pub role_scope: RoleScope, } +#[derive(Debug, serde::Serialize)] +pub struct RoleInfoWithParents { + pub role_id: String, + pub parent_groups: Vec, + pub role_name: String, + pub role_scope: RoleScope, +} + +#[derive(Debug, serde::Serialize)] +pub struct ParentGroupInfo { + pub name: ParentGroup, + pub description: String, + pub scopes: Vec, +} + #[derive(Debug, serde::Deserialize, serde::Serialize)] pub struct ListRolesRequest { pub entity_type: Option, @@ -57,3 +73,9 @@ pub struct MinimalRoleInfo { pub role_id: String, pub role_name: String, } + +#[derive(Debug, serde::Serialize)] +pub struct GroupsAndResources { + pub groups: Vec, + pub resources: Vec, +} diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index c103153eec80..faae71eda223 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -2884,10 +2884,15 @@ pub enum PermissionGroup { AnalyticsView, UsersView, UsersManage, + // TODO: To be deprecated, make sure DB is migrated before removing MerchantDetailsView, + // TODO: To be deprecated, make sure DB is migrated before removing MerchantDetailsManage, + // TODO: To be deprecated, make sure DB is migrated before removing OrganizationManage, ReconOps, + AccountView, + AccountManage, } #[derive(Clone, Debug, serde::Serialize, PartialEq, Eq, Hash, strum::EnumIter)] @@ -2897,14 +2902,12 @@ pub enum ParentGroup { Workflows, Analytics, Users, - #[serde(rename = "MerchantAccess")] - Merchant, - #[serde(rename = "OrganizationAccess")] - Organization, Recon, + Account, } -#[derive(Clone, Copy, Eq, PartialEq, Hash)] +#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize)] +#[serde(rename_all = "snake_case")] pub enum Resource { Payment, Refund, @@ -2925,10 +2928,11 @@ pub enum Resource { Recon, } -#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, serde::Serialize, Hash)] +#[serde(rename_all = "snake_case")] pub enum PermissionScope { - Read, - Write, + Read = 0, + Write = 1, } /// Name of banks supported by Hyperswitch diff --git a/crates/router/src/core/user_role.rs b/crates/router/src/core/user_role.rs index 284be4ab4baa..27c1e2ae4945 100644 --- a/crates/router/src/core/user_role.rs +++ b/crates/router/src/core/user_role.rs @@ -1,6 +1,9 @@ use std::collections::{HashMap, HashSet}; -use api_models::{user as user_api, user_role as user_role_api}; +use api_models::{ + user as user_api, + user_role::{self as user_role_api, role as role_api}, +}; use diesel_models::{ enums::{UserRoleVersion, UserStatus}, organization::OrganizationBridge, @@ -16,7 +19,11 @@ use crate::{ routes::{app::ReqState, SessionState}, services::{ authentication as auth, - authorization::{info, permission_groups::PermissionGroupExt, roles}, + authorization::{ + info, + permission_groups::{ParentGroupExt, PermissionGroupExt}, + roles, + }, ApplicationResponse, }, types::domain, @@ -72,6 +79,40 @@ pub async fn get_authorization_info_with_group_tag( )) } +pub async fn get_parent_group_info( + state: SessionState, + user_from_token: auth::UserFromToken, +) -> UserResponse> { + let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + &state, + &user_from_token.role_id, + &user_from_token.merchant_id, + &user_from_token.org_id, + ) + .await + .to_not_found_response(UserErrors::InvalidRoleId)?; + + let parent_groups = ParentGroup::get_descriptions_for_groups( + role_info.get_entity_type(), + PermissionGroup::iter().collect(), + ) + .into_iter() + .map(|(parent_group, description)| role_api::ParentGroupInfo { + name: parent_group.clone(), + description, + scopes: PermissionGroup::iter() + .filter_map(|group| (group.parent() == parent_group).then_some(group.scope())) + // TODO: Remove this hashset conversion when merhant access + // and organization access groups are removed + .collect::>() + .into_iter() + .collect(), + }) + .collect::>(); + + Ok(ApplicationResponse::Json(parent_groups)) +} + pub async fn update_user_role( state: SessionState, user_from_token: auth::UserFromToken, diff --git a/crates/router/src/core/user_role/role.rs b/crates/router/src/core/user_role/role.rs index b5b5cab421f1..1d37f7ac8d16 100644 --- a/crates/router/src/core/user_role/role.rs +++ b/crates/router/src/core/user_role/role.rs @@ -1,5 +1,7 @@ +use std::collections::HashSet; + use api_models::user_role::role::{self as role_api}; -use common_enums::{EntityType, RoleScope}; +use common_enums::{EntityType, ParentGroup, PermissionGroup, RoleScope}; use common_utils::generate_id_with_default_len; use diesel_models::role::{RoleNew, RoleUpdate}; use error_stack::{report, ResultExt}; @@ -9,7 +11,10 @@ use crate::{ routes::{app::ReqState, SessionState}, services::{ authentication::{blacklist, UserFromToken}, - authorization::roles::{self, predefined_roles::PREDEFINED_ROLES}, + authorization::{ + permission_groups::{ParentGroupExt, PermissionGroupExt}, + roles::{self, predefined_roles::PREDEFINED_ROLES}, + }, ApplicationResponse, }, types::domain::user::RoleName, @@ -19,7 +24,7 @@ use crate::{ pub async fn get_role_from_token_with_groups( state: SessionState, user_from_token: UserFromToken, -) -> UserResponse> { +) -> UserResponse> { let role_info = user_from_token .get_role_info_from_db(&state) .await @@ -30,6 +35,29 @@ pub async fn get_role_from_token_with_groups( Ok(ApplicationResponse::Json(permissions)) } +pub async fn get_groups_and_resources_for_role_from_token( + state: SessionState, + user_from_token: UserFromToken, +) -> UserResponse { + let role_info = user_from_token.get_role_info_from_db(&state).await?; + + let groups = role_info + .get_permission_groups() + .into_iter() + .collect::>(); + let resources = groups + .iter() + .flat_map(|group| group.resources()) + .collect::>() + .into_iter() + .collect(); + + Ok(ApplicationResponse::Json(role_api::GroupsAndResources { + groups, + resources, + })) +} + pub async fn create_role( state: SessionState, user_from_token: UserFromToken, @@ -111,6 +139,52 @@ pub async fn get_role_with_groups( )) } +pub async fn get_parent_info_for_role( + state: SessionState, + user_from_token: UserFromToken, + role: role_api::GetRoleRequest, +) -> UserResponse { + let role_info = roles::RoleInfo::from_role_id_in_merchant_scope( + &state, + &role.role_id, + &user_from_token.merchant_id, + &user_from_token.org_id, + ) + .await + .to_not_found_response(UserErrors::InvalidRoleId)?; + + if role_info.is_internal() { + return Err(UserErrors::InvalidRoleId.into()); + } + + let parent_groups = ParentGroup::get_descriptions_for_groups( + role_info.get_entity_type(), + role_info.get_permission_groups().to_vec(), + ) + .into_iter() + .map(|(parent_group, description)| role_api::ParentGroupInfo { + name: parent_group.clone(), + description, + scopes: role_info + .get_permission_groups() + .iter() + .filter_map(|group| (group.parent() == parent_group).then_some(group.scope())) + // TODO: Remove this hashset conversion when merhant access + // and organization access groups are removed + .collect::>() + .into_iter() + .collect(), + }) + .collect(); + + Ok(ApplicationResponse::Json(role_api::RoleInfoWithParents { + role_id: role.role_id, + parent_groups, + role_name: role_info.get_role_name().to_string(), + role_scope: role_info.get_scope(), + })) +} + pub async fn update_role( state: SessionState, user_from_token: UserFromToken, diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index f11840edf630..f54895ce7da3 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -1819,9 +1819,14 @@ impl User { web::resource("/permission_info") .route(web::get().to(user_role::get_authorization_info)), ) + // TODO: To be deprecated .service( web::resource("/module/list").route(web::get().to(user_role::get_role_information)), ) + .service( + web::resource("/parent/list") + .route(web::get().to(user_role::get_parent_group_info)), + ) .service( web::resource("/update").route(web::post().to(user::update_user_account_details)), ) @@ -2017,6 +2022,9 @@ impl User { .route(web::get().to(user_role::get_role_from_token)) .route(web::post().to(user_role::create_role)), ) + .service(web::resource("/v2").route( + web::get().to(user_role::get_groups_and_resources_for_role_from_token), + )) // TODO: To be deprecated .service( web::resource("/v2/list") @@ -2039,6 +2047,10 @@ impl User { web::resource("/{role_id}") .route(web::get().to(user_role::get_role)) .route(web::put().to(user_role::update_role)), + ) + .service( + web::resource("/{role_id}/v2") + .route(web::get().to(user_role::get_parent_info_for_role)), ), ); diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs index a0c5c0f99026..ac17cf802107 100644 --- a/crates/router/src/routes/lock_utils.rs +++ b/crates/router/src/routes/lock_utils.rs @@ -263,10 +263,13 @@ impl From for ApiIdentifier { | Flow::ListInvitableRolesAtEntityLevel | Flow::ListUpdatableRolesAtEntityLevel | Flow::GetRole + | Flow::GetRoleV2 | Flow::GetRoleFromToken + | Flow::GetRoleFromTokenV2 | Flow::UpdateUserRole | Flow::GetAuthorizationInfo | Flow::GetRolesInfo + | Flow::GetParentGroupInfo | Flow::AcceptInvitationsV2 | Flow::AcceptInvitationsPreAuth | Flow::DeleteUserRole diff --git a/crates/router/src/routes/user_role.rs b/crates/router/src/routes/user_role.rs index 74847f064747..9910cef3950a 100644 --- a/crates/router/src/routes/user_role.rs +++ b/crates/router/src/routes/user_role.rs @@ -55,6 +55,26 @@ pub async fn get_role_from_token(state: web::Data, req: HttpRequest) - .await } +pub async fn get_groups_and_resources_for_role_from_token( + state: web::Data, + req: HttpRequest, +) -> HttpResponse { + let flow = Flow::GetRoleFromTokenV2; + + Box::pin(api::server_wrap( + flow, + state.clone(), + &req, + (), + |state, user, _, _| async move { + role_core::get_groups_and_resources_for_role_from_token(state, user).await + }, + &auth::DashboardNoPermissionAuth, + api_locking::LockAction::NotApplicable, + )) + .await +} + pub async fn create_role( state: web::Data, req: HttpRequest, @@ -100,6 +120,31 @@ pub async fn get_role( .await } +pub async fn get_parent_info_for_role( + state: web::Data, + req: HttpRequest, + path: web::Path, +) -> HttpResponse { + let flow = Flow::GetRoleV2; + let request_payload = user_role_api::role::GetRoleRequest { + role_id: path.into_inner(), + }; + Box::pin(api::server_wrap( + flow, + state.clone(), + &req, + request_payload, + |state, user, payload, _| async move { + role_core::get_parent_info_for_role(state, user, payload).await + }, + &auth::JWTAuth { + permission: Permission::ProfileUserRead, + }, + api_locking::LockAction::NotApplicable, + )) + .await +} + pub async fn update_role( state: web::Data, req: HttpRequest, @@ -226,6 +271,28 @@ pub async fn get_role_information( .await } +pub async fn get_parent_group_info( + state: web::Data, + http_req: HttpRequest, +) -> HttpResponse { + let flow = Flow::GetParentGroupInfo; + + Box::pin(api::server_wrap( + flow, + state.clone(), + &http_req, + (), + |state, user_from_token, _, _| async move { + user_role_core::get_parent_group_info(state, user_from_token).await + }, + &auth::JWTAuth { + permission: Permission::ProfileUserRead, + }, + api_locking::LockAction::NotApplicable, + )) + .await +} + pub async fn list_users_in_lineage( state: web::Data, req: HttpRequest, diff --git a/crates/router/src/services/authorization/info.rs b/crates/router/src/services/authorization/info.rs index dba96dac1888..bd987e2fe9ae 100644 --- a/crates/router/src/services/authorization/info.rs +++ b/crates/router/src/services/authorization/info.rs @@ -37,32 +37,13 @@ fn get_group_description(group: PermissionGroup) -> &'static str { PermissionGroup::AnalyticsView => "View Analytics", PermissionGroup::UsersView => "View Users", PermissionGroup::UsersManage => "Manage and invite Users to the Team", - PermissionGroup::MerchantDetailsView => "View Merchant Details", - PermissionGroup::MerchantDetailsManage => "Create, modify and delete Merchant Details like api keys, webhooks, etc", + PermissionGroup::MerchantDetailsView | PermissionGroup::AccountView => "View Merchant Details", + PermissionGroup::MerchantDetailsManage | PermissionGroup::AccountManage => "Create, modify and delete Merchant Details like api keys, webhooks, etc", PermissionGroup::OrganizationManage => "Manage organization level tasks like create new Merchant accounts, Organization level roles, etc", PermissionGroup::ReconOps => "View and manage reconciliation reports", } } -pub fn get_parent_name(group: PermissionGroup) -> ParentGroup { - match group { - PermissionGroup::OperationsView | PermissionGroup::OperationsManage => { - ParentGroup::Operations - } - PermissionGroup::ConnectorsView | PermissionGroup::ConnectorsManage => { - ParentGroup::Connectors - } - PermissionGroup::WorkflowsView | PermissionGroup::WorkflowsManage => ParentGroup::Workflows, - PermissionGroup::AnalyticsView => ParentGroup::Analytics, - PermissionGroup::UsersView | PermissionGroup::UsersManage => ParentGroup::Users, - PermissionGroup::MerchantDetailsView | PermissionGroup::MerchantDetailsManage => { - ParentGroup::Merchant - } - PermissionGroup::OrganizationManage => ParentGroup::Organization, - PermissionGroup::ReconOps => ParentGroup::Recon, - } -} - pub fn get_parent_group_description(group: ParentGroup) -> &'static str { match group { ParentGroup::Operations => "Payments, Refunds, Payouts, Mandates, Disputes and Customers", @@ -70,8 +51,7 @@ pub fn get_parent_group_description(group: ParentGroup) -> &'static str { ParentGroup::Workflows => "Create, modify and delete Routing, 3DS Decision Manager, Surcharge Decision Manager", ParentGroup::Analytics => "View Analytics", ParentGroup::Users => "Manage and invite Users to the Team", - ParentGroup::Merchant => "Create, modify and delete Merchant Details like api keys, webhooks, etc", - ParentGroup::Organization =>"Manage organization level tasks like create new Merchant accounts, Organization level roles, etc", + ParentGroup::Account => "Create, modify and delete Merchant Details like api keys, webhooks, etc", ParentGroup::Recon => "View and manage reconciliation reports", } } diff --git a/crates/router/src/services/authorization/permission_groups.rs b/crates/router/src/services/authorization/permission_groups.rs index 3d1a0c8ea5b1..57c385565a86 100644 --- a/crates/router/src/services/authorization/permission_groups.rs +++ b/crates/router/src/services/authorization/permission_groups.rs @@ -1,4 +1,9 @@ -use common_enums::{ParentGroup, PermissionGroup, PermissionScope, Resource}; +use std::collections::HashMap; + +use common_enums::{EntityType, ParentGroup, PermissionGroup, PermissionScope, Resource}; +use strum::IntoEnumIterator; + +use super::permissions::{self, ResourceExt}; pub trait PermissionGroupExt { fn scope(&self) -> PermissionScope; @@ -15,7 +20,8 @@ impl PermissionGroupExt for PermissionGroup { | Self::WorkflowsView | Self::AnalyticsView | Self::UsersView - | Self::MerchantDetailsView => PermissionScope::Read, + | Self::MerchantDetailsView + | Self::AccountView => PermissionScope::Read, Self::OperationsManage | Self::ConnectorsManage @@ -23,7 +29,8 @@ impl PermissionGroupExt for PermissionGroup { | Self::UsersManage | Self::MerchantDetailsManage | Self::OrganizationManage - | Self::ReconOps => PermissionScope::Write, + | Self::ReconOps + | Self::AccountManage => PermissionScope::Write, } } @@ -34,9 +41,12 @@ impl PermissionGroupExt for PermissionGroup { Self::WorkflowsView | Self::WorkflowsManage => ParentGroup::Workflows, Self::AnalyticsView => ParentGroup::Analytics, Self::UsersView | Self::UsersManage => ParentGroup::Users, - Self::MerchantDetailsView | Self::MerchantDetailsManage => ParentGroup::Merchant, - Self::OrganizationManage => ParentGroup::Organization, Self::ReconOps => ParentGroup::Recon, + Self::MerchantDetailsView + | Self::OrganizationManage + | Self::MerchantDetailsManage + | Self::AccountView + | Self::AccountManage => ParentGroup::Account, } } @@ -52,10 +62,14 @@ impl PermissionGroupExt for PermissionGroup { Self::ConnectorsView => vec![Self::ConnectorsView], Self::ConnectorsManage => vec![Self::ConnectorsView, Self::ConnectorsManage], - Self::WorkflowsView => vec![Self::WorkflowsView], - Self::WorkflowsManage => vec![Self::WorkflowsView, Self::WorkflowsManage], + Self::WorkflowsView => vec![Self::WorkflowsView, Self::ConnectorsView], + Self::WorkflowsManage => vec![ + Self::WorkflowsView, + Self::WorkflowsManage, + Self::ConnectorsView, + ], - Self::AnalyticsView => vec![Self::AnalyticsView], + Self::AnalyticsView => vec![Self::AnalyticsView, Self::OperationsView], Self::UsersView => vec![Self::UsersView], Self::UsersManage => { @@ -70,12 +84,19 @@ impl PermissionGroupExt for PermissionGroup { } Self::OrganizationManage => vec![Self::OrganizationManage], + + Self::AccountView => vec![Self::AccountView], + Self::AccountManage => vec![Self::AccountView, Self::AccountManage], } } } pub trait ParentGroupExt { fn resources(&self) -> Vec; + fn get_descriptions_for_groups( + entity_type: EntityType, + groups: Vec, + ) -> HashMap; } impl ParentGroupExt for ParentGroup { @@ -86,10 +107,38 @@ impl ParentGroupExt for ParentGroup { Self::Workflows => WORKFLOWS.to_vec(), Self::Analytics => ANALYTICS.to_vec(), Self::Users => USERS.to_vec(), - Self::Merchant | Self::Organization => ACCOUNT.to_vec(), + Self::Account => ACCOUNT.to_vec(), Self::Recon => RECON.to_vec(), } } + + fn get_descriptions_for_groups( + entity_type: EntityType, + groups: Vec, + ) -> HashMap { + Self::iter() + .filter_map(|parent| { + let scopes = groups + .iter() + .filter(|group| group.parent() == parent) + .map(|group| group.scope()) + .max()?; + + let resources = parent + .resources() + .iter() + .filter(|res| res.entities().iter().any(|entity| entity <= &entity_type)) + .map(|res| permissions::get_resource_name(res, &entity_type)) + .collect::>() + .join(", "); + + Some(( + parent, + format!("{} {}", permissions::get_scope_name(&scopes), resources), + )) + }) + .collect() + } } pub static OPERATIONS: [Resource; 8] = [ @@ -105,11 +154,10 @@ pub static OPERATIONS: [Resource; 8] = [ pub static CONNECTORS: [Resource; 2] = [Resource::Connector, Resource::Account]; -pub static WORKFLOWS: [Resource; 5] = [ +pub static WORKFLOWS: [Resource; 4] = [ Resource::Routing, Resource::ThreeDsDecisionManager, Resource::SurchargeDecisionManager, - Resource::Connector, Resource::Account, ]; diff --git a/crates/router/src/services/authorization/permissions.rs b/crates/router/src/services/authorization/permissions.rs index 0521db7acc15..6e472d55623b 100644 --- a/crates/router/src/services/authorization/permissions.rs +++ b/crates/router/src/services/authorization/permissions.rs @@ -73,3 +73,34 @@ generate_permissions! { }, ] } + +pub fn get_resource_name(resource: &Resource, entity_type: &EntityType) -> &'static str { + match (resource, entity_type) { + (Resource::Payment, _) => "Payments", + (Resource::Refund, _) => "Refunds", + (Resource::Dispute, _) => "Disputes", + (Resource::Mandate, _) => "Mandates", + (Resource::Customer, _) => "Customers", + (Resource::Payout, _) => "Payouts", + (Resource::ApiKey, _) => "Api Keys", + (Resource::Connector, _) => "Payment Processors, Payout Processors, Fraud & Risk Managers", + (Resource::Routing, _) => "Routing", + (Resource::ThreeDsDecisionManager, _) => "3DS Decision Manager", + (Resource::SurchargeDecisionManager, _) => "Surcharge Decision Manager", + (Resource::Analytics, _) => "Analytics", + (Resource::Report, _) => "Operation Reports", + (Resource::User, _) => "Users", + (Resource::WebhookEvent, _) => "Webhook Events", + (Resource::Recon, _) => "Reconciliation Reports", + (Resource::Account, EntityType::Profile) => "Business Profile Account", + (Resource::Account, EntityType::Merchant) => "Merchant Account", + (Resource::Account, EntityType::Organization) => "Organization Account", + } +} + +pub fn get_scope_name(scope: &PermissionScope) -> &'static str { + match scope { + PermissionScope::Read => "View", + PermissionScope::Write => "View and Manage", + } +} diff --git a/crates/router/src/services/authorization/roles/predefined_roles.rs b/crates/router/src/services/authorization/roles/predefined_roles.rs index 33a1d5f53ca7..39f6d47f824b 100644 --- a/crates/router/src/services/authorization/roles/predefined_roles.rs +++ b/crates/router/src/services/authorization/roles/predefined_roles.rs @@ -24,7 +24,9 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::UsersView, PermissionGroup::UsersManage, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, PermissionGroup::MerchantDetailsManage, + PermissionGroup::AccountManage, PermissionGroup::OrganizationManage, PermissionGroup::ReconOps, ], @@ -48,6 +50,7 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::AnalyticsView, PermissionGroup::UsersView, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, ], role_id: common_utils::consts::ROLE_ID_INTERNAL_VIEW_ONLY_USER.to_string(), role_name: "internal_view_only".to_string(), @@ -75,7 +78,9 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::UsersView, PermissionGroup::UsersManage, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, PermissionGroup::MerchantDetailsManage, + PermissionGroup::AccountManage, PermissionGroup::OrganizationManage, PermissionGroup::ReconOps, ], @@ -105,7 +110,9 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::UsersView, PermissionGroup::UsersManage, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, PermissionGroup::MerchantDetailsManage, + PermissionGroup::AccountManage, PermissionGroup::ReconOps, ], role_id: consts::user_role::ROLE_ID_MERCHANT_ADMIN.to_string(), @@ -128,6 +135,7 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::AnalyticsView, PermissionGroup::UsersView, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, ], role_id: consts::user_role::ROLE_ID_MERCHANT_VIEW_ONLY.to_string(), role_name: "merchant_view_only".to_string(), @@ -148,6 +156,7 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::UsersView, PermissionGroup::UsersManage, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, ], role_id: consts::user_role::ROLE_ID_MERCHANT_IAM_ADMIN.to_string(), role_name: "merchant_iam".to_string(), @@ -168,7 +177,9 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::AnalyticsView, PermissionGroup::UsersView, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, PermissionGroup::MerchantDetailsManage, + PermissionGroup::AccountManage, ], role_id: consts::user_role::ROLE_ID_MERCHANT_DEVELOPER.to_string(), role_name: "merchant_developer".to_string(), @@ -191,6 +202,7 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::AnalyticsView, PermissionGroup::UsersView, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, ], role_id: consts::user_role::ROLE_ID_MERCHANT_OPERATOR.to_string(), role_name: "merchant_operator".to_string(), @@ -210,6 +222,7 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::AnalyticsView, PermissionGroup::UsersView, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, ], role_id: consts::user_role::ROLE_ID_MERCHANT_CUSTOMER_SUPPORT.to_string(), role_name: "customer_support".to_string(), @@ -237,7 +250,9 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::UsersView, PermissionGroup::UsersManage, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, PermissionGroup::MerchantDetailsManage, + PermissionGroup::AccountManage, ], role_id: consts::user_role::ROLE_ID_PROFILE_ADMIN.to_string(), role_name: "profile_admin".to_string(), @@ -259,6 +274,7 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::AnalyticsView, PermissionGroup::UsersView, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, ], role_id: consts::user_role::ROLE_ID_PROFILE_VIEW_ONLY.to_string(), role_name: "profile_view_only".to_string(), @@ -279,6 +295,7 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::UsersView, PermissionGroup::UsersManage, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, ], role_id: consts::user_role::ROLE_ID_PROFILE_IAM_ADMIN.to_string(), role_name: "profile_iam".to_string(), @@ -299,7 +316,9 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::AnalyticsView, PermissionGroup::UsersView, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, PermissionGroup::MerchantDetailsManage, + PermissionGroup::AccountManage, ], role_id: consts::user_role::ROLE_ID_PROFILE_DEVELOPER.to_string(), role_name: "profile_developer".to_string(), @@ -322,6 +341,7 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::AnalyticsView, PermissionGroup::UsersView, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, ], role_id: consts::user_role::ROLE_ID_PROFILE_OPERATOR.to_string(), role_name: "profile_operator".to_string(), @@ -341,6 +361,7 @@ pub static PREDEFINED_ROLES: Lazy> = Lazy::new(| PermissionGroup::AnalyticsView, PermissionGroup::UsersView, PermissionGroup::MerchantDetailsView, + PermissionGroup::AccountView, ], role_id: consts::user_role::ROLE_ID_PROFILE_CUSTOMER_SUPPORT.to_string(), role_name: "profile_customer_support".to_string(), diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs index 8d853ded338c..652ce2b81dbc 100644 --- a/crates/router_env/src/logger/types.rs +++ b/crates/router_env/src/logger/types.rs @@ -374,6 +374,8 @@ pub enum Flow { GetAuthorizationInfo, /// Get Roles info GetRolesInfo, + /// Get Parent Group Info + GetParentGroupInfo, /// List roles v2 ListRolesV2, /// List invitable roles at entity level @@ -382,8 +384,12 @@ pub enum Flow { ListUpdatableRolesAtEntityLevel, /// Get role GetRole, + /// Get parent info for role + GetRoleV2, /// Get role from token GetRoleFromToken, + /// Get resources and groups for role from token + GetRoleFromTokenV2, /// Update user role UpdateUserRole, /// Create merchant account for user in a org From bb246e27b72e9e4168c89b94e8d07d63a544b586 Mon Sep 17 00:00:00 2001 From: chikke srujan <121822803+srujanchikke@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:58:58 +0530 Subject: [PATCH 5/9] refactor(connnector): Structure connector enums in separate files for improved team ownership (#6459) Co-authored-by: Chikke Srujan Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com> --- .github/CODEOWNERS | 4 + crates/api_models/src/connector_enums.rs | 297 + crates/api_models/src/enums.rs | 298 +- crates/api_models/src/lib.rs | 1 + crates/common_enums/src/connector_enums.rs | 126 + crates/common_enums/src/enums.rs | 128 +- crates/common_enums/src/lib.rs | 1 + crates/router/src/configs/defaults.rs | 12562 +--------------- .../payment_connector_required_fields.rs | 12562 ++++++++++++++++ scripts/add_connector.sh | 10 +- 10 files changed, 13002 insertions(+), 12987 deletions(-) create mode 100644 crates/api_models/src/connector_enums.rs create mode 100644 crates/common_enums/src/connector_enums.rs create mode 100644 crates/router/src/configs/defaults/payment_connector_required_fields.rs diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3f7911188413..dc4010d0fd0c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -45,6 +45,10 @@ crates/test_utils/tests/connectors/ @juspay/hyperswitch-connector crates/test_utils/tests/sample_auth.toml @juspay/hyperswitch-connector crates/connector_configs/ @juspay/hyperswitch-connector crates/hyperswitch_connectors/ @juspay/hyperswitch-connector +crates/api_models/src/connector_enums.rs @juspay/hyperswitch-connector +crates/common_enums/src/connector_enums.rs @juspay/hyperswitch-connector +crates/router/src/configs/defaults/payment_connector_required_fields.rs @juspay/hyperswitch-connector +crates/hyperswitch_interfaces/src/configs.rs @juspay/hyperswitch-connector crates/router/src/compatibility/ @juspay/hyperswitch-compatibility diff --git a/crates/api_models/src/connector_enums.rs b/crates/api_models/src/connector_enums.rs new file mode 100644 index 000000000000..5803800f4df0 --- /dev/null +++ b/crates/api_models/src/connector_enums.rs @@ -0,0 +1,297 @@ +pub use common_enums::enums::{PaymentMethod, PayoutType}; +#[cfg(feature = "dummy_connector")] +use common_utils::errors; +use utoipa::ToSchema; + +/// A connector is an integration to fulfill payments +#[derive( + Clone, + Copy, + Debug, + Eq, + PartialEq, + ToSchema, + serde::Deserialize, + serde::Serialize, + strum::VariantNames, + strum::EnumIter, + strum::Display, + strum::EnumString, + Hash, +)] +#[serde(rename_all = "snake_case")] +#[strum(serialize_all = "snake_case")] +pub enum Connector { + Adyenplatform, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "phonypay")] + #[strum(serialize = "phonypay")] + DummyConnector1, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "fauxpay")] + #[strum(serialize = "fauxpay")] + DummyConnector2, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "pretendpay")] + #[strum(serialize = "pretendpay")] + DummyConnector3, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "stripe_test")] + #[strum(serialize = "stripe_test")] + DummyConnector4, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "adyen_test")] + #[strum(serialize = "adyen_test")] + DummyConnector5, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "checkout_test")] + #[strum(serialize = "checkout_test")] + DummyConnector6, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "paypal_test")] + #[strum(serialize = "paypal_test")] + DummyConnector7, + Aci, + Adyen, + Airwallex, + Authorizedotnet, + Bambora, + Bamboraapac, + Bankofamerica, + Billwerk, + Bitpay, + Bluesnap, + Boku, + Braintree, + Cashtocode, + Checkout, + Coinbase, + Cryptopay, + Cybersource, + Datatrans, + Deutschebank, + // Digitalvirgo, template code for future usage + Dlocal, + Ebanx, + Fiserv, + Fiservemea, + Fiuu, + Forte, + Globalpay, + Globepay, + Gocardless, + Gpayments, + Helcim, + Iatapay, + Itaubank, + Klarna, + Mifinity, + Mollie, + Multisafepay, + Netcetera, + Nexinets, + Nexixpay, + Nmi, + Noon, + Novalnet, + Nuvei, + // Opayo, added as template code for future usage + Opennode, + Paybox, + // Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage + Payme, + Payone, + Paypal, + Payu, + Placetopay, + Powertranz, + Prophetpay, + Rapyd, + Razorpay, + Shift4, + Square, + Stax, + Stripe, + Taxjar, + Threedsecureio, + //Thunes, + Trustpay, + Tsys, + Volt, + Wellsfargo, + // Wellsfargopayout, + Wise, + Worldline, + Worldpay, + Signifyd, + Plaid, + Riskified, + Zen, + Zsl, +} + +impl Connector { + #[cfg(feature = "payouts")] + pub fn supports_instant_payout(&self, payout_method: Option) -> bool { + matches!( + (self, payout_method), + (Self::Paypal, Some(PayoutType::Wallet)) + | (_, Some(PayoutType::Card)) + | (Self::Adyenplatform, _) + ) + } + #[cfg(feature = "payouts")] + pub fn supports_create_recipient(&self, payout_method: Option) -> bool { + matches!((self, payout_method), (_, Some(PayoutType::Bank))) + } + #[cfg(feature = "payouts")] + pub fn supports_payout_eligibility(&self, payout_method: Option) -> bool { + matches!((self, payout_method), (_, Some(PayoutType::Card))) + } + #[cfg(feature = "payouts")] + pub fn is_payout_quote_call_required(&self) -> bool { + matches!(self, Self::Wise) + } + #[cfg(feature = "payouts")] + pub fn supports_access_token_for_payout(&self, payout_method: Option) -> bool { + matches!((self, payout_method), (Self::Paypal, _)) + } + #[cfg(feature = "payouts")] + pub fn supports_vendor_disburse_account_create_for_payout(&self) -> bool { + matches!(self, Self::Stripe) + } + pub fn supports_access_token(&self, payment_method: PaymentMethod) -> bool { + matches!( + (self, payment_method), + (Self::Airwallex, _) + | (Self::Deutschebank, _) + | (Self::Globalpay, _) + | (Self::Paypal, _) + | (Self::Payu, _) + | (Self::Trustpay, PaymentMethod::BankRedirect) + | (Self::Iatapay, _) + | (Self::Volt, _) + | (Self::Itaubank, _) + ) + } + pub fn supports_file_storage_module(&self) -> bool { + matches!(self, Self::Stripe | Self::Checkout) + } + pub fn requires_defend_dispute(&self) -> bool { + matches!(self, Self::Checkout) + } + pub fn is_separate_authentication_supported(&self) -> bool { + match self { + #[cfg(feature = "dummy_connector")] + Self::DummyConnector1 + | Self::DummyConnector2 + | Self::DummyConnector3 + | Self::DummyConnector4 + | Self::DummyConnector5 + | Self::DummyConnector6 + | Self::DummyConnector7 => false, + Self::Aci + // Add Separate authentication support for connectors + | Self::Adyen + | Self::Adyenplatform + | Self::Airwallex + | Self::Authorizedotnet + | Self::Bambora + | Self::Bamboraapac + | Self::Bankofamerica + | Self::Billwerk + | Self::Bitpay + | Self::Bluesnap + | Self::Boku + | Self::Braintree + | Self::Cashtocode + | Self::Coinbase + | Self::Cryptopay + | Self::Deutschebank + | Self::Dlocal + | Self::Ebanx + | Self::Fiserv + | Self::Fiservemea + | Self::Fiuu + | Self::Forte + | Self::Globalpay + | Self::Globepay + | Self::Gocardless + | Self::Gpayments + | Self::Helcim + | Self::Iatapay + | Self::Itaubank + | Self::Klarna + | Self::Mifinity + | Self::Mollie + | Self::Multisafepay + | Self::Nexinets + | Self::Nexixpay + | Self::Novalnet + | Self::Nuvei + | Self::Opennode + | Self::Paybox + | Self::Payme + | Self::Payone + | Self::Paypal + | Self::Payu + | Self::Placetopay + | Self::Powertranz + | Self::Prophetpay + | Self::Rapyd + | Self::Shift4 + | Self::Square + | Self::Stax + | Self::Taxjar + // | Self::Thunes + | Self::Trustpay + | Self::Tsys + | Self::Volt + | Self::Wellsfargo + // | Self::Wellsfargopayout + | Self::Wise + | Self::Worldline + | Self::Worldpay + | Self::Zen + | Self::Zsl + | Self::Signifyd + | Self::Plaid + | Self::Razorpay + | Self::Riskified + | Self::Threedsecureio + | Self::Datatrans + | Self::Netcetera + | Self::Noon + | Self::Stripe => false, + Self::Checkout | Self::Nmi | Self::Cybersource => true, + } + } + pub fn is_pre_processing_required_before_authorize(&self) -> bool { + matches!(self, Self::Airwallex) + } + #[cfg(feature = "dummy_connector")] + pub fn validate_dummy_connector_enabled( + &self, + is_dummy_connector_enabled: bool, + ) -> errors::CustomResult<(), errors::ValidationError> { + if !is_dummy_connector_enabled + && matches!( + self, + Self::DummyConnector1 + | Self::DummyConnector2 + | Self::DummyConnector3 + | Self::DummyConnector4 + | Self::DummyConnector5 + | Self::DummyConnector6 + | Self::DummyConnector7 + ) + { + Err(errors::ValidationError::InvalidValue { + message: "Invalid connector name".to_string(), + } + .into()) + } else { + Ok(()) + } + } +} diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs index 48939e430595..e2b2b7fde46f 100644 --- a/crates/api_models/src/enums.rs +++ b/crates/api_models/src/enums.rs @@ -1,10 +1,10 @@ use std::str::FromStr; pub use common_enums::*; -#[cfg(feature = "dummy_connector")] -use common_utils::errors; use utoipa::ToSchema; +pub use super::connector_enums::Connector; + #[derive( Clone, Copy, @@ -27,300 +27,6 @@ pub enum RoutingAlgorithm { Custom, } -/// A connector is an integration to fulfill payments -#[derive( - Clone, - Copy, - Debug, - Eq, - PartialEq, - ToSchema, - serde::Deserialize, - serde::Serialize, - strum::VariantNames, - strum::EnumIter, - strum::Display, - strum::EnumString, - Hash, -)] -#[serde(rename_all = "snake_case")] -#[strum(serialize_all = "snake_case")] -pub enum Connector { - Adyenplatform, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "phonypay")] - #[strum(serialize = "phonypay")] - DummyConnector1, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "fauxpay")] - #[strum(serialize = "fauxpay")] - DummyConnector2, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "pretendpay")] - #[strum(serialize = "pretendpay")] - DummyConnector3, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "stripe_test")] - #[strum(serialize = "stripe_test")] - DummyConnector4, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "adyen_test")] - #[strum(serialize = "adyen_test")] - DummyConnector5, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "checkout_test")] - #[strum(serialize = "checkout_test")] - DummyConnector6, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "paypal_test")] - #[strum(serialize = "paypal_test")] - DummyConnector7, - Aci, - Adyen, - Airwallex, - Authorizedotnet, - Bambora, - Bamboraapac, - Bankofamerica, - Billwerk, - Bitpay, - Bluesnap, - Boku, - Braintree, - Cashtocode, - Checkout, - Coinbase, - Cryptopay, - Cybersource, - Datatrans, - Deutschebank, - // Digitalvirgo, template code for future usage - Dlocal, - Ebanx, - Fiserv, - Fiservemea, - Fiuu, - Forte, - Globalpay, - Globepay, - Gocardless, - Gpayments, - Helcim, - Iatapay, - Itaubank, - Klarna, - Mifinity, - Mollie, - Multisafepay, - Netcetera, - Nexinets, - Nexixpay, - Nmi, - Noon, - Novalnet, - Nuvei, - // Opayo, added as template code for future usage - Opennode, - Paybox, - // Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage - Payme, - Payone, - Paypal, - Payu, - Placetopay, - Powertranz, - Prophetpay, - Rapyd, - Razorpay, - Shift4, - Square, - Stax, - Stripe, - Taxjar, - Threedsecureio, - //Thunes, - Trustpay, - Tsys, - Volt, - Wellsfargo, - // Wellsfargopayout, - Wise, - Worldline, - Worldpay, - Signifyd, - Plaid, - Riskified, - Zen, - Zsl, -} - -impl Connector { - #[cfg(feature = "payouts")] - pub fn supports_instant_payout(&self, payout_method: Option) -> bool { - matches!( - (self, payout_method), - (Self::Paypal, Some(PayoutType::Wallet)) - | (_, Some(PayoutType::Card)) - | (Self::Adyenplatform, _) - ) - } - #[cfg(feature = "payouts")] - pub fn supports_create_recipient(&self, payout_method: Option) -> bool { - matches!((self, payout_method), (_, Some(PayoutType::Bank))) - } - #[cfg(feature = "payouts")] - pub fn supports_payout_eligibility(&self, payout_method: Option) -> bool { - matches!((self, payout_method), (_, Some(PayoutType::Card))) - } - #[cfg(feature = "payouts")] - pub fn is_payout_quote_call_required(&self) -> bool { - matches!(self, Self::Wise) - } - #[cfg(feature = "payouts")] - pub fn supports_access_token_for_payout(&self, payout_method: Option) -> bool { - matches!((self, payout_method), (Self::Paypal, _)) - } - #[cfg(feature = "payouts")] - pub fn supports_vendor_disburse_account_create_for_payout(&self) -> bool { - matches!(self, Self::Stripe) - } - pub fn supports_access_token(&self, payment_method: PaymentMethod) -> bool { - matches!( - (self, payment_method), - (Self::Airwallex, _) - | (Self::Deutschebank, _) - | (Self::Globalpay, _) - | (Self::Paypal, _) - | (Self::Payu, _) - | (Self::Trustpay, PaymentMethod::BankRedirect) - | (Self::Iatapay, _) - | (Self::Volt, _) - | (Self::Itaubank, _) - ) - } - pub fn supports_file_storage_module(&self) -> bool { - matches!(self, Self::Stripe | Self::Checkout) - } - pub fn requires_defend_dispute(&self) -> bool { - matches!(self, Self::Checkout) - } - pub fn is_separate_authentication_supported(&self) -> bool { - match self { - #[cfg(feature = "dummy_connector")] - Self::DummyConnector1 - | Self::DummyConnector2 - | Self::DummyConnector3 - | Self::DummyConnector4 - | Self::DummyConnector5 - | Self::DummyConnector6 - | Self::DummyConnector7 => false, - Self::Aci - // Add Separate authentication support for connectors - // | Self::Fiuu - | Self::Adyen - | Self::Adyenplatform - | Self::Airwallex - | Self::Authorizedotnet - | Self::Bambora - | Self::Bamboraapac - | Self::Bankofamerica - | Self::Billwerk - | Self::Bitpay - | Self::Bluesnap - | Self::Boku - | Self::Braintree - | Self::Cashtocode - | Self::Coinbase - | Self::Cryptopay - | Self::Deutschebank - | Self::Dlocal - | Self::Ebanx - | Self::Fiserv - | Self::Fiservemea - | Self::Fiuu - | Self::Forte - | Self::Globalpay - | Self::Globepay - | Self::Gocardless - | Self::Gpayments - | Self::Helcim - | Self::Iatapay - | Self::Itaubank - | Self::Klarna - | Self::Mifinity - | Self::Mollie - | Self::Multisafepay - | Self::Nexinets - | Self::Nexixpay - | Self::Novalnet - | Self::Nuvei - | Self::Opennode - | Self::Paybox - | Self::Payme - | Self::Payone - | Self::Paypal - | Self::Payu - | Self::Placetopay - | Self::Powertranz - | Self::Prophetpay - | Self::Rapyd - | Self::Shift4 - | Self::Square - | Self::Stax - | Self::Taxjar - //| Self::Thunes - | Self::Trustpay - | Self::Tsys - | Self::Volt - | Self::Wellsfargo - // | Self::Wellsfargopayout - | Self::Wise - | Self::Worldline - | Self::Worldpay - | Self::Zen - | Self::Zsl - | Self::Signifyd - | Self::Plaid - | Self::Razorpay - | Self::Riskified - | Self::Threedsecureio - | Self::Datatrans - | Self::Netcetera - | Self::Noon - | Self::Stripe => false, - Self::Checkout | Self::Nmi | Self::Cybersource => true, - } - } - pub fn is_pre_processing_required_before_authorize(&self) -> bool { - matches!(self, Self::Airwallex) - } - #[cfg(feature = "dummy_connector")] - pub fn validate_dummy_connector_enabled( - &self, - is_dummy_connector_enabled: bool, - ) -> errors::CustomResult<(), errors::ValidationError> { - if !is_dummy_connector_enabled - && matches!( - self, - Self::DummyConnector1 - | Self::DummyConnector2 - | Self::DummyConnector3 - | Self::DummyConnector4 - | Self::DummyConnector5 - | Self::DummyConnector6 - | Self::DummyConnector7 - ) - { - Err(errors::ValidationError::InvalidValue { - message: "Invalid connector name".to_string(), - } - .into()) - } else { - Ok(()) - } - } -} - #[cfg(feature = "payouts")] #[derive( Clone, diff --git a/crates/api_models/src/lib.rs b/crates/api_models/src/lib.rs index daa329a76317..a28332e7fea0 100644 --- a/crates/api_models/src/lib.rs +++ b/crates/api_models/src/lib.rs @@ -5,6 +5,7 @@ pub mod apple_pay_certificates_migration; pub mod blocklist; pub mod cards_info; pub mod conditional_configs; +pub mod connector_enums; pub mod connector_onboarding; pub mod consts; pub mod currency; diff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rs new file mode 100644 index 000000000000..a5f6d0fe356c --- /dev/null +++ b/crates/common_enums/src/connector_enums.rs @@ -0,0 +1,126 @@ +use utoipa::ToSchema; +#[derive( + Clone, + Copy, + Debug, + Eq, + Hash, + PartialEq, + serde::Serialize, + serde::Deserialize, + strum::Display, + strum::EnumString, + strum::EnumIter, + strum::VariantNames, + ToSchema, +)] +#[router_derive::diesel_enum(storage_type = "db_enum")] +#[serde(rename_all = "snake_case")] +#[strum(serialize_all = "snake_case")] +/// Connectors eligible for payments routing +pub enum RoutableConnectors { + Adyenplatform, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "phonypay")] + #[strum(serialize = "phonypay")] + DummyConnector1, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "fauxpay")] + #[strum(serialize = "fauxpay")] + DummyConnector2, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "pretendpay")] + #[strum(serialize = "pretendpay")] + DummyConnector3, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "stripe_test")] + #[strum(serialize = "stripe_test")] + DummyConnector4, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "adyen_test")] + #[strum(serialize = "adyen_test")] + DummyConnector5, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "checkout_test")] + #[strum(serialize = "checkout_test")] + DummyConnector6, + #[cfg(feature = "dummy_connector")] + #[serde(rename = "paypal_test")] + #[strum(serialize = "paypal_test")] + DummyConnector7, + Aci, + Adyen, + Airwallex, + Authorizedotnet, + Bankofamerica, + Billwerk, + Bitpay, + Bambora, + Bamboraapac, + Bluesnap, + Boku, + Braintree, + Cashtocode, + Checkout, + Coinbase, + Cryptopay, + Cybersource, + Datatrans, + Deutschebank, + // Digitalvirgo, template code for future usage + Dlocal, + Ebanx, + Fiserv, + Fiservemea, + Fiuu, + Forte, + Globalpay, + Globepay, + Gocardless, + Helcim, + Iatapay, + Itaubank, + Klarna, + Mifinity, + Mollie, + Multisafepay, + Nexinets, + Nexixpay, + Nmi, + Noon, + Novalnet, + Nuvei, + // Opayo, added as template code for future usage + Opennode, + // Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage + Paybox, + Payme, + Payone, + Paypal, + Payu, + Placetopay, + Powertranz, + Prophetpay, + Rapyd, + Razorpay, + Riskified, + Shift4, + Signifyd, + Square, + Stax, + Stripe, + // Taxjar, + Trustpay, + // Thunes + // Tsys, + Tsys, + Volt, + Wellsfargo, + // Wellsfargopayout, + Wise, + Worldline, + Worldpay, + Zen, + Plaid, + Zsl, +} diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index faae71eda223..917030c1e80e 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -3,6 +3,8 @@ use std::num::{ParseFloatError, TryFromIntError}; use serde::{Deserialize, Serialize}; use utoipa::ToSchema; +pub use super::connector_enums::RoutableConnectors; + #[doc(hidden)] pub mod diesel_exports { pub use super::{ @@ -140,132 +142,6 @@ pub enum AttemptStatus { DeviceDataCollectionPending, } -#[derive( - Clone, - Copy, - Debug, - Eq, - Hash, - PartialEq, - serde::Serialize, - serde::Deserialize, - strum::Display, - strum::EnumString, - strum::EnumIter, - strum::VariantNames, - ToSchema, -)] -#[router_derive::diesel_enum(storage_type = "db_enum")] -#[serde(rename_all = "snake_case")] -#[strum(serialize_all = "snake_case")] -/// Connectors eligible for payments routing -pub enum RoutableConnectors { - Adyenplatform, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "phonypay")] - #[strum(serialize = "phonypay")] - DummyConnector1, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "fauxpay")] - #[strum(serialize = "fauxpay")] - DummyConnector2, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "pretendpay")] - #[strum(serialize = "pretendpay")] - DummyConnector3, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "stripe_test")] - #[strum(serialize = "stripe_test")] - DummyConnector4, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "adyen_test")] - #[strum(serialize = "adyen_test")] - DummyConnector5, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "checkout_test")] - #[strum(serialize = "checkout_test")] - DummyConnector6, - #[cfg(feature = "dummy_connector")] - #[serde(rename = "paypal_test")] - #[strum(serialize = "paypal_test")] - DummyConnector7, - Aci, - Adyen, - Airwallex, - Authorizedotnet, - Bankofamerica, - Billwerk, - Bitpay, - Bambora, - Bamboraapac, - Bluesnap, - Boku, - Braintree, - Cashtocode, - Checkout, - Coinbase, - Cryptopay, - Cybersource, - Datatrans, - Deutschebank, - // Digitalvirgo, template code for future usage - Dlocal, - Ebanx, - Fiserv, - Fiservemea, - Fiuu, - Forte, - Globalpay, - Globepay, - Gocardless, - Helcim, - Iatapay, - Itaubank, - Klarna, - Mifinity, - Mollie, - Multisafepay, - Nexinets, - Nexixpay, - Nmi, - Noon, - Novalnet, - Nuvei, - // Opayo, added as template code for future usage - Opennode, - // Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage - Paybox, - Payme, - Payone, - Paypal, - Payu, - Placetopay, - Powertranz, - Prophetpay, - Rapyd, - Razorpay, - Riskified, - Shift4, - Signifyd, - Square, - Stax, - Stripe, - // Taxjar, - Trustpay, - // Thunes - // Tsys, - Tsys, - Volt, - Wellsfargo, - // Wellsfargopayout, - Wise, - Worldline, - Worldpay, - Zen, - Plaid, - Zsl, -} - impl AttemptStatus { pub fn is_terminal_status(self) -> bool { match self { diff --git a/crates/common_enums/src/lib.rs b/crates/common_enums/src/lib.rs index 14966d15b5f5..ec5b78d4a508 100644 --- a/crates/common_enums/src/lib.rs +++ b/crates/common_enums/src/lib.rs @@ -1,3 +1,4 @@ +pub mod connector_enums; pub mod enums; pub mod transformers; diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index c48d2fe54caa..74f6502159da 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -2,11 +2,11 @@ use std::collections::{HashMap, HashSet}; use api_models::{enums, payment_methods::RequiredFieldInfo}; -use super::settings::{ConnectorFields, PaymentMethodType, RequiredFieldFinal}; - #[cfg(feature = "payouts")] pub mod payout_required_fields; +pub mod payment_connector_required_fields; + impl Default for super::settings::Server { fn default() -> Self { Self { @@ -138,12564 +138,6 @@ impl Default for super::settings::KvConfig { } } -use super::settings::{ - Mandates, SupportedConnectorsForMandate, SupportedPaymentMethodTypesForMandate, - SupportedPaymentMethodsForMandate, -}; - -impl Default for Mandates { - fn default() -> Self { - Self { - supported_payment_methods: SupportedPaymentMethodsForMandate(HashMap::from([ - ( - enums::PaymentMethod::PayLater, - SupportedPaymentMethodTypesForMandate(HashMap::from([( - enums::PaymentMethodType::Klarna, - SupportedConnectorsForMandate { - connector_list: HashSet::from([enums::Connector::Adyen]), - }, - )])), - ), - ( - enums::PaymentMethod::Wallet, - SupportedPaymentMethodTypesForMandate(HashMap::from([ - ( - enums::PaymentMethodType::GooglePay, - SupportedConnectorsForMandate { - connector_list: HashSet::from([ - enums::Connector::Stripe, - enums::Connector::Adyen, - enums::Connector::Globalpay, - enums::Connector::Multisafepay, - enums::Connector::Bankofamerica, - enums::Connector::Noon, - enums::Connector::Cybersource, - enums::Connector::Wellsfargo, - ]), - }, - ), - ( - enums::PaymentMethodType::ApplePay, - SupportedConnectorsForMandate { - connector_list: HashSet::from([ - enums::Connector::Stripe, - enums::Connector::Adyen, - enums::Connector::Bankofamerica, - enums::Connector::Cybersource, - enums::Connector::Wellsfargo, - ]), - }, - ), - ])), - ), - ( - enums::PaymentMethod::Card, - SupportedPaymentMethodTypesForMandate(HashMap::from([ - ( - enums::PaymentMethodType::Credit, - SupportedConnectorsForMandate { - connector_list: HashSet::from([ - enums::Connector::Aci, - enums::Connector::Adyen, - enums::Connector::Authorizedotnet, - enums::Connector::Globalpay, - enums::Connector::Worldpay, - enums::Connector::Multisafepay, - enums::Connector::Nexinets, - enums::Connector::Noon, - enums::Connector::Payme, - enums::Connector::Stripe, - enums::Connector::Bankofamerica, - enums::Connector::Cybersource, - enums::Connector::Wellsfargo, - ]), - }, - ), - ( - enums::PaymentMethodType::Debit, - SupportedConnectorsForMandate { - connector_list: HashSet::from([ - enums::Connector::Aci, - enums::Connector::Adyen, - enums::Connector::Authorizedotnet, - enums::Connector::Globalpay, - enums::Connector::Worldpay, - enums::Connector::Multisafepay, - enums::Connector::Nexinets, - enums::Connector::Noon, - enums::Connector::Payme, - enums::Connector::Stripe, - ]), - }, - ), - ])), - ), - ])), - update_mandate_supported: SupportedPaymentMethodsForMandate(HashMap::default()), - } - } -} - -impl Default for super::settings::RequiredFields { - fn default() -> Self { - Self(HashMap::from([ - ( - enums::PaymentMethod::Card, - PaymentMethodType(HashMap::from([ - ( - enums::PaymentMethodType::Debit, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Aci, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - } - ), - ( - enums::Connector::Airwallex, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Fiuu, - RequiredFieldFinal { - 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, - } - ) - ]), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Authorizedotnet, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Bambora, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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::Connector::Bankofamerica, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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, - } - ), - ( - "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![ - "ALL".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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Billwerk, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Bluesnap, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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::Connector::Boku, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Braintree, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Checkout, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Coinbase, - 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, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Cybersource, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common:HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Dlocal, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ] - ), - common:HashMap::new(), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector1, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector2, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector3, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector4, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector5, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector6, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector7, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Fiserv, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Fiuu, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Forte, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common:HashMap::new(), - } - ), - ( - enums::Connector::Globalpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from([ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ]), - } - ), - ( - enums::Connector::Helcim, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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.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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Iatapay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Mollie, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Multisafepay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate:HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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, - } - ), - ( - "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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Nexinets, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Nmi, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "billing.address.zip".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.address.zip".to_string(), - display_name: "billing_zip".to_string(), - field_type: enums::FieldType::UserAddressPincode, - value: None, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Noon, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - } - ), - ( - enums::Connector::Novalnet, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "browser_info.language".to_string(), - RequiredFieldInfo { - required_field: "browser_info.language".to_string(), - display_name: "browser_info_language".to_string(), - field_type: enums::FieldType::BrowserLanguage, - value: None, - } - ), - ( - "browser_info.ip_address".to_string(), - RequiredFieldInfo { - required_field: "browser_info.ip_address".to_string(), - display_name: "browser_info_ip_address".to_string(), - field_type: enums::FieldType::BrowserIp, - 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: "line1".to_string(), - field_type: enums::FieldType::UserAddressLine2, - 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.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.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.email".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.email".to_string(), - display_name: "email_address".to_string(), - field_type: enums::FieldType::UserEmailAddress, - value: None, - } - ), - ] - ), - } - ), - ( - enums::Connector::Nuvei, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Paybox, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "email".to_string(), - display_name: "email".to_string(), - field_type: enums::FieldType::UserEmailAddress, - value: None, - } - ), - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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.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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - - ] - ), - } - ), - ( - enums::Connector::Payme, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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, - } - ), - ] - ), - } - ), - ( - enums::Connector::Paypal, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Payu, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Powertranz, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Rapyd, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Shift4, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Square, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Stax, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common:HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Trustpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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.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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ), - ] - ), - common: HashMap::new() - } - ), - ( - enums::Connector::Tsys, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new() - } - ), - ( - enums::Connector::Wellsfargo, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common:HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Worldline, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - 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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Worldpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Zen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "email".to_string(), - display_name: "email".to_string(), - field_type: enums::FieldType::UserEmailAddress, - value: None, - } - ), - ]), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::Credit, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Aci, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - } - ), - ( - enums::Connector::Airwallex, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Fiuu, - RequiredFieldFinal { - 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, - } - ) - ]), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Authorizedotnet, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Bambora, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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::Connector::Bankofamerica, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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, - } - ), - ( - "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![ - "ALL".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, - } - ), - ] - ), - } - ), - ( - enums::Connector::Billwerk, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Bluesnap, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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::Connector::Boku, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Braintree, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Checkout, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Coinbase, - 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, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Cybersource, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate:HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Dlocal, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ] - ), - common:HashMap::new(), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector1, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector2, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector3, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector4, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector5, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector6, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - #[cfg(feature = "dummy_connector")] - ( - enums::Connector::DummyConnector7, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Fiserv, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Fiuu, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Forte, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common:HashMap::new(), - } - ), - ( - enums::Connector::Globalpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from([ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ]), - } - ), - ( - enums::Connector::Helcim, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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.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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Iatapay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Mollie, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Multisafepay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate:HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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, - } - ), - ( - "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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Nexinets, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Nexixpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - 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: "line1".to_string(), - field_type: enums::FieldType::UserAddressLine2, - 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.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.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, - } - ) - ] - ), - } - ), - ( - enums::Connector::Nmi, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "billing.address.zip".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.address.zip".to_string(), - display_name: "billing_zip".to_string(), - field_type: enums::FieldType::UserAddressPincode, - value: None, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Noon, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - } - ), - ( - enums::Connector::Novalnet, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "browser_info.language".to_string(), - RequiredFieldInfo { - required_field: "browser_info.language".to_string(), - display_name: "browser_info_language".to_string(), - field_type: enums::FieldType::BrowserLanguage, - value: None, - } - ), - ( - "browser_info.ip_address".to_string(), - RequiredFieldInfo { - required_field: "browser_info.ip_address".to_string(), - display_name: "browser_info_ip_address".to_string(), - field_type: enums::FieldType::BrowserIp, - 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: "line1".to_string(), - field_type: enums::FieldType::UserAddressLine2, - 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.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.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.email".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.email".to_string(), - display_name: "email_address".to_string(), - field_type: enums::FieldType::UserEmailAddress, - value: None, - } - ), - ] - ), - } - ), - ( - enums::Connector::Nuvei, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ),( - enums::Connector::Paybox, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "email".to_string(), - display_name: "email".to_string(), - field_type: enums::FieldType::UserEmailAddress, - value: None, - } - ), - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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.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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - - ] - ), - } - ), - ( - enums::Connector::Payme, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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, - } - ), - ] - ), - } - ), - ( - enums::Connector::Paypal, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Payu, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Powertranz, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Rapyd, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Shift4, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Square, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Stax, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common:HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Trustpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "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.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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ), - ] - ), - common: HashMap::new() - } - ), - ( - enums::Connector::Tsys, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - value: None, - } - ) - ] - ), - common: HashMap::new() - } - ), - ( - enums::Connector::Wellsfargo, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate:HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - 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, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ] - ), - } - ), - ( - enums::Connector::Worldline, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "payment_method_data.card.card_cvc".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_cvc".to_string(), - display_name: "card_cvc".to_string(), - field_type: enums::FieldType::UserCardCvc, - 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![ - "ALL".to_string(), - ] - }, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Worldpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Zen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "payment_method_data.card.card_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_number".to_string(), - display_name: "card_number".to_string(), - field_type: enums::FieldType::UserCardNumber, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_month".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_month".to_string(), - display_name: "card_exp_month".to_string(), - field_type: enums::FieldType::UserCardExpiryMonth, - value: None, - } - ), - ( - "payment_method_data.card.card_exp_year".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.card.card_exp_year".to_string(), - display_name: "card_exp_year".to_string(), - field_type: enums::FieldType::UserCardExpiryYear, - value: None, - } - ), - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "email".to_string(), - display_name: "email".to_string(), - field_type: enums::FieldType::UserEmailAddress, - value: None, - } - ), - ]), - common: HashMap::new(), - } - ), - ]), - }, - ), - - ])), - ), - ( - enums::PaymentMethod::BankRedirect, - PaymentMethodType(HashMap::from([ - ( - enums::PaymentMethodType::OpenBankingUk, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Volt, - 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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - value: None, - } - ), - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap:: from([ - ( - "payment_method_data.bank_redirect.open_banking_uk.issuer".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.open_banking_uk.issuer".to_string(), - display_name: "issuer".to_string(), - field_type: enums::FieldType::UserBank, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ) - ]), - }, - ), - ( - 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 { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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::BancontactCard, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Mollie, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Stripe, - RequiredFieldFinal { - 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, - } - ) - ]), - 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: "billing_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: "billing_name".to_string(), - field_type: enums::FieldType::UserFullName, - value: None, - } - ), - ]), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from([ - ( - "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, - } - ), - ( - "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, - } - ), - ]), - } - ) - ]), - }, - ), - ( - enums::PaymentMethodType::Giropay, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Aci, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: 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::UserCountry { - options: vec![ - "DE".to_string(), - ]}, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Globalpay, - 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![ - "DE".to_string(), - ] - }, - value: None, - } - ) - ]), - } - ), - ( - enums::Connector::Mollie, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Nuvei, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate:HashMap::from([ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "DE".to_string(), - ] - }, - value: None, - } - )] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Paypal, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: 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::UserCountry { - options: vec![ - "DE".to_string(), - ] - }, - value: None, - } - ), - ( - "billing.address.first_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.address.first_name".to_string(), - display_name: "billing_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: "billing_name".to_string(), - field_type: enums::FieldType::UserBillingName, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Stripe, - 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: "billing_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: "billing_name".to_string(), - field_type: enums::FieldType::UserBillingName, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Shift4, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Trustpay, - 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: "billing_first_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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.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.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![ - "DE".to_string(), - ] - }, - value: None, - } - ), - ]), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::Ideal, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Aci, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "payment_method_data.bank_redirect.ideal.bank_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.ideal.bank_name".to_string(), - display_name: "bank_name".to_string(), - field_type: enums::FieldType::UserBank, - 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::UserCountry { - options: vec![ - "NL".to_string(), - ] - }, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from([ - ( - "payment_method_data.bank_redirect.ideal.bank_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.ideal.bank_name".to_string(), - display_name: "bank_name".to_string(), - field_type: enums::FieldType::UserBank, - value: None, - } - ), - - ]), - } - ), - ( - enums::Connector::Globalpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Mollie, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Nexinets, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Nuvei, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "NL".to_string(), - ] - }, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Shift4, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: 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::UserCountry{ - options: vec![ - "NL".to_string(), - ] - }, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Paypal, - 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: "billing_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: "billing_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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::UserCountry{ - options: vec![ - "NL".to_string(), - ] - }, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::from([ - ( - "billing.address.first_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.address.first_name".to_string(), - display_name: "billing_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: "billing_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: "billing_email".to_string(), - field_type: enums::FieldType::UserEmailAddress, - value: None, - } - ) - ]), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Trustpay, - 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: "billing_first_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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.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.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![ - "NL".to_string(), - ] - }, - value: None, - } - ), - ]), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::Sofort, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Aci, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: 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::UserCountry { - options: vec![ - "ES".to_string(), - "GB".to_string(), - "SE".to_string(), - "AT".to_string(), - "NL".to_string(), - "DE".to_string(), - "CH".to_string(), - "BE".to_string(), - "FR".to_string(), - "FI".to_string(), - "IT".to_string(), - "PL".to_string(), - ] - }, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Globalpay, - 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![ - "AT".to_string(), - "BE".to_string(), - "DE".to_string(), - "ES".to_string(), - "IT".to_string(), - "NL".to_string(), - ] - }, - value: None, - } - ) - ]), - } - ), - ( - enums::Connector::Mollie, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Nexinets, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Nuvei, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate:HashMap::from([ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "ES".to_string(), - "GB".to_string(), - "IT".to_string(), - "DE".to_string(), - "FR".to_string(), - "AT".to_string(), - "BE".to_string(), - "NL".to_string(), - "BE".to_string(), - "SK".to_string(), - ] - }, - value: None, - } - )] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Paypal, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: 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::UserCountry { - options: vec![ - "ES".to_string(), - "GB".to_string(), - "AT".to_string(), - "NL".to_string(), - "DE".to_string(), - "BE".to_string(), - ] - }, - value: None, - } - ), - ( - "billing.address.first_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.address.first_name".to_string(), - display_name: "billing_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: "billing_name".to_string(), - field_type: enums::FieldType::UserBillingName, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Shift4, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Stripe, - RequiredFieldFinal { - 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, - } - ) - ]), - 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::UserCountry { - options: vec![ - "ES".to_string(), - "AT".to_string(), - "NL".to_string(), - "DE".to_string(), - "BE".to_string(), - ] - }, - value: None, - } - ), - ( - "billing.address.first_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.address.first_name".to_string(), - display_name: "account_holder_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: "account_holder_name".to_string(), - field_type: enums::FieldType::UserBillingName, - value: None, - } - )]), - } - ), - ( - enums::Connector::Trustpay, - 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: "billing_first_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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.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.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![ - "ES".to_string(), - "GB".to_string(), - "SE".to_string(), - "AT".to_string(), - "NL".to_string(), - "DE".to_string(), - "CH".to_string(), - "BE".to_string(), - "FR".to_string(), - "FI".to_string(), - "IT".to_string(), - "PL".to_string(), - ] - }, - value: None, - } - ), - ]), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::Eps, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from([ - ( - "payment_method_data.bank_redirect.eps.bank_name".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.eps.bank_name".to_string(), - display_name: "bank_name".to_string(), - field_type: enums::FieldType::UserBank, - value: None, - } - ) - ]), - } - ), - ( - enums::Connector::Stripe, - 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: "billing_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: "billing_name".to_string(), - field_type: enums::FieldType::UserFullName, - value: None, - } - ), - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Aci, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "billing.address.country".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.address.country".to_string(), - display_name: "bank_account_country".to_string(), - field_type: enums::FieldType::UserCountry { - options: vec![ - "AT".to_string(), - ] - }, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Globalpay, - 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![ - "AT".to_string(), - ] - }, - value: None, - } - ) - ]) - } - ), - ( - enums::Connector::Mollie, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate:HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Paypal, - 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: "billing_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: "billing_name".to_string(), - field_type: enums::FieldType::UserFullName, - value: None, - } - ), - ( - "billing.address.country".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.address.country".to_string(), - display_name: "bank_account_country".to_string(), - field_type: enums::FieldType::UserCountry { - options: vec![ - "AT".to_string(), - ] - }, - value: None, - } - ) - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Trustpay, - 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: "billing_first_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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.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.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![ - "AT".to_string(), - ] - }, - value: None, - } - ), - ]), - common: HashMap::new(), - } - ), - ( - enums::Connector::Shift4, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate:HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Nuvei, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from([ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "AT".to_string(), - ] - }, - value: None, - } - )] - ), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::Blik, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from([ - ( - "payment_method_data.bank_redirect.blik.blik_code".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.blik.blik_code".to_string(), - display_name: "blik_code".to_string(), - field_type: enums::FieldType::UserBlikCode, - value: None, - } - ) - ]), - } - ), - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from([ - ( - "payment_method_data.bank_redirect.blik.blik_code".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_redirect.blik.blik_code".to_string(), - display_name: "blik_code".to_string(), - field_type: enums::FieldType::UserBlikCode, - value: None, - } - ) - ]), - } - ), - ( - enums::Connector::Trustpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from([ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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.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.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![ - "ALL".to_string(), - ] - }, - value: None, - } - ), - ]), - } - ) - ]), - }, - ), - ])), - ), - ( - enums::PaymentMethod::Wallet, - PaymentMethodType(HashMap::from([ - ( - enums::PaymentMethodType::ApplePay, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Bankofamerica, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "ALL".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, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Cybersource, - 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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "ALL".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, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Wellsfargo, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "ALL".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, - } - ), - ( - "shipping.address.first_name".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.first_name".to_string(), - display_name: "shipping_first_name".to_string(), - field_type: enums::FieldType::UserShippingName, - value: None, - } - ), - ( - "shipping.address.last_name".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.last_name".to_string(), - display_name: "shipping_last_name".to_string(), - field_type: enums::FieldType::UserShippingName, - 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.state".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.state".to_string(), - display_name: "state".to_string(), - field_type: enums::FieldType::UserShippingAddressState, - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - - ]), - }, - ), - ( - enums::PaymentMethodType::GooglePay, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Bankofamerica, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "ALL".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, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Bluesnap, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Noon, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Nuvei, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Airwallex, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Authorizedotnet, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Checkout, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Globalpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Multisafepay, - 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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "ALL".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::Cybersource, - 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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "ALL".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, - } - ) - ] - ), - common: HashMap::new(), - } - ), - ( - enums::Connector::Payu, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Rapyd, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Trustpay, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Wellsfargo, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::from( - [ - ( - "email".to_string(), - RequiredFieldInfo { - required_field: "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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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![ - "ALL".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, - } - ), - ( - "shipping.address.first_name".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.first_name".to_string(), - display_name: "shipping_first_name".to_string(), - field_type: enums::FieldType::UserShippingName, - value: None, - } - ), - ( - "shipping.address.last_name".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.last_name".to_string(), - display_name: "shipping_last_name".to_string(), - field_type: enums::FieldType::UserShippingName, - 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.state".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.state".to_string(), - display_name: "state".to_string(), - field_type: enums::FieldType::UserShippingAddressState, - 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, - } - ), - ] - ), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::WeChatPay, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::AliPay, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::AliPayHk, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::Cashapp, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::new(), - } - ) - ]), - }, - ), - ( - enums::PaymentMethodType::MbWay, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Adyen, - RequiredFieldFinal { - mandate: HashMap::new(), - 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::from( - [ - ( - "shipping.address.first_name".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.first_name".to_string(), - display_name: "shipping_first_name".to_string(), - field_type: enums::FieldType::UserShippingName, - value: None, - } - ), - ( - "shipping.address.last_name".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.last_name".to_string(), - display_name: "shipping_last_name".to_string(), - field_type: enums::FieldType::UserShippingName, - 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.state".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.state".to_string(), - display_name: "state".to_string(), - field_type: enums::FieldType::UserShippingAddressState, - 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, - } - ), - ] - ), - } - ), - ]), - }, - ), - ( - 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 { - required_field: "payment_method_data.wallet.mifinity.date_of_birth".to_string(), - display_name: "date_of_birth".to_string(), - field_type: enums::FieldType::UserDateOfBirth, - 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.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.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.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, - } - ), - ( - "billing.address.country".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.address.country".to_string(), - display_name: "nationality".to_string(), - field_type: enums::FieldType::UserCountry{ - options: vec![ - "BR".to_string(), - "CN".to_string(), - "SG".to_string(), - "MY".to_string(), - "DE".to_string(), - "CH".to_string(), - "DK".to_string(), - "GB".to_string(), - "ES".to_string(), - "AD".to_string(), - "GI".to_string(), - "FI".to_string(), - "FR".to_string(), - "GR".to_string(), - "HR".to_string(), - "IT".to_string(), - "JP".to_string(), - "MX".to_string(), - "AR".to_string(), - "CO".to_string(), - "CL".to_string(), - "PE".to_string(), - "VE".to_string(), - "UY".to_string(), - "PY".to_string(), - "BO".to_string(), - "EC".to_string(), - "GT".to_string(), - "HN".to_string(), - "SV".to_string(), - "NI".to_string(), - "CR".to_string(), - "PA".to_string(), - "DO".to_string(), - "CU".to_string(), - "PR".to_string(), - "NL".to_string(), - "NO".to_string(), - "PL".to_string(), - "PT".to_string(), - "SE".to_string(), - "RU".to_string(), - "TR".to_string(), - "TW".to_string(), - "HK".to_string(), - "MO".to_string(), - "AX".to_string(), - "AL".to_string(), - "DZ".to_string(), - "AS".to_string(), - "AO".to_string(), - "AI".to_string(), - "AG".to_string(), - "AM".to_string(), - "AW".to_string(), - "AU".to_string(), - "AT".to_string(), - "AZ".to_string(), - "BS".to_string(), - "BH".to_string(), - "BD".to_string(), - "BB".to_string(), - "BE".to_string(), - "BZ".to_string(), - "BJ".to_string(), - "BM".to_string(), - "BT".to_string(), - "BQ".to_string(), - "BA".to_string(), - "BW".to_string(), - "IO".to_string(), - "BN".to_string(), - "BG".to_string(), - "BF".to_string(), - "BI".to_string(), - "KH".to_string(), - "CM".to_string(), - "CA".to_string(), - "CV".to_string(), - "KY".to_string(), - "CF".to_string(), - "TD".to_string(), - "CX".to_string(), - "CC".to_string(), - "KM".to_string(), - "CG".to_string(), - "CK".to_string(), - "CI".to_string(), - "CW".to_string(), - "CY".to_string(), - "CZ".to_string(), - "DJ".to_string(), - "DM".to_string(), - "EG".to_string(), - "GQ".to_string(), - "ER".to_string(), - "EE".to_string(), - "ET".to_string(), - "FK".to_string(), - "FO".to_string(), - "FJ".to_string(), - "GF".to_string(), - "PF".to_string(), - "TF".to_string(), - "GA".to_string(), - "GM".to_string(), - "GE".to_string(), - "GH".to_string(), - "GL".to_string(), - "GD".to_string(), - "GP".to_string(), - "GU".to_string(), - "GG".to_string(), - "GN".to_string(), - "GW".to_string(), - "GY".to_string(), - "HT".to_string(), - "HM".to_string(), - "VA".to_string(), - "IS".to_string(), - "IN".to_string(), - "ID".to_string(), - "IE".to_string(), - "IM".to_string(), - "IL".to_string(), - "JE".to_string(), - "JO".to_string(), - "KZ".to_string(), - "KE".to_string(), - "KI".to_string(), - "KW".to_string(), - "KG".to_string(), - "LA".to_string(), - "LV".to_string(), - "LB".to_string(), - "LS".to_string(), - "LI".to_string(), - "LT".to_string(), - "LU".to_string(), - "MK".to_string(), - "MG".to_string(), - "MW".to_string(), - "MV".to_string(), - "ML".to_string(), - "MT".to_string(), - "MH".to_string(), - "MQ".to_string(), - "MR".to_string(), - "MU".to_string(), - "YT".to_string(), - "FM".to_string(), - "MD".to_string(), - "MC".to_string(), - "MN".to_string(), - "ME".to_string(), - "MS".to_string(), - "MA".to_string(), - "MZ".to_string(), - "NA".to_string(), - "NR".to_string(), - "NP".to_string(), - "NC".to_string(), - "NZ".to_string(), - "NE".to_string(), - "NG".to_string(), - "NU".to_string(), - "NF".to_string(), - "MP".to_string(), - "OM".to_string(), - "PK".to_string(), - "PW".to_string(), - "PS".to_string(), - "PG".to_string(), - "PH".to_string(), - "PN".to_string(), - "QA".to_string(), - "RE".to_string(), - "RO".to_string(), - "RW".to_string(), - "BL".to_string(), - "SH".to_string(), - "KN".to_string(), - "LC".to_string(), - "MF".to_string(), - "PM".to_string(), - "VC".to_string(), - "WS".to_string(), - "SM".to_string(), - "ST".to_string(), - "SA".to_string(), - "SN".to_string(), - "RS".to_string(), - "SC".to_string(), - "SL".to_string(), - "SX".to_string(), - "SK".to_string(), - "SI".to_string(), - "SB".to_string(), - "SO".to_string(), - "ZA".to_string(), - "GS".to_string(), - "KR".to_string(), - "LK".to_string(), - "SR".to_string(), - "SJ".to_string(), - "SZ".to_string(), - "TH".to_string(), - "TL".to_string(), - "TG".to_string(), - "TK".to_string(), - "TO".to_string(), - "TT".to_string(), - "TN".to_string(), - "TM".to_string(), - "TC".to_string(), - "TV".to_string(), - "UG".to_string(), - "UA".to_string(), - "AE".to_string(), - "UZ".to_string(), - "VU".to_string(), - "VN".to_string(), - "VG".to_string(), - "VI".to_string(), - "WF".to_string(), - "EH".to_string(), - "ZM".to_string(), - ] - }, - value: None, - } - - ), - ( - "billing.email".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.billing.email".to_string(), - display_name: "email_address".to_string(), - field_type: enums::FieldType::UserEmailAddress, - value: None, - } - ), - ( - "payment_method_data.wallet.mifinity.language_preference".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.wallet.mifinity.language_preference".to_string(), - display_name: "language_preference".to_string(), - field_type: enums::FieldType::LanguagePreference{ - options: vec![ - "BR".to_string(), - "PT_BR".to_string(), - "CN".to_string(), - "ZH_CN".to_string(), - "DE".to_string(), - "DK".to_string(), - "DA".to_string(), - "DA_DK".to_string(), - "EN".to_string(), - "ES".to_string(), - "FI".to_string(), - "FR".to_string(), - "GR".to_string(), - "EL".to_string(), - "EL_GR".to_string(), - "HR".to_string(), - "IT".to_string(), - "JP".to_string(), - "JA".to_string(), - "JA_JP".to_string(), - "LA".to_string(), - "ES_LA".to_string(), - "NL".to_string(), - "NO".to_string(), - "PL".to_string(), - "PT".to_string(), - "RU".to_string(), - "SV".to_string(), - "SE".to_string(), - "SV_SE".to_string(), - "ZH".to_string(), - "TW".to_string(), - "ZH_TW".to_string(), - ] - }, - value: None, - } - ), - ]), - } - ), - ]), - } - ), - ])), - ), - ( - enums::PaymentMethod::PayLater, - PaymentMethodType(HashMap::from([ - ( - enums::PaymentMethodType::AfterpayClearpay, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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.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.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![ - "GB".to_string(), - "AU".to_string(), - "CA".to_string(), - "US".to_string(), - "NZ".to_string(), - ] - }, - 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, - } - ), - ( - "shipping.address.first_name".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.first_name".to_string(), - display_name: "shipping_first_name".to_string(), - field_type: enums::FieldType::UserShippingName, - value: None, - } - ), - ( - "shipping.address.last_name".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.last_name".to_string(), - display_name: "shipping_last_name".to_string(), - field_type: enums::FieldType::UserShippingName, - 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.state".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.state".to_string(), - display_name: "state".to_string(), - field_type: enums::FieldType::UserShippingAddressState, - 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, - } - ), - ]), - common : HashMap::new(), - } - ), - ( - 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: "billing_first_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: "billing_last_name".to_string(), - field_type: enums::FieldType::UserBillingName, - 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, - } - ), - ( - "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.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![ - "GB".to_string(), - "AU".to_string(), - "CA".to_string(), - "US".to_string(), - "NZ".to_string(), - ] - }, - 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, - } - ), - ( - "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(), - } - ) - ]), - }, - ), - ( - enums::PaymentMethodType::Klarna, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate : HashMap::new(), - non_mandate: 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![ - "AU".to_string(), - "AT".to_string(), - "BE".to_string(), - "CA".to_string(), - "CZ".to_string(), - "DK".to_string(), - "FI".to_string(), - "FR".to_string(), - "GR".to_string(), - "DE".to_string(), - "IE".to_string(), - "IT".to_string(), - "NL".to_string(), - "NZ".to_string(), - "NO".to_string(), - "PL".to_string(), - "PT".to_string(), - "RO".to_string(), - "ES".to_string(), - "SE".to_string(), - "CH".to_string(), - "GB".to_string(), - "US".to_string(), - ] - }, - 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::Connector::Adyen, - RequiredFieldFinal { - 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.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::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(), - "FI".to_string(), - "FR".to_string(), - "DE".to_string(), - "GR".to_string(), - "IE".to_string(), - "IT".to_string(), - "NL".to_string(), - "NZ".to_string(), - "NO".to_string(), - "PL".to_string(), - "PT".to_string(), - "ES".to_string(), - "SE".to_string(), - "CH".to_string(), - "GB".to_string(), - "US".to_string(), - ] - }, - value: None, - } - ) - ]), - } - ) - ]), - }, - ), - ( - enums::PaymentMethodType::Affirm, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - 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, - } - ), - ( - "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, - } - ), - ( - "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.line1".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.line1".to_string(), - display_name: "line1".to_string(), - field_type: enums::FieldType::UserAddressLine1, - value: None, - } - ), - ( - "shipping.address.line2".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.line2".to_string(), - display_name: "line2".to_string(), - field_type: enums::FieldType::UserAddressLine2, - 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.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.country".to_string(), - RequiredFieldInfo { - required_field: "shipping.address.country".to_string(), - display_name: "country".to_string(), - field_type: enums::FieldType::UserCountry { - options: vec![ - "US".to_string(), - ]}, - value: None, - } - ), - - ] - ), - common: HashMap::new(), - } - ), - ]), - }, - ), - ( - enums::PaymentMethodType::PayBright, - 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![ - "CA".to_string(), - ] - }, - value: None, - } - ), - ( - "payment_method_data.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, - } - ), - ( - "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.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![ - "DK".to_string(), - "FI".to_string(), - "NO".to_string(), - "SE".to_string(), - ]}, - 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, - } - ), - ( - "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.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, - } - ), - ( - "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.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, - } - ), - ( - "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, - } - ), - ( - "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, - } - ) - ] - ), - 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, - } - ), - ( - "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, - } - ), - ] - ), - 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, - } - ), - ( - "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, - } - ), - ] - ), - 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, - } - ), - ( - "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, - } - ), - ] - ), - 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, - } - ), - ( - "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, - } - ), - ] - ), - 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, - } - ), - ( - "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.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, - } - ), - ] - ), - common : HashMap::new(), - } - ) - ]), - }, - ), - ])), - ), - ( - enums::PaymentMethod::Upi, - PaymentMethodType(HashMap::from([ - ( - enums::PaymentMethodType::UpiCollect, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Razorpay, - RequiredFieldFinal { - mandate : HashMap::new(), - non_mandate : HashMap::new(), - common : HashMap::from([ - ( - "payment_method_data.upi.upi_collect.vpa_id".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.upi.upi_collect.vpa_id".to_string(), - display_name: "vpa_id".to_string(), - field_type: enums::FieldType::UserVpaId, - value: None, - } - ), - ]), - } - ), - ]), - }, - ), - ])), - ), - ( - enums::PaymentMethod::BankDebit, - PaymentMethodType(HashMap::from([( - enums::PaymentMethodType::Ach, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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: "billing_first_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::UserBankAccountNumber, - 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, - } - ) - ]), - }), - ( - 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::UserBankAccountNumber, - 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, - } - ) - ]), - }) - ] - )} - ), - ( - enums::PaymentMethodType::Sepa, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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: "billing_first_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_bank_debit.iban".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_debit.sepa_bank_debit.iban".to_string(), - display_name: "iban".to_string(), - field_type: enums::FieldType::UserIban, - 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, - } - ) - ]), - } - ), - ( - 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_bank_debit.iban".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_debit.sepa_bank_debit.iban".to_string(), - display_name: "iban".to_string(), - field_type: enums::FieldType::UserIban, - value: None, - } - ) - ]), - } - ), - ( - enums::Connector::Deutschebank, - 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, - } - ), - ( - "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, - } - ), - ( - "payment_method_data.bank_debit.sepa_bank_debit.iban".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_debit.sepa_bank_debit.iban".to_string(), - display_name: "iban".to_string(), - field_type: enums::FieldType::UserIban, - value: None, - } - ) - ]), - } - ) - ]), - }, - ), - ( - enums::PaymentMethodType::Bacs, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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: "billing_first_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::UserBankAccountNumber, - 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, - } - ), - ( - "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!["UK".to_string()], - }, - 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.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, - }, - ) - ]), - } - ), - ( - 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::UserBankAccountNumber, - 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, - } - ) - ]), - }) - ]), - }, - ), - ( - enums::PaymentMethodType::Becs, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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: "billing_first_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.becs.account_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_debit.becs.account_number".to_string(), - display_name: "bank_account_number".to_string(), - field_type: enums::FieldType::UserBankAccountNumber, - value: None, - } - ), - ( - "payment_method_data.bank_debit.becs.bsb_number".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_debit.becs.bsb_number".to_string(), - display_name: "bsb_number".to_string(), - field_type: enums::FieldType::Text, - 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, - } - ) - ]), - } - ), - ( - 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::UserBankAccountNumber, - 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, - } - ) - ]), - }) - ]), - }, - ), - ]))), - ( - enums::PaymentMethod::BankTransfer, - PaymentMethodType(HashMap::from([( - enums::PaymentMethodType::Multibanco, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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::LocalBankTransfer, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Zsl, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: 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![ - "CN".to_string(), - ] - }, - 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, - }, - ), - ]), - common: HashMap::new(), - } - ), - ])}), - (enums::PaymentMethodType::Ach, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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::PaymentMethodType::Pix, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Itaubank, - RequiredFieldFinal { - mandate: HashMap::new(), - non_mandate: HashMap::new(), - common: HashMap::from( - [ - ( - "payment_method_data.bank_transfer.pix.pix_key".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_transfer.pix.pix_key".to_string(), - display_name: "pix_key".to_string(), - field_type: enums::FieldType::UserPixKey, - value: None, - } - ), - ( - "payment_method_data.bank_transfer.pix.cnpj".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_transfer.pix.cnpj".to_string(), - display_name: "cnpj".to_string(), - field_type: enums::FieldType::UserCnpj, - value: None, - } - ), - ( - "payment_method_data.bank_transfer.pix.cpf".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.bank_transfer.pix.cpf".to_string(), - display_name: "cpf".to_string(), - field_type: enums::FieldType::UserCpf, - 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, - } - ), - ] - ), - } - ), - ( - 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::PaymentMethodType::Sepa, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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, - } - ), - ( - "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.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![ - "BE".to_string(), - "DE".to_string(), - "ES".to_string(), - "FR".to_string(), - "IE".to_string(), - "NL".to_string(), - ], - }, - value: None, - }, - ), - ]), - } - ) - ]), - }, - ), - ( - enums::PaymentMethodType::Bacs, - ConnectorFields { - fields: HashMap::from([ - ( - enums::Connector::Stripe, - 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, - } - ), - ( - "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, - } - ) - ]), - } - ) - ]), - }, - ), - ]))), - ( - 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.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, - } - ), - ( - "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.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, - } - ), - ( - "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(), - } - ), - ]), - }, - ) - ])) - ) - ])) - } -} - #[allow(clippy::derivable_impls)] impl Default for super::settings::ApiKeys { fn default() -> Self { diff --git a/crates/router/src/configs/defaults/payment_connector_required_fields.rs b/crates/router/src/configs/defaults/payment_connector_required_fields.rs new file mode 100644 index 000000000000..28ddeec1fcd3 --- /dev/null +++ b/crates/router/src/configs/defaults/payment_connector_required_fields.rs @@ -0,0 +1,12562 @@ +use std::collections::{HashMap, HashSet}; + +use api_models::{enums, payment_methods::RequiredFieldInfo}; + +use crate::settings::{ + self, ConnectorFields, Mandates, PaymentMethodType, RequiredFieldFinal, + SupportedConnectorsForMandate, SupportedPaymentMethodTypesForMandate, + SupportedPaymentMethodsForMandate, +}; + +impl Default for Mandates { + fn default() -> Self { + Self { + supported_payment_methods: SupportedPaymentMethodsForMandate(HashMap::from([ + ( + enums::PaymentMethod::PayLater, + SupportedPaymentMethodTypesForMandate(HashMap::from([( + enums::PaymentMethodType::Klarna, + SupportedConnectorsForMandate { + connector_list: HashSet::from([enums::Connector::Adyen]), + }, + )])), + ), + ( + enums::PaymentMethod::Wallet, + SupportedPaymentMethodTypesForMandate(HashMap::from([ + ( + enums::PaymentMethodType::GooglePay, + SupportedConnectorsForMandate { + connector_list: HashSet::from([ + enums::Connector::Stripe, + enums::Connector::Adyen, + enums::Connector::Globalpay, + enums::Connector::Multisafepay, + enums::Connector::Bankofamerica, + enums::Connector::Noon, + enums::Connector::Cybersource, + enums::Connector::Wellsfargo, + ]), + }, + ), + ( + enums::PaymentMethodType::ApplePay, + SupportedConnectorsForMandate { + connector_list: HashSet::from([ + enums::Connector::Stripe, + enums::Connector::Adyen, + enums::Connector::Bankofamerica, + enums::Connector::Cybersource, + enums::Connector::Wellsfargo, + ]), + }, + ), + ])), + ), + ( + enums::PaymentMethod::Card, + SupportedPaymentMethodTypesForMandate(HashMap::from([ + ( + enums::PaymentMethodType::Credit, + SupportedConnectorsForMandate { + connector_list: HashSet::from([ + enums::Connector::Aci, + enums::Connector::Adyen, + enums::Connector::Authorizedotnet, + enums::Connector::Globalpay, + enums::Connector::Worldpay, + enums::Connector::Multisafepay, + enums::Connector::Nexinets, + enums::Connector::Noon, + enums::Connector::Payme, + enums::Connector::Stripe, + enums::Connector::Bankofamerica, + enums::Connector::Cybersource, + enums::Connector::Wellsfargo, + ]), + }, + ), + ( + enums::PaymentMethodType::Debit, + SupportedConnectorsForMandate { + connector_list: HashSet::from([ + enums::Connector::Aci, + enums::Connector::Adyen, + enums::Connector::Authorizedotnet, + enums::Connector::Globalpay, + enums::Connector::Worldpay, + enums::Connector::Multisafepay, + enums::Connector::Nexinets, + enums::Connector::Noon, + enums::Connector::Payme, + enums::Connector::Stripe, + ]), + }, + ), + ])), + ), + ])), + update_mandate_supported: SupportedPaymentMethodsForMandate(HashMap::default()), + } + } +} + +impl Default for settings::RequiredFields { + fn default() -> Self { + Self(HashMap::from([ + ( + enums::PaymentMethod::Card, + PaymentMethodType(HashMap::from([ + ( + enums::PaymentMethodType::Debit, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Aci, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + } + ), + ( + enums::Connector::Airwallex, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Fiuu, + RequiredFieldFinal { + 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, + } + ) + ]), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Authorizedotnet, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Bambora, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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::Connector::Bankofamerica, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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, + } + ), + ( + "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![ + "ALL".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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Billwerk, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Bluesnap, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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::Connector::Boku, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Braintree, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Checkout, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Coinbase, + 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, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Cybersource, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common:HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Dlocal, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ] + ), + common:HashMap::new(), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector1, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector2, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector3, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector4, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector5, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector6, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector7, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Fiserv, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Fiuu, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Forte, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common:HashMap::new(), + } + ), + ( + enums::Connector::Globalpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from([ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ]), + } + ), + ( + enums::Connector::Helcim, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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.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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Iatapay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Mollie, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Multisafepay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate:HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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, + } + ), + ( + "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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Nexinets, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Nmi, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "billing.address.zip".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.zip".to_string(), + display_name: "billing_zip".to_string(), + field_type: enums::FieldType::UserAddressPincode, + value: None, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Noon, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + } + ), + ( + enums::Connector::Novalnet, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "browser_info.language".to_string(), + RequiredFieldInfo { + required_field: "browser_info.language".to_string(), + display_name: "browser_info_language".to_string(), + field_type: enums::FieldType::BrowserLanguage, + value: None, + } + ), + ( + "browser_info.ip_address".to_string(), + RequiredFieldInfo { + required_field: "browser_info.ip_address".to_string(), + display_name: "browser_info_ip_address".to_string(), + field_type: enums::FieldType::BrowserIp, + 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: "line1".to_string(), + field_type: enums::FieldType::UserAddressLine2, + 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.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.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.email".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.email".to_string(), + display_name: "email_address".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ] + ), + } + ), + ( + enums::Connector::Nuvei, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Paybox, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "email".to_string(), + display_name: "email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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.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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + + ] + ), + } + ), + ( + enums::Connector::Payme, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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, + } + ), + ] + ), + } + ), + ( + enums::Connector::Paypal, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Payu, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Powertranz, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Rapyd, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Shift4, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Square, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Stax, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common:HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Trustpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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.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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ), + ] + ), + common: HashMap::new() + } + ), + ( + enums::Connector::Tsys, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new() + } + ), + ( + enums::Connector::Wellsfargo, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common:HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Worldline, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + 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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Worldpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Zen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "email".to_string(), + display_name: "email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ]), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::Credit, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Aci, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + } + ), + ( + enums::Connector::Airwallex, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Fiuu, + RequiredFieldFinal { + 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, + } + ) + ]), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Authorizedotnet, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Bambora, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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::Connector::Bankofamerica, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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, + } + ), + ( + "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![ + "ALL".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, + } + ), + ] + ), + } + ), + ( + enums::Connector::Billwerk, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Bluesnap, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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::Connector::Boku, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Braintree, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Checkout, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Coinbase, + 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, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Cybersource, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate:HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Dlocal, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ] + ), + common:HashMap::new(), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector1, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector2, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector3, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector4, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector5, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector6, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + #[cfg(feature = "dummy_connector")] + ( + enums::Connector::DummyConnector7, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Fiserv, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Fiuu, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Forte, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common:HashMap::new(), + } + ), + ( + enums::Connector::Globalpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from([ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ]), + } + ), + ( + enums::Connector::Helcim, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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.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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Iatapay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Mollie, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Multisafepay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate:HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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, + } + ), + ( + "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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Nexinets, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Nexixpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + 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: "line1".to_string(), + field_type: enums::FieldType::UserAddressLine2, + 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.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.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, + } + ) + ] + ), + } + ), + ( + enums::Connector::Nmi, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "billing.address.zip".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.zip".to_string(), + display_name: "billing_zip".to_string(), + field_type: enums::FieldType::UserAddressPincode, + value: None, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Noon, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + } + ), + ( + enums::Connector::Novalnet, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "browser_info.language".to_string(), + RequiredFieldInfo { + required_field: "browser_info.language".to_string(), + display_name: "browser_info_language".to_string(), + field_type: enums::FieldType::BrowserLanguage, + value: None, + } + ), + ( + "browser_info.ip_address".to_string(), + RequiredFieldInfo { + required_field: "browser_info.ip_address".to_string(), + display_name: "browser_info_ip_address".to_string(), + field_type: enums::FieldType::BrowserIp, + 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: "line1".to_string(), + field_type: enums::FieldType::UserAddressLine2, + 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.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.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.email".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.email".to_string(), + display_name: "email_address".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ] + ), + } + ), + ( + enums::Connector::Nuvei, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ),( + enums::Connector::Paybox, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "email".to_string(), + display_name: "email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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.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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + + ] + ), + } + ), + ( + enums::Connector::Payme, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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, + } + ), + ] + ), + } + ), + ( + enums::Connector::Paypal, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Payu, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Powertranz, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Rapyd, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Shift4, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Square, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Stax, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common:HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Trustpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "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.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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ), + ] + ), + common: HashMap::new() + } + ), + ( + enums::Connector::Tsys, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + value: None, + } + ) + ] + ), + common: HashMap::new() + } + ), + ( + enums::Connector::Wellsfargo, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate:HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + 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, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ] + ), + } + ), + ( + enums::Connector::Worldline, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.card.card_cvc".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_cvc".to_string(), + display_name: "card_cvc".to_string(), + field_type: enums::FieldType::UserCardCvc, + 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![ + "ALL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Worldpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Zen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "email".to_string(), + display_name: "email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ]), + common: HashMap::new(), + } + ), + ]), + }, + ), + + ])), + ), + ( + enums::PaymentMethod::BankRedirect, + PaymentMethodType(HashMap::from([ + ( + enums::PaymentMethodType::OpenBankingUk, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Volt, + 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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ), + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap:: from([ + ( + "payment_method_data.bank_redirect.open_banking_uk.issuer".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.open_banking_uk.issuer".to_string(), + display_name: "issuer".to_string(), + field_type: enums::FieldType::UserBank, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ) + ]), + }, + ), + ( + 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 { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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::BancontactCard, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Mollie, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Stripe, + RequiredFieldFinal { + 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, + } + ) + ]), + 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: "billing_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: "billing_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), + ]), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from([ + ( + "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, + } + ), + ( + "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, + } + ), + ]), + } + ) + ]), + }, + ), + ( + enums::PaymentMethodType::Giropay, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Aci, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: 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::UserCountry { + options: vec![ + "DE".to_string(), + ]}, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Globalpay, + 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![ + "DE".to_string(), + ] + }, + value: None, + } + ) + ]), + } + ), + ( + enums::Connector::Mollie, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Nuvei, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate:HashMap::from([ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "DE".to_string(), + ] + }, + value: None, + } + )] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Paypal, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: 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::UserCountry { + options: vec![ + "DE".to_string(), + ] + }, + value: None, + } + ), + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "billing_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: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Stripe, + 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: "billing_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: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Shift4, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Trustpay, + 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: "billing_first_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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.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.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![ + "DE".to_string(), + ] + }, + value: None, + } + ), + ]), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::Ideal, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Aci, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.bank_redirect.ideal.bank_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.bank_name".to_string(), + display_name: "bank_name".to_string(), + field_type: enums::FieldType::UserBank, + 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::UserCountry { + options: vec![ + "NL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from([ + ( + "payment_method_data.bank_redirect.ideal.bank_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.ideal.bank_name".to_string(), + display_name: "bank_name".to_string(), + field_type: enums::FieldType::UserBank, + value: None, + } + ), + + ]), + } + ), + ( + enums::Connector::Globalpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Mollie, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Nexinets, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Nuvei, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "NL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Shift4, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: 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::UserCountry{ + options: vec![ + "NL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Paypal, + 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: "billing_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: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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::UserCountry{ + options: vec![ + "NL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::from([ + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "billing_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: "billing_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: "billing_email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ) + ]), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Trustpay, + 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: "billing_first_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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.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.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![ + "NL".to_string(), + ] + }, + value: None, + } + ), + ]), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::Sofort, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Aci, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: 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::UserCountry { + options: vec![ + "ES".to_string(), + "GB".to_string(), + "SE".to_string(), + "AT".to_string(), + "NL".to_string(), + "DE".to_string(), + "CH".to_string(), + "BE".to_string(), + "FR".to_string(), + "FI".to_string(), + "IT".to_string(), + "PL".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Globalpay, + 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![ + "AT".to_string(), + "BE".to_string(), + "DE".to_string(), + "ES".to_string(), + "IT".to_string(), + "NL".to_string(), + ] + }, + value: None, + } + ) + ]), + } + ), + ( + enums::Connector::Mollie, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Nexinets, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Nuvei, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate:HashMap::from([ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "ES".to_string(), + "GB".to_string(), + "IT".to_string(), + "DE".to_string(), + "FR".to_string(), + "AT".to_string(), + "BE".to_string(), + "NL".to_string(), + "BE".to_string(), + "SK".to_string(), + ] + }, + value: None, + } + )] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Paypal, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: 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::UserCountry { + options: vec![ + "ES".to_string(), + "GB".to_string(), + "AT".to_string(), + "NL".to_string(), + "DE".to_string(), + "BE".to_string(), + ] + }, + value: None, + } + ), + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "billing_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: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Shift4, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Stripe, + RequiredFieldFinal { + 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, + } + ) + ]), + 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::UserCountry { + options: vec![ + "ES".to_string(), + "AT".to_string(), + "NL".to_string(), + "DE".to_string(), + "BE".to_string(), + ] + }, + value: None, + } + ), + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "account_holder_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: "account_holder_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + )]), + } + ), + ( + enums::Connector::Trustpay, + 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: "billing_first_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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.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.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![ + "ES".to_string(), + "GB".to_string(), + "SE".to_string(), + "AT".to_string(), + "NL".to_string(), + "DE".to_string(), + "CH".to_string(), + "BE".to_string(), + "FR".to_string(), + "FI".to_string(), + "IT".to_string(), + "PL".to_string(), + ] + }, + value: None, + } + ), + ]), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::Eps, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from([ + ( + "payment_method_data.bank_redirect.eps.bank_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.eps.bank_name".to_string(), + display_name: "bank_name".to_string(), + field_type: enums::FieldType::UserBank, + value: None, + } + ) + ]), + } + ), + ( + enums::Connector::Stripe, + 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: "billing_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: "billing_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Aci, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "billing.address.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.country".to_string(), + display_name: "bank_account_country".to_string(), + field_type: enums::FieldType::UserCountry { + options: vec![ + "AT".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Globalpay, + 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![ + "AT".to_string(), + ] + }, + value: None, + } + ) + ]) + } + ), + ( + enums::Connector::Mollie, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate:HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Paypal, + 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: "billing_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: "billing_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), + ( + "billing.address.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.country".to_string(), + display_name: "bank_account_country".to_string(), + field_type: enums::FieldType::UserCountry { + options: vec![ + "AT".to_string(), + ] + }, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Trustpay, + 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: "billing_first_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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.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.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![ + "AT".to_string(), + ] + }, + value: None, + } + ), + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Shift4, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate:HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Nuvei, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "AT".to_string(), + ] + }, + value: None, + } + )] + ), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::Blik, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from([ + ( + "payment_method_data.bank_redirect.blik.blik_code".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.blik.blik_code".to_string(), + display_name: "blik_code".to_string(), + field_type: enums::FieldType::UserBlikCode, + value: None, + } + ) + ]), + } + ), + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from([ + ( + "payment_method_data.bank_redirect.blik.blik_code".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.blik.blik_code".to_string(), + display_name: "blik_code".to_string(), + field_type: enums::FieldType::UserBlikCode, + value: None, + } + ) + ]), + } + ), + ( + enums::Connector::Trustpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from([ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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.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.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![ + "ALL".to_string(), + ] + }, + value: None, + } + ), + ]), + } + ) + ]), + }, + ), + ])), + ), + ( + enums::PaymentMethod::Wallet, + PaymentMethodType(HashMap::from([ + ( + enums::PaymentMethodType::ApplePay, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Bankofamerica, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "ALL".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, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Cybersource, + 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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "ALL".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, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Wellsfargo, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "ALL".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, + } + ), + ( + "shipping.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.first_name".to_string(), + display_name: "shipping_first_name".to_string(), + field_type: enums::FieldType::UserShippingName, + value: None, + } + ), + ( + "shipping.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.last_name".to_string(), + display_name: "shipping_last_name".to_string(), + field_type: enums::FieldType::UserShippingName, + 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.state".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.state".to_string(), + display_name: "state".to_string(), + field_type: enums::FieldType::UserShippingAddressState, + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + + ]), + }, + ), + ( + enums::PaymentMethodType::GooglePay, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Bankofamerica, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "ALL".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, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Bluesnap, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Noon, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Nuvei, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Airwallex, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Authorizedotnet, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Checkout, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Globalpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Multisafepay, + 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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "ALL".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::Cybersource, + 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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "ALL".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, + } + ) + ] + ), + common: HashMap::new(), + } + ), + ( + enums::Connector::Payu, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Rapyd, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Trustpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Wellsfargo, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from( + [ + ( + "email".to_string(), + RequiredFieldInfo { + required_field: "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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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![ + "ALL".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, + } + ), + ( + "shipping.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.first_name".to_string(), + display_name: "shipping_first_name".to_string(), + field_type: enums::FieldType::UserShippingName, + value: None, + } + ), + ( + "shipping.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.last_name".to_string(), + display_name: "shipping_last_name".to_string(), + field_type: enums::FieldType::UserShippingName, + 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.state".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.state".to_string(), + display_name: "state".to_string(), + field_type: enums::FieldType::UserShippingAddressState, + 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, + } + ), + ] + ), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::WeChatPay, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::AliPay, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::AliPayHk, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::Cashapp, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::new(), + } + ) + ]), + }, + ), + ( + enums::PaymentMethodType::MbWay, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + 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::from( + [ + ( + "shipping.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.first_name".to_string(), + display_name: "shipping_first_name".to_string(), + field_type: enums::FieldType::UserShippingName, + value: None, + } + ), + ( + "shipping.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.last_name".to_string(), + display_name: "shipping_last_name".to_string(), + field_type: enums::FieldType::UserShippingName, + 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.state".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.state".to_string(), + display_name: "state".to_string(), + field_type: enums::FieldType::UserShippingAddressState, + 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, + } + ), + ] + ), + } + ), + ]), + }, + ), + ( + 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 { + required_field: "payment_method_data.wallet.mifinity.date_of_birth".to_string(), + display_name: "date_of_birth".to_string(), + field_type: enums::FieldType::UserDateOfBirth, + 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.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.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.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, + } + ), + ( + "billing.address.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.country".to_string(), + display_name: "nationality".to_string(), + field_type: enums::FieldType::UserCountry{ + options: vec![ + "BR".to_string(), + "CN".to_string(), + "SG".to_string(), + "MY".to_string(), + "DE".to_string(), + "CH".to_string(), + "DK".to_string(), + "GB".to_string(), + "ES".to_string(), + "AD".to_string(), + "GI".to_string(), + "FI".to_string(), + "FR".to_string(), + "GR".to_string(), + "HR".to_string(), + "IT".to_string(), + "JP".to_string(), + "MX".to_string(), + "AR".to_string(), + "CO".to_string(), + "CL".to_string(), + "PE".to_string(), + "VE".to_string(), + "UY".to_string(), + "PY".to_string(), + "BO".to_string(), + "EC".to_string(), + "GT".to_string(), + "HN".to_string(), + "SV".to_string(), + "NI".to_string(), + "CR".to_string(), + "PA".to_string(), + "DO".to_string(), + "CU".to_string(), + "PR".to_string(), + "NL".to_string(), + "NO".to_string(), + "PL".to_string(), + "PT".to_string(), + "SE".to_string(), + "RU".to_string(), + "TR".to_string(), + "TW".to_string(), + "HK".to_string(), + "MO".to_string(), + "AX".to_string(), + "AL".to_string(), + "DZ".to_string(), + "AS".to_string(), + "AO".to_string(), + "AI".to_string(), + "AG".to_string(), + "AM".to_string(), + "AW".to_string(), + "AU".to_string(), + "AT".to_string(), + "AZ".to_string(), + "BS".to_string(), + "BH".to_string(), + "BD".to_string(), + "BB".to_string(), + "BE".to_string(), + "BZ".to_string(), + "BJ".to_string(), + "BM".to_string(), + "BT".to_string(), + "BQ".to_string(), + "BA".to_string(), + "BW".to_string(), + "IO".to_string(), + "BN".to_string(), + "BG".to_string(), + "BF".to_string(), + "BI".to_string(), + "KH".to_string(), + "CM".to_string(), + "CA".to_string(), + "CV".to_string(), + "KY".to_string(), + "CF".to_string(), + "TD".to_string(), + "CX".to_string(), + "CC".to_string(), + "KM".to_string(), + "CG".to_string(), + "CK".to_string(), + "CI".to_string(), + "CW".to_string(), + "CY".to_string(), + "CZ".to_string(), + "DJ".to_string(), + "DM".to_string(), + "EG".to_string(), + "GQ".to_string(), + "ER".to_string(), + "EE".to_string(), + "ET".to_string(), + "FK".to_string(), + "FO".to_string(), + "FJ".to_string(), + "GF".to_string(), + "PF".to_string(), + "TF".to_string(), + "GA".to_string(), + "GM".to_string(), + "GE".to_string(), + "GH".to_string(), + "GL".to_string(), + "GD".to_string(), + "GP".to_string(), + "GU".to_string(), + "GG".to_string(), + "GN".to_string(), + "GW".to_string(), + "GY".to_string(), + "HT".to_string(), + "HM".to_string(), + "VA".to_string(), + "IS".to_string(), + "IN".to_string(), + "ID".to_string(), + "IE".to_string(), + "IM".to_string(), + "IL".to_string(), + "JE".to_string(), + "JO".to_string(), + "KZ".to_string(), + "KE".to_string(), + "KI".to_string(), + "KW".to_string(), + "KG".to_string(), + "LA".to_string(), + "LV".to_string(), + "LB".to_string(), + "LS".to_string(), + "LI".to_string(), + "LT".to_string(), + "LU".to_string(), + "MK".to_string(), + "MG".to_string(), + "MW".to_string(), + "MV".to_string(), + "ML".to_string(), + "MT".to_string(), + "MH".to_string(), + "MQ".to_string(), + "MR".to_string(), + "MU".to_string(), + "YT".to_string(), + "FM".to_string(), + "MD".to_string(), + "MC".to_string(), + "MN".to_string(), + "ME".to_string(), + "MS".to_string(), + "MA".to_string(), + "MZ".to_string(), + "NA".to_string(), + "NR".to_string(), + "NP".to_string(), + "NC".to_string(), + "NZ".to_string(), + "NE".to_string(), + "NG".to_string(), + "NU".to_string(), + "NF".to_string(), + "MP".to_string(), + "OM".to_string(), + "PK".to_string(), + "PW".to_string(), + "PS".to_string(), + "PG".to_string(), + "PH".to_string(), + "PN".to_string(), + "QA".to_string(), + "RE".to_string(), + "RO".to_string(), + "RW".to_string(), + "BL".to_string(), + "SH".to_string(), + "KN".to_string(), + "LC".to_string(), + "MF".to_string(), + "PM".to_string(), + "VC".to_string(), + "WS".to_string(), + "SM".to_string(), + "ST".to_string(), + "SA".to_string(), + "SN".to_string(), + "RS".to_string(), + "SC".to_string(), + "SL".to_string(), + "SX".to_string(), + "SK".to_string(), + "SI".to_string(), + "SB".to_string(), + "SO".to_string(), + "ZA".to_string(), + "GS".to_string(), + "KR".to_string(), + "LK".to_string(), + "SR".to_string(), + "SJ".to_string(), + "SZ".to_string(), + "TH".to_string(), + "TL".to_string(), + "TG".to_string(), + "TK".to_string(), + "TO".to_string(), + "TT".to_string(), + "TN".to_string(), + "TM".to_string(), + "TC".to_string(), + "TV".to_string(), + "UG".to_string(), + "UA".to_string(), + "AE".to_string(), + "UZ".to_string(), + "VU".to_string(), + "VN".to_string(), + "VG".to_string(), + "VI".to_string(), + "WF".to_string(), + "EH".to_string(), + "ZM".to_string(), + ] + }, + value: None, + } + + ), + ( + "billing.email".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.email".to_string(), + display_name: "email_address".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ( + "payment_method_data.wallet.mifinity.language_preference".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.wallet.mifinity.language_preference".to_string(), + display_name: "language_preference".to_string(), + field_type: enums::FieldType::LanguagePreference{ + options: vec![ + "BR".to_string(), + "PT_BR".to_string(), + "CN".to_string(), + "ZH_CN".to_string(), + "DE".to_string(), + "DK".to_string(), + "DA".to_string(), + "DA_DK".to_string(), + "EN".to_string(), + "ES".to_string(), + "FI".to_string(), + "FR".to_string(), + "GR".to_string(), + "EL".to_string(), + "EL_GR".to_string(), + "HR".to_string(), + "IT".to_string(), + "JP".to_string(), + "JA".to_string(), + "JA_JP".to_string(), + "LA".to_string(), + "ES_LA".to_string(), + "NL".to_string(), + "NO".to_string(), + "PL".to_string(), + "PT".to_string(), + "RU".to_string(), + "SV".to_string(), + "SE".to_string(), + "SV_SE".to_string(), + "ZH".to_string(), + "TW".to_string(), + "ZH_TW".to_string(), + ] + }, + value: None, + } + ), + ]), + } + ), + ]), + } + ), + ])), + ), + ( + enums::PaymentMethod::PayLater, + PaymentMethodType(HashMap::from([ + ( + enums::PaymentMethodType::AfterpayClearpay, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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.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.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![ + "GB".to_string(), + "AU".to_string(), + "CA".to_string(), + "US".to_string(), + "NZ".to_string(), + ] + }, + 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, + } + ), + ( + "shipping.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.first_name".to_string(), + display_name: "shipping_first_name".to_string(), + field_type: enums::FieldType::UserShippingName, + value: None, + } + ), + ( + "shipping.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.last_name".to_string(), + display_name: "shipping_last_name".to_string(), + field_type: enums::FieldType::UserShippingName, + 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.state".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.state".to_string(), + display_name: "state".to_string(), + field_type: enums::FieldType::UserShippingAddressState, + 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, + } + ), + ]), + common : HashMap::new(), + } + ), + ( + 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: "billing_first_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: "billing_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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, + } + ), + ( + "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.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![ + "GB".to_string(), + "AU".to_string(), + "CA".to_string(), + "US".to_string(), + "NZ".to_string(), + ] + }, + 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, + } + ), + ( + "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(), + } + ) + ]), + }, + ), + ( + enums::PaymentMethodType::Klarna, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate : HashMap::new(), + non_mandate: 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![ + "AU".to_string(), + "AT".to_string(), + "BE".to_string(), + "CA".to_string(), + "CZ".to_string(), + "DK".to_string(), + "FI".to_string(), + "FR".to_string(), + "GR".to_string(), + "DE".to_string(), + "IE".to_string(), + "IT".to_string(), + "NL".to_string(), + "NZ".to_string(), + "NO".to_string(), + "PL".to_string(), + "PT".to_string(), + "RO".to_string(), + "ES".to_string(), + "SE".to_string(), + "CH".to_string(), + "GB".to_string(), + "US".to_string(), + ] + }, + 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::Connector::Adyen, + RequiredFieldFinal { + 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.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::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(), + "FI".to_string(), + "FR".to_string(), + "DE".to_string(), + "GR".to_string(), + "IE".to_string(), + "IT".to_string(), + "NL".to_string(), + "NZ".to_string(), + "NO".to_string(), + "PL".to_string(), + "PT".to_string(), + "ES".to_string(), + "SE".to_string(), + "CH".to_string(), + "GB".to_string(), + "US".to_string(), + ] + }, + value: None, + } + ) + ]), + } + ) + ]), + }, + ), + ( + enums::PaymentMethodType::Affirm, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + 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, + } + ), + ( + "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, + } + ), + ( + "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.line1".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.line1".to_string(), + display_name: "line1".to_string(), + field_type: enums::FieldType::UserAddressLine1, + value: None, + } + ), + ( + "shipping.address.line2".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.line2".to_string(), + display_name: "line2".to_string(), + field_type: enums::FieldType::UserAddressLine2, + 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.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.country".to_string(), + RequiredFieldInfo { + required_field: "shipping.address.country".to_string(), + display_name: "country".to_string(), + field_type: enums::FieldType::UserCountry { + options: vec![ + "US".to_string(), + ]}, + value: None, + } + ), + + ] + ), + common: HashMap::new(), + } + ), + ]), + }, + ), + ( + enums::PaymentMethodType::PayBright, + 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![ + "CA".to_string(), + ] + }, + value: None, + } + ), + ( + "payment_method_data.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, + } + ), + ( + "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.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![ + "DK".to_string(), + "FI".to_string(), + "NO".to_string(), + "SE".to_string(), + ]}, + 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, + } + ), + ( + "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.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, + } + ), + ( + "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.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, + } + ), + ( + "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, + } + ), + ( + "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, + } + ) + ] + ), + 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, + } + ), + ( + "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, + } + ), + ] + ), + 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, + } + ), + ( + "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, + } + ), + ] + ), + 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, + } + ), + ( + "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, + } + ), + ] + ), + 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, + } + ), + ( + "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, + } + ), + ] + ), + 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, + } + ), + ( + "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.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, + } + ), + ] + ), + common : HashMap::new(), + } + ) + ]), + }, + ), + ])), + ), + ( + enums::PaymentMethod::Upi, + PaymentMethodType(HashMap::from([ + ( + enums::PaymentMethodType::UpiCollect, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Razorpay, + RequiredFieldFinal { + mandate : HashMap::new(), + non_mandate : HashMap::new(), + common : HashMap::from([ + ( + "payment_method_data.upi.upi_collect.vpa_id".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.upi.upi_collect.vpa_id".to_string(), + display_name: "vpa_id".to_string(), + field_type: enums::FieldType::UserVpaId, + value: None, + } + ), + ]), + } + ), + ]), + }, + ), + ])), + ), + ( + enums::PaymentMethod::BankDebit, + PaymentMethodType(HashMap::from([( + enums::PaymentMethodType::Ach, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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: "billing_first_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::UserBankAccountNumber, + 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, + } + ) + ]), + }), + ( + 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::UserBankAccountNumber, + 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, + } + ) + ]), + }) + ] + )} + ), + ( + enums::PaymentMethodType::Sepa, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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: "billing_first_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_bank_debit.iban".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_debit.sepa_bank_debit.iban".to_string(), + display_name: "iban".to_string(), + field_type: enums::FieldType::UserIban, + 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, + } + ) + ]), + } + ), + ( + 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_bank_debit.iban".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_debit.sepa_bank_debit.iban".to_string(), + display_name: "iban".to_string(), + field_type: enums::FieldType::UserIban, + value: None, + } + ) + ]), + } + ), + ( + enums::Connector::Deutschebank, + 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, + } + ), + ( + "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, + } + ), + ( + "payment_method_data.bank_debit.sepa_bank_debit.iban".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_debit.sepa_bank_debit.iban".to_string(), + display_name: "iban".to_string(), + field_type: enums::FieldType::UserIban, + value: None, + } + ) + ]), + } + ) + ]), + }, + ), + ( + enums::PaymentMethodType::Bacs, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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: "billing_first_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::UserBankAccountNumber, + 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, + } + ), + ( + "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!["UK".to_string()], + }, + 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.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, + }, + ) + ]), + } + ), + ( + 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::UserBankAccountNumber, + 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, + } + ) + ]), + }) + ]), + }, + ), + ( + enums::PaymentMethodType::Becs, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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: "billing_first_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.becs.account_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_debit.becs.account_number".to_string(), + display_name: "bank_account_number".to_string(), + field_type: enums::FieldType::UserBankAccountNumber, + value: None, + } + ), + ( + "payment_method_data.bank_debit.becs.bsb_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_debit.becs.bsb_number".to_string(), + display_name: "bsb_number".to_string(), + field_type: enums::FieldType::Text, + 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, + } + ) + ]), + } + ), + ( + 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::UserBankAccountNumber, + 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, + } + ) + ]), + }) + ]), + }, + ), + ]))), + ( + enums::PaymentMethod::BankTransfer, + PaymentMethodType(HashMap::from([( + enums::PaymentMethodType::Multibanco, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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::LocalBankTransfer, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Zsl, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: 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![ + "CN".to_string(), + ] + }, + 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, + }, + ), + ]), + common: HashMap::new(), + } + ), + ])}), + (enums::PaymentMethodType::Ach, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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::PaymentMethodType::Pix, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Itaubank, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.bank_transfer.pix.pix_key".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_transfer.pix.pix_key".to_string(), + display_name: "pix_key".to_string(), + field_type: enums::FieldType::UserPixKey, + value: None, + } + ), + ( + "payment_method_data.bank_transfer.pix.cnpj".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_transfer.pix.cnpj".to_string(), + display_name: "cnpj".to_string(), + field_type: enums::FieldType::UserCnpj, + value: None, + } + ), + ( + "payment_method_data.bank_transfer.pix.cpf".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_transfer.pix.cpf".to_string(), + display_name: "cpf".to_string(), + field_type: enums::FieldType::UserCpf, + 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, + } + ), + ] + ), + } + ), + ( + 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::PaymentMethodType::Sepa, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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, + } + ), + ( + "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.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![ + "BE".to_string(), + "DE".to_string(), + "ES".to_string(), + "FR".to_string(), + "IE".to_string(), + "NL".to_string(), + ], + }, + value: None, + }, + ), + ]), + } + ) + ]), + }, + ), + ( + enums::PaymentMethodType::Bacs, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Stripe, + 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, + } + ), + ( + "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, + } + ) + ]), + } + ) + ]), + }, + ), + ]))), + ( + 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.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, + } + ), + ( + "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.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, + } + ), + ( + "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/scripts/add_connector.sh b/scripts/add_connector.sh index 2e12d8290508..0405f8b110f8 100755 --- a/scripts/add_connector.sh +++ b/scripts/add_connector.sh @@ -45,7 +45,7 @@ cd $SCRIPT/.. # Remove template files if already created for this connector rm -rf $conn/$payment_gateway $conn/$payment_gateway.rs -git checkout $conn.rs $src/types/api.rs $src/configs/settings.rs config/development.toml config/docker_compose.toml config/config.example.toml loadtest/config/development.toml crates/api_models/src/enums.rs crates/euclid/src/enums.rs crates/api_models/src/routing.rs $src/core/payments/flows.rs crates/common_enums/src/enums.rs $src/types/transformers.rs $src/core/admin.rs +git checkout $conn.rs $src/types/api.rs $src/configs/settings.rs config/development.toml config/docker_compose.toml config/config.example.toml loadtest/config/development.toml crates/api_models/src/connector_enums.rs crates/euclid/src/enums.rs crates/api_models/src/routing.rs $src/core/payments/flows.rs crates/common_enums/src/connector_enums.rs crates/common_enums/src/connector_enums.rs-e $src/types/transformers.rs $src/core/admin.rs # Add enum for this connector in required places previous_connector='' @@ -59,17 +59,17 @@ sed -i'' -e "s|$previous_connector_camelcase \(.*\)|$previous_connector_camelcas sed -i'' -e "s/pub $previous_connector: \(.*\)/pub $previous_connector: \1\n\tpub ${payment_gateway}: ConnectorParams,/" crates/hyperswitch_interfaces/src/configs.rs sed -i'' -e "s|$previous_connector.base_url \(.*\)|$previous_connector.base_url \1\n${payment_gateway}.base_url = \"$base_url\"|" config/development.toml config/docker_compose.toml config/config.example.toml loadtest/config/development.toml sed -r -i'' -e "s/\"$previous_connector\",/\"$previous_connector\",\n \"${payment_gateway}\",/" config/development.toml config/docker_compose.toml config/config.example.toml loadtest/config/development.toml -sed -i '' -e "s/\(pub enum Connector {\)/\1\n\t${payment_gateway_camelcase},/" crates/api_models/src/enums.rs -sed -i '' -e "/\/\/ Add Separate authentication support for connectors/{N;s/\(.*\)\n/\1\n\t\t\t| Self::${payment_gateway_camelcase}\n/;}" crates/api_models/src/enums.rs +sed -i '' -e "s/\(pub enum Connector {\)/\1\n\t${payment_gateway_camelcase},/" crates/api_models/src/connector_enums.rs +sed -i '' -e "/\/\/ Add Separate authentication support for connectors/{N;s/\(.*\)\n/\1\n\t\t\t| Self::${payment_gateway_camelcase}\n/;}" crates/api_models/src/connector_enums.rs sed -i '' -e "s/\(match connector_name {\)/\1\n\t\tapi_enums::Connector::${payment_gateway_camelcase} => {${payment_gateway}::transformers::${payment_gateway_camelcase}AuthType::try_from(val)?;Ok(())}/" $src/core/admin.rs -sed -i'' -e "s/\(pub enum RoutableConnectors {\)/\1\n\t${payment_gateway_camelcase},/" crates/common_enums/src/enums.rs +sed -i'' -e "s/\(pub enum RoutableConnectors {\)/\1\n\t${payment_gateway_camelcase},/" crates/common_enums/src/connector_enums.rs sed -i '' -e "s/\(pub enum Connector {\)/\1\n\t${payment_gateway_camelcase},/" crates/euclid/src/enums.rs sed -i'' -e "s|$previous_connector_camelcase \(.*\)|$previous_connector_camelcase \1\n\t\t\tapi_enums::Connector::${payment_gateway_camelcase} => Self::${payment_gateway_camelcase},|" $src/types/transformers.rs sed -i'' -e "s/^default_imp_for_\(.*\)/default_imp_for_\1\n\tconnectors::${payment_gateway_camelcase},/" crates/hyperswitch_connectors/src/default_implementations.rs sed -i'' -e "s/^default_imp_for_\(.*\)/default_imp_for_\1\n\tconnectors::${payment_gateway_camelcase},/" crates/hyperswitch_connectors/src/default_implementations_v2.rs # Remove temporary files created in above step -rm $conn.rs-e $src/types/api.rs-e $src/configs/settings.rs-e config/development.toml-e config/docker_compose.toml-e config/config.example.toml-e loadtest/config/development.toml-e crates/api_models/src/enums.rs-e crates/euclid/src/enums.rs-e crates/api_models/src/routing.rs-e $src/core/payments/flows.rs-e crates/common_enums/src/enums.rs-e $src/types/transformers.rs-e $src/core/admin.rs-e +rm $conn.rs-e $src/types/api.rs-e $src/configs/settings.rs-e config/development.toml-e config/docker_compose.toml-e config/config.example.toml-e loadtest/config/development.toml-e crates/api_models/src/connector_enums.rs-e crates/euclid/src/enums.rs-e crates/api_models/src/routing.rs-e $src/core/payments/flows.rs-e crates/common_enums/src/connector_enums.rs-e $src/types/transformers.rs-e $src/core/admin.rs-e crates/hyperswitch_connectors/src/default_implementations.rs-e crates/hyperswitch_connectors/src/default_implementations_v2.rs-e crates/hyperswitch_interfaces/src/configs.rs-e $src/connector.rs-e cd $conn/ # Generate template files for the connector From 62067e406a01d3a17ef94a04b0ef0304ebd05a70 Mon Sep 17 00:00:00 2001 From: Riddhiagrawal001 <50551695+Riddhiagrawal001@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:02:15 +0530 Subject: [PATCH 6/9] chore(users): change entity_type column of roles to non-optional (#6435) --- crates/diesel_models/src/role.rs | 4 ++-- crates/diesel_models/src/schema.rs | 2 +- crates/diesel_models/src/schema_v2.rs | 2 +- crates/router/src/core/user_role/role.rs | 2 +- crates/router/src/db/role.rs | 2 +- crates/router/src/services/authorization/roles.rs | 2 +- .../down.sql | 4 ++++ .../up.sql | 6 ++++++ 8 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 migrations/2024-10-24-123318_update-entity-type-column-in-roles/down.sql create mode 100644 migrations/2024-10-24-123318_update-entity-type-column-in-roles/up.sql diff --git a/crates/diesel_models/src/role.rs b/crates/diesel_models/src/role.rs index 3fb64e645d60..8199bd3979ce 100644 --- a/crates/diesel_models/src/role.rs +++ b/crates/diesel_models/src/role.rs @@ -18,7 +18,7 @@ pub struct Role { pub created_by: String, pub last_modified_at: PrimitiveDateTime, pub last_modified_by: String, - pub entity_type: Option, + pub entity_type: enums::EntityType, } #[derive(router_derive::Setter, Clone, Debug, Insertable, router_derive::DebugAsDisplay)] @@ -35,7 +35,7 @@ pub struct RoleNew { pub created_by: String, pub last_modified_at: PrimitiveDateTime, pub last_modified_by: String, - pub entity_type: Option, + pub entity_type: enums::EntityType, } #[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)] diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs index 8d2dfc47b623..e2ab676b2d30 100644 --- a/crates/diesel_models/src/schema.rs +++ b/crates/diesel_models/src/schema.rs @@ -1235,7 +1235,7 @@ diesel::table! { #[max_length = 64] last_modified_by -> Varchar, #[max_length = 64] - entity_type -> Nullable, + entity_type -> Varchar, } } diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs index b5e895cde790..5651bf95dd9d 100644 --- a/crates/diesel_models/src/schema_v2.rs +++ b/crates/diesel_models/src/schema_v2.rs @@ -1181,7 +1181,7 @@ diesel::table! { #[max_length = 64] last_modified_by -> Varchar, #[max_length = 64] - entity_type -> Nullable, + entity_type -> Varchar, } } diff --git a/crates/router/src/core/user_role/role.rs b/crates/router/src/core/user_role/role.rs index 1d37f7ac8d16..0250415d4fda 100644 --- a/crates/router/src/core/user_role/role.rs +++ b/crates/router/src/core/user_role/role.rs @@ -92,7 +92,7 @@ pub async fn create_role( org_id: user_from_token.org_id, groups: req.groups, scope: req.role_scope, - entity_type: Some(EntityType::Merchant), + entity_type: EntityType::Merchant, created_by: user_from_token.user_id.clone(), last_modified_by: user_from_token.user_id, created_at: now, diff --git a/crates/router/src/db/role.rs b/crates/router/src/db/role.rs index ce009d38a9ec..d13508356e5a 100644 --- a/crates/router/src/db/role.rs +++ b/crates/router/src/db/role.rs @@ -354,7 +354,7 @@ impl RoleInterface for MockDb { None => true, }; - matches_merchant && role.org_id == *org_id && role.entity_type == entity_type + matches_merchant && role.org_id == *org_id && Some(role.entity_type) == entity_type }) .take(limit_usize) .cloned() diff --git a/crates/router/src/services/authorization/roles.rs b/crates/router/src/services/authorization/roles.rs index 63d547bfa67e..bf66eb924669 100644 --- a/crates/router/src/services/authorization/roles.rs +++ b/crates/router/src/services/authorization/roles.rs @@ -119,7 +119,7 @@ impl From for RoleInfo { role_name: role.role_name, groups: role.groups.into_iter().map(Into::into).collect(), scope: role.scope, - entity_type: role.entity_type.unwrap_or(EntityType::Merchant), + entity_type: role.entity_type, is_invitable: true, is_deletable: true, is_updatable: true, diff --git a/migrations/2024-10-24-123318_update-entity-type-column-in-roles/down.sql b/migrations/2024-10-24-123318_update-entity-type-column-in-roles/down.sql new file mode 100644 index 000000000000..60dfa892e602 --- /dev/null +++ b/migrations/2024-10-24-123318_update-entity-type-column-in-roles/down.sql @@ -0,0 +1,4 @@ +-- This file should undo anything in `up.sql` +ALTER TABLE roles ALTER COLUMN entity_type DROP DEFAULT; + +ALTER TABLE roles ALTER COLUMN entity_type DROP NOT NULL; \ No newline at end of file diff --git a/migrations/2024-10-24-123318_update-entity-type-column-in-roles/up.sql b/migrations/2024-10-24-123318_update-entity-type-column-in-roles/up.sql new file mode 100644 index 000000000000..564a026184ef --- /dev/null +++ b/migrations/2024-10-24-123318_update-entity-type-column-in-roles/up.sql @@ -0,0 +1,6 @@ +-- Your SQL goes here +UPDATE roles SET entity_type = 'merchant' WHERE entity_type IS NULL; + +ALTER TABLE roles ALTER COLUMN entity_type SET DEFAULT 'merchant'; + +ALTER TABLE roles ALTER COLUMN entity_type SET NOT NULL; \ No newline at end of file From 33bc83fce47c579457f1b9be0a91bb4fa13585ff Mon Sep 17 00:00:00 2001 From: Gaurav Ghodinde <65962770+gauravghodinde@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:44:44 +0530 Subject: [PATCH 7/9] refactor(connector): add amount conversion framework to rapyd (#6414) --- crates/router/src/connector/rapyd.rs | 47 +++++++++++-------- .../src/connector/rapyd/transformers.rs | 22 ++++----- crates/router/src/types/api.rs | 4 +- crates/router/tests/connectors/rapyd.rs | 2 +- 4 files changed, 42 insertions(+), 33 deletions(-) diff --git a/crates/router/src/connector/rapyd.rs b/crates/router/src/connector/rapyd.rs index da10513b3d3b..196eb4ce73dd 100644 --- a/crates/router/src/connector/rapyd.rs +++ b/crates/router/src/connector/rapyd.rs @@ -1,11 +1,11 @@ pub mod transformers; -use std::fmt::Debug; use base64::Engine; use common_utils::{ date_time, ext_traits::{Encode, StringExt}, request::RequestContent, + types::{AmountConvertor, MinorUnit, MinorUnitForConnector}, }; use diesel_models::enums; use error_stack::{Report, ResultExt}; @@ -17,6 +17,7 @@ use transformers as rapyd; use super::utils as connector_utils; use crate::{ configs::settings, + connector::utils::convert_amount, consts, core::errors::{self, CustomResult}, events::connector_api_logs::ConnectorEvent, @@ -34,9 +35,17 @@ use crate::{ utils::{self, crypto, ByteSliceExt, BytesExt}, }; -#[derive(Debug, Clone)] -pub struct Rapyd; - +#[derive(Clone)] +pub struct Rapyd { + amount_converter: &'static (dyn AmountConvertor + Sync), +} +impl Rapyd { + pub fn new() -> &'static Self { + &Self { + amount_converter: &MinorUnitForConnector, + } + } +} impl Rapyd { pub fn generate_signature( &self, @@ -198,12 +207,12 @@ impl req: &types::PaymentsAuthorizeRouterData, _connectors: &settings::Connectors, ) -> CustomResult { - let connector_router_data = rapyd::RapydRouterData::try_from(( - &self.get_currency_unit(), + let amount = convert_amount( + self.amount_converter, + req.request.minor_amount, req.request.currency, - req.request.amount, - req, - ))?; + )?; + let connector_router_data = rapyd::RapydRouterData::from((amount, req)); let connector_req = rapyd::RapydPaymentsRequest::try_from(&connector_router_data)?; Ok(RequestContent::Json(Box::new(connector_req))) } @@ -528,12 +537,12 @@ impl req: &types::PaymentsCaptureRouterData, _connectors: &settings::Connectors, ) -> CustomResult { - let connector_router_data = rapyd::RapydRouterData::try_from(( - &self.get_currency_unit(), + let amount = convert_amount( + self.amount_converter, + req.request.minor_amount_to_capture, req.request.currency, - req.request.amount_to_capture, - req, - ))?; + )?; + let connector_router_data = rapyd::RapydRouterData::from((amount, req)); let connector_req = rapyd::CaptureRequest::try_from(&connector_router_data)?; Ok(RequestContent::Json(Box::new(connector_req))) } @@ -668,12 +677,12 @@ impl services::ConnectorIntegration, _connectors: &settings::Connectors, ) -> CustomResult { - let connector_router_data = rapyd::RapydRouterData::try_from(( - &self.get_currency_unit(), + let amount = convert_amount( + self.amount_converter, + req.request.minor_refund_amount, req.request.currency, - req.request.refund_amount, - req, - ))?; + )?; + let connector_router_data = rapyd::RapydRouterData::from((amount, req)); let connector_req = rapyd::RapydRefundRequest::try_from(&connector_router_data)?; Ok(RequestContent::Json(Box::new(connector_req))) diff --git a/crates/router/src/connector/rapyd/transformers.rs b/crates/router/src/connector/rapyd/transformers.rs index 1246444ff313..b83ffcec4124 100644 --- a/crates/router/src/connector/rapyd/transformers.rs +++ b/crates/router/src/connector/rapyd/transformers.rs @@ -1,3 +1,4 @@ +use common_utils::types::MinorUnit; use error_stack::ResultExt; use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; @@ -15,25 +16,22 @@ use crate::{ #[derive(Debug, Serialize)] pub struct RapydRouterData { - pub amount: i64, + pub amount: MinorUnit, pub router_data: T, } -impl TryFrom<(&api::CurrencyUnit, enums::Currency, i64, T)> for RapydRouterData { - type Error = error_stack::Report; - fn try_from( - (_currency_unit, _currency, amount, item): (&api::CurrencyUnit, enums::Currency, i64, T), - ) -> Result { - Ok(Self { +impl From<(MinorUnit, T)> for RapydRouterData { + fn from((amount, router_data): (MinorUnit, T)) -> Self { + Self { amount, - router_data: item, - }) + router_data, + } } } #[derive(Default, Debug, Serialize)] pub struct RapydPaymentsRequest { - pub amount: i64, + pub amount: MinorUnit, pub currency: enums::Currency, pub payment_method: PaymentMethod, pub payment_method_options: Option, @@ -302,7 +300,7 @@ pub struct DisputeResponseData { #[derive(Default, Debug, Serialize)] pub struct RapydRefundRequest { pub payment: String, - pub amount: Option, + pub amount: Option, pub currency: Option, } @@ -409,7 +407,7 @@ impl TryFrom> #[derive(Debug, Serialize, Clone)] pub struct CaptureRequest { - amount: Option, + amount: Option, receipt_email: Option>, statement_descriptor: Option, } diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs index a30462132726..ee25cb5fcb15 100644 --- a/crates/router/src/types/api.rs +++ b/crates/router/src/types/api.rs @@ -471,7 +471,9 @@ impl ConnectorData { enums::Connector::Razorpay => { Ok(ConnectorEnum::Old(Box::new(connector::Razorpay::new()))) } - enums::Connector::Rapyd => Ok(ConnectorEnum::Old(Box::new(&connector::Rapyd))), + enums::Connector::Rapyd => { + Ok(ConnectorEnum::Old(Box::new(connector::Rapyd::new()))) + } enums::Connector::Shift4 => { Ok(ConnectorEnum::Old(Box::new(connector::Shift4::new()))) } diff --git a/crates/router/tests/connectors/rapyd.rs b/crates/router/tests/connectors/rapyd.rs index fe6bc34cf18f..ff083a37e595 100644 --- a/crates/router/tests/connectors/rapyd.rs +++ b/crates/router/tests/connectors/rapyd.rs @@ -16,7 +16,7 @@ impl utils::Connector for Rapyd { fn get_data(&self) -> types::api::ConnectorData { use router::connector::Rapyd; utils::construct_connector_data_old( - Box::new(&Rapyd), + Box::new(Rapyd::new()), types::Connector::Rapyd, types::api::GetToken::Connector, None, From c514608594ebbe9894de47747b0d9fb573ab2503 Mon Sep 17 00:00:00 2001 From: Anurag Thakur Date: Wed, 30 Oct 2024 21:26:23 +0530 Subject: [PATCH 8/9] feat(router): Add payments get-intent API for v2 (#6396) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> --- .../payments/payments--get-intent.mdx | 3 + api-reference-v2/mint.json | 1 + api-reference-v2/openapi_spec.json | 389 ++++++++++-------- crates/api_models/src/events/payment.rs | 14 +- crates/api_models/src/payments.rs | 9 +- .../src/router_flow_types/payments.rs | 5 +- crates/openapi/src/openapi_v2.rs | 3 +- crates/openapi/src/routes/payments.rs | 21 +- crates/router/src/core/payments.rs | 4 +- crates/router/src/core/payments/operations.rs | 7 +- .../payments/operations/payment_get_intent.rs | 231 +++++++++++ .../router/src/core/payments/transformers.rs | 2 +- crates/router/src/routes/app.rs | 4 + crates/router/src/routes/lock_utils.rs | 1 + crates/router/src/routes/payments.rs | 57 ++- crates/router/src/services/api.rs | 4 +- crates/router/src/types/api/payments.rs | 8 +- crates/router_env/src/logger/types.rs | 2 + 18 files changed, 570 insertions(+), 195 deletions(-) create mode 100644 api-reference-v2/api-reference/payments/payments--get-intent.mdx create mode 100644 crates/router/src/core/payments/operations/payment_get_intent.rs diff --git a/api-reference-v2/api-reference/payments/payments--get-intent.mdx b/api-reference-v2/api-reference/payments/payments--get-intent.mdx new file mode 100644 index 000000000000..cd1321be217e --- /dev/null +++ b/api-reference-v2/api-reference/payments/payments--get-intent.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /v2/payments/{id}/get-intent +--- \ No newline at end of file diff --git a/api-reference-v2/mint.json b/api-reference-v2/mint.json index 974e530f3111..17dd6dfb7ffa 100644 --- a/api-reference-v2/mint.json +++ b/api-reference-v2/mint.json @@ -38,6 +38,7 @@ "group": "Payments", "pages": [ "api-reference/payments/payments--create-intent", + "api-reference/payments/payments--get-intent", "api-reference/payments/payments--session-token", "api-reference/payments/payments--confirm-intent" ] diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index 06bbf125dfbf..0c4679026031 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -1843,7 +1843,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentsCreateIntentResponse" + "$ref": "#/components/schemas/PaymentsIntentResponse" } } } @@ -1859,6 +1859,47 @@ ] } }, + "/v2/payments/{id}/get-intent": { + "get": { + "tags": [ + "Payments" + ], + "summary": "Payments - Get Intent", + "description": "**Get a payment intent object when id is passed in path**\n\nYou will require the 'API - Key' from the Hyperswitch dashboard to make the call.", + "operationId": "Get the Payment Intent details", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The unique identifier for the Payment Intent", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Payment Intent", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsIntentResponse" + } + } + } + }, + "404": { + "description": "Payment Intent not found" + } + }, + "security": [ + { + "api_key": [] + } + ] + } + }, "/v2/payments/{id}/confirm-intent": { "post": { "tags": [ @@ -13568,179 +13609,6 @@ }, "additionalProperties": false }, - "PaymentsCreateIntentResponse": { - "type": "object", - "required": [ - "id", - "amount_details", - "client_secret", - "capture_method", - "authentication_type", - "customer_present", - "setup_future_usage", - "apply_mit_exemption", - "payment_link_enabled", - "request_incremental_authorization", - "expires_on", - "request_external_three_ds_authentication" - ], - "properties": { - "id": { - "type": "string", - "description": "Global Payment Id for the payment" - }, - "amount_details": { - "$ref": "#/components/schemas/AmountDetailsResponse" - }, - "client_secret": { - "type": "string", - "description": "It's a token used for client side verification.", - "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo" - }, - "merchant_reference_id": { - "type": "string", - "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.", - "example": "pay_mbabizu24mvu3mela5njyhpit4", - "nullable": true, - "maxLength": 30, - "minLength": 30 - }, - "routing_algorithm_id": { - "type": "string", - "description": "The routing algorithm id to be used for the payment", - "nullable": true - }, - "capture_method": { - "$ref": "#/components/schemas/CaptureMethod" - }, - "authentication_type": { - "allOf": [ - { - "$ref": "#/components/schemas/AuthenticationType" - } - ], - "default": "no_three_ds" - }, - "billing": { - "allOf": [ - { - "$ref": "#/components/schemas/Address" - } - ], - "nullable": true - }, - "shipping": { - "allOf": [ - { - "$ref": "#/components/schemas/Address" - } - ], - "nullable": true - }, - "customer_id": { - "type": "string", - "description": "The identifier for the customer", - "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", - "nullable": true, - "maxLength": 64, - "minLength": 1 - }, - "customer_present": { - "$ref": "#/components/schemas/PresenceOfCustomerDuringPayment" - }, - "description": { - "type": "string", - "description": "A description for the payment", - "example": "It's my first payment request", - "nullable": true - }, - "return_url": { - "type": "string", - "description": "The URL to which you want the user to be redirected after the completion of the payment operation", - "example": "https://hyperswitch.io", - "nullable": true - }, - "setup_future_usage": { - "$ref": "#/components/schemas/FutureUsage" - }, - "apply_mit_exemption": { - "$ref": "#/components/schemas/MitExemptionRequest" - }, - "statement_descriptor": { - "type": "string", - "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.", - "example": "Hyperswitch Router", - "nullable": true, - "maxLength": 22 - }, - "order_details": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OrderDetailsWithAmount" - }, - "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount", - "example": "[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]", - "nullable": true - }, - "allowed_payment_method_types": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentMethodType" - }, - "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Metadata is useful for storing additional, unstructured information on an object.", - "nullable": true - }, - "connector_metadata": { - "allOf": [ - { - "$ref": "#/components/schemas/ConnectorMetadata" - } - ], - "nullable": true - }, - "feature_metadata": { - "allOf": [ - { - "$ref": "#/components/schemas/FeatureMetadata" - } - ], - "nullable": true - }, - "payment_link_enabled": { - "$ref": "#/components/schemas/EnablePaymentLinkRequest" - }, - "payment_link_config": { - "allOf": [ - { - "$ref": "#/components/schemas/PaymentLinkConfigRequest" - } - ], - "nullable": true - }, - "request_incremental_authorization": { - "$ref": "#/components/schemas/RequestIncrementalAuthorization" - }, - "expires_on": { - "type": "string", - "format": "date-time", - "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds" - }, - "frm_metadata": { - "type": "object", - "description": "Additional data related to some frm(Fraud Risk Management) connectors", - "nullable": true - }, - "request_external_three_ds_authentication": { - "$ref": "#/components/schemas/External3dsAuthenticationRequest" - } - }, - "additionalProperties": false - }, "PaymentsCreateResponseOpenApi": { "type": "object", "required": [ @@ -14434,6 +14302,179 @@ } } }, + "PaymentsIntentResponse": { + "type": "object", + "required": [ + "id", + "amount_details", + "client_secret", + "capture_method", + "authentication_type", + "customer_present", + "setup_future_usage", + "apply_mit_exemption", + "payment_link_enabled", + "request_incremental_authorization", + "expires_on", + "request_external_three_ds_authentication" + ], + "properties": { + "id": { + "type": "string", + "description": "Global Payment Id for the payment" + }, + "amount_details": { + "$ref": "#/components/schemas/AmountDetailsResponse" + }, + "client_secret": { + "type": "string", + "description": "It's a token used for client side verification.", + "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo" + }, + "merchant_reference_id": { + "type": "string", + "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.", + "example": "pay_mbabizu24mvu3mela5njyhpit4", + "nullable": true, + "maxLength": 30, + "minLength": 30 + }, + "routing_algorithm_id": { + "type": "string", + "description": "The routing algorithm id to be used for the payment", + "nullable": true + }, + "capture_method": { + "$ref": "#/components/schemas/CaptureMethod" + }, + "authentication_type": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticationType" + } + ], + "default": "no_three_ds" + }, + "billing": { + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ], + "nullable": true + }, + "shipping": { + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ], + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "The identifier for the customer", + "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", + "nullable": true, + "maxLength": 64, + "minLength": 1 + }, + "customer_present": { + "$ref": "#/components/schemas/PresenceOfCustomerDuringPayment" + }, + "description": { + "type": "string", + "description": "A description for the payment", + "example": "It's my first payment request", + "nullable": true + }, + "return_url": { + "type": "string", + "description": "The URL to which you want the user to be redirected after the completion of the payment operation", + "example": "https://hyperswitch.io", + "nullable": true + }, + "setup_future_usage": { + "$ref": "#/components/schemas/FutureUsage" + }, + "apply_mit_exemption": { + "$ref": "#/components/schemas/MitExemptionRequest" + }, + "statement_descriptor": { + "type": "string", + "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.", + "example": "Hyperswitch Router", + "nullable": true, + "maxLength": 22 + }, + "order_details": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderDetailsWithAmount" + }, + "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount", + "example": "[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]", + "nullable": true + }, + "allowed_payment_method_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentMethodType" + }, + "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Metadata is useful for storing additional, unstructured information on an object.", + "nullable": true + }, + "connector_metadata": { + "allOf": [ + { + "$ref": "#/components/schemas/ConnectorMetadata" + } + ], + "nullable": true + }, + "feature_metadata": { + "allOf": [ + { + "$ref": "#/components/schemas/FeatureMetadata" + } + ], + "nullable": true + }, + "payment_link_enabled": { + "$ref": "#/components/schemas/EnablePaymentLinkRequest" + }, + "payment_link_config": { + "allOf": [ + { + "$ref": "#/components/schemas/PaymentLinkConfigRequest" + } + ], + "nullable": true + }, + "request_incremental_authorization": { + "$ref": "#/components/schemas/RequestIncrementalAuthorization" + }, + "expires_on": { + "type": "string", + "format": "date-time", + "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds" + }, + "frm_metadata": { + "type": "object", + "description": "Additional data related to some frm(Fraud Risk Management) connectors", + "nullable": true + }, + "request_external_three_ds_authentication": { + "$ref": "#/components/schemas/External3dsAuthenticationRequest" + } + }, + "additionalProperties": false + }, "PaymentsResponse": { "type": "object", "required": [ diff --git a/crates/api_models/src/events/payment.rs b/crates/api_models/src/events/payment.rs index 000343864b20..b9dc1476fdb8 100644 --- a/crates/api_models/src/events/payment.rs +++ b/crates/api_models/src/events/payment.rs @@ -2,7 +2,8 @@ use common_utils::events::{ApiEventMetric, ApiEventsType}; #[cfg(feature = "v2")] use super::{ - PaymentsConfirmIntentResponse, PaymentsCreateIntentRequest, PaymentsCreateIntentResponse, + PaymentsConfirmIntentResponse, PaymentsCreateIntentRequest, PaymentsGetIntentRequest, + PaymentsIntentResponse, }; #[cfg(all( any(feature = "v2", feature = "v1"), @@ -150,7 +151,16 @@ impl ApiEventMetric for PaymentsCreateIntentRequest { } #[cfg(feature = "v2")] -impl ApiEventMetric for PaymentsCreateIntentResponse { +impl ApiEventMetric for PaymentsGetIntentRequest { + fn get_api_event_type(&self) -> Option { + Some(ApiEventsType::Payment { + payment_id: self.id.clone(), + }) + } +} + +#[cfg(feature = "v2")] +impl ApiEventMetric for PaymentsIntentResponse { fn get_api_event_type(&self) -> Option { Some(ApiEventsType::Payment { payment_id: self.id.clone(), diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 2f90db83c551..ceb2b654871c 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -287,10 +287,17 @@ impl PaymentsCreateIntentRequest { } } +// This struct is only used internally, not visible in API Reference +#[derive(Debug, Clone, serde::Serialize)] +#[cfg(feature = "v2")] +pub struct PaymentsGetIntentRequest { + pub id: id_type::GlobalPaymentId, +} + #[derive(Debug, serde::Serialize, Clone, ToSchema)] #[serde(deny_unknown_fields)] #[cfg(feature = "v2")] -pub struct PaymentsCreateIntentResponse { +pub struct PaymentsIntentResponse { /// Global Payment Id for the payment #[schema(value_type = String)] pub id: id_type::GlobalPaymentId, diff --git a/crates/hyperswitch_domain_models/src/router_flow_types/payments.rs b/crates/hyperswitch_domain_models/src/router_flow_types/payments.rs index 602c184139f9..c43d72ce8def 100644 --- a/crates/hyperswitch_domain_models/src/router_flow_types/payments.rs +++ b/crates/hyperswitch_domain_models/src/router_flow_types/payments.rs @@ -57,7 +57,10 @@ pub struct CalculateTax; pub struct SdkSessionUpdate; #[derive(Debug, Clone)] -pub struct CreateIntent; +pub struct PaymentCreateIntent; + +#[derive(Debug, Clone)] +pub struct PaymentGetIntent; #[derive(Debug, Clone)] pub struct PostSessionTokens; diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs index 7bbe019dcbae..dacaedd97631 100644 --- a/crates/openapi/src/openapi_v2.rs +++ b/crates/openapi/src/openapi_v2.rs @@ -123,6 +123,7 @@ Never share your secret api keys. Keep them guarded and secure. //Routes for payments routes::payments::payments_create_intent, + routes::payments::payments_get_intent, routes::payments::payments_confirm_intent, //Routes for refunds @@ -325,7 +326,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::PaymentsSessionRequest, api_models::payments::PaymentsSessionResponse, api_models::payments::PaymentsCreateIntentRequest, - api_models::payments::PaymentsCreateIntentResponse, + api_models::payments::PaymentsIntentResponse, api_models::payments::PazeWalletData, api_models::payments::AmountDetails, api_models::payments::SessionToken, diff --git a/crates/openapi/src/routes/payments.rs b/crates/openapi/src/routes/payments.rs index 3429de60ba7b..e245c5af68a4 100644 --- a/crates/openapi/src/routes/payments.rs +++ b/crates/openapi/src/routes/payments.rs @@ -620,7 +620,7 @@ pub fn payments_post_session_tokens() {} ), ), responses( - (status = 200, description = "Payment created", body = PaymentsCreateIntentResponse), + (status = 200, description = "Payment created", body = PaymentsIntentResponse), (status = 400, description = "Missing Mandatory fields") ), tag = "Payments", @@ -630,6 +630,25 @@ pub fn payments_post_session_tokens() {} #[cfg(feature = "v2")] pub fn payments_create_intent() {} +/// Payments - Get Intent +/// +/// **Get a payment intent object when id is passed in path** +/// +/// You will require the 'API - Key' from the Hyperswitch dashboard to make the call. +#[utoipa::path( + get, + path = "/v2/payments/{id}/get-intent", + params (("id" = String, Path, description = "The unique identifier for the Payment Intent")), + responses( + (status = 200, description = "Payment Intent", body = PaymentsIntentResponse), + (status = 404, description = "Payment Intent not found") + ), + tag = "Payments", + operation_id = "Get the Payment Intent details", + security(("api_key" = [])), +)] +#[cfg(feature = "v2")] +pub fn payments_get_intent() {} /// Payments - Confirm Intent /// /// **Confirms a payment intent object with the payment method data** diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index de58eeed1008..860394f7c493 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -1021,7 +1021,7 @@ pub async fn payments_intent_operation_core( ) -> RouterResult<(D, Req, Option)> where F: Send + Clone + Sync, - Req: Authenticate + Clone, + Req: Clone, Op: Operation + Send + Sync, D: OperationSessionGetters + OperationSessionSetters + Send + Sync + Clone, { @@ -1454,7 +1454,7 @@ pub async fn payments_intent_core( where F: Send + Clone + Sync, Op: Operation + Send + Sync + Clone, - Req: Debug + Authenticate + Clone, + Req: Debug + Clone, D: OperationSessionGetters + OperationSessionSetters + Send + Sync + Clone, Res: transformers::ToResponse, { diff --git a/crates/router/src/core/payments/operations.rs b/crates/router/src/core/payments/operations.rs index 6546638a62ed..b03f41ac0fd1 100644 --- a/crates/router/src/core/payments/operations.rs +++ b/crates/router/src/core/payments/operations.rs @@ -28,11 +28,12 @@ pub mod payments_incremental_authorization; #[cfg(feature = "v1")] pub mod tax_calculation; +#[cfg(feature = "v2")] +pub mod payment_confirm_intent; #[cfg(feature = "v2")] pub mod payment_create_intent; - #[cfg(feature = "v2")] -pub mod payment_confirm_intent; +pub mod payment_get_intent; use api_models::enums::FrmSuggestion; #[cfg(all(feature = "v1", feature = "dynamic_routing"))] @@ -45,6 +46,8 @@ use router_env::{instrument, tracing}; pub use self::payment_confirm_intent::PaymentIntentConfirm; #[cfg(feature = "v2")] pub use self::payment_create_intent::PaymentIntentCreate; +#[cfg(feature = "v2")] +pub use self::payment_get_intent::PaymentGetIntent; pub use self::payment_response::PaymentResponse; #[cfg(feature = "v1")] pub use self::{ diff --git a/crates/router/src/core/payments/operations/payment_get_intent.rs b/crates/router/src/core/payments/operations/payment_get_intent.rs new file mode 100644 index 000000000000..55ddc3b482a6 --- /dev/null +++ b/crates/router/src/core/payments/operations/payment_get_intent.rs @@ -0,0 +1,231 @@ +use std::marker::PhantomData; + +use api_models::{enums::FrmSuggestion, payments::PaymentsGetIntentRequest}; +use async_trait::async_trait; +use common_utils::errors::CustomResult; +use router_env::{instrument, tracing}; + +use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest}; +use crate::{ + core::{ + errors::{self, RouterResult}, + payments::{self, helpers, operations}, + }, + db::errors::StorageErrorExt, + routes::{app::ReqState, SessionState}, + types::{ + api, domain, + storage::{self, enums}, + }, +}; + +#[derive(Debug, Clone, Copy)] +pub struct PaymentGetIntent; + +impl Operation for &PaymentGetIntent { + type Data = payments::PaymentIntentData; + fn to_validate_request( + &self, + ) -> RouterResult<&(dyn ValidateRequest + Send + Sync)> + { + Ok(*self) + } + fn to_get_tracker( + &self, + ) -> RouterResult<&(dyn GetTracker + Send + Sync)> + { + Ok(*self) + } + fn to_domain(&self) -> RouterResult<&(dyn Domain)> { + Ok(*self) + } + fn to_update_tracker( + &self, + ) -> RouterResult<&(dyn UpdateTracker + Send + Sync)> + { + Ok(*self) + } +} + +impl Operation for PaymentGetIntent { + type Data = payments::PaymentIntentData; + fn to_validate_request( + &self, + ) -> RouterResult<&(dyn ValidateRequest + Send + Sync)> + { + Ok(self) + } + fn to_get_tracker( + &self, + ) -> RouterResult<&(dyn GetTracker + Send + Sync)> + { + Ok(self) + } + fn to_domain(&self) -> RouterResult<&dyn Domain> { + Ok(self) + } + fn to_update_tracker( + &self, + ) -> RouterResult<&(dyn UpdateTracker + Send + Sync)> + { + Ok(self) + } +} + +type PaymentsGetIntentOperation<'b, F> = + BoxedOperation<'b, F, PaymentsGetIntentRequest, payments::PaymentIntentData>; + +#[async_trait] +impl GetTracker, PaymentsGetIntentRequest> + for PaymentGetIntent +{ + #[instrument(skip_all)] + async fn get_trackers<'a>( + &'a self, + state: &'a SessionState, + _payment_id: &common_utils::id_type::GlobalPaymentId, + request: &PaymentsGetIntentRequest, + merchant_account: &domain::MerchantAccount, + _profile: &domain::Profile, + key_store: &domain::MerchantKeyStore, + _header_payload: &hyperswitch_domain_models::payments::HeaderPayload, + ) -> RouterResult< + operations::GetTrackerResponse< + 'a, + F, + PaymentsGetIntentRequest, + payments::PaymentIntentData, + >, + > { + let db = &*state.store; + let key_manager_state = &state.into(); + let storage_scheme = merchant_account.storage_scheme; + let payment_intent = db + .find_payment_intent_by_id(key_manager_state, &request.id, key_store, storage_scheme) + .await + .to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)?; + + let payment_data = payments::PaymentIntentData { + flow: PhantomData, + payment_intent, + }; + + let get_trackers_response = operations::GetTrackerResponse { + operation: Box::new(self), + payment_data, + }; + + Ok(get_trackers_response) + } +} + +#[async_trait] +impl UpdateTracker, PaymentsGetIntentRequest> + for PaymentGetIntent +{ + #[instrument(skip_all)] + async fn update_trackers<'b>( + &'b self, + _state: &'b SessionState, + _req_state: ReqState, + payment_data: payments::PaymentIntentData, + _customer: Option, + _storage_scheme: enums::MerchantStorageScheme, + _updated_customer: Option, + _key_store: &domain::MerchantKeyStore, + _frm_suggestion: Option, + _header_payload: hyperswitch_domain_models::payments::HeaderPayload, + ) -> RouterResult<( + PaymentsGetIntentOperation<'b, F>, + payments::PaymentIntentData, + )> + where + F: 'b + Send, + { + Ok((Box::new(self), payment_data)) + } +} + +impl ValidateRequest> + for PaymentGetIntent +{ + #[instrument(skip_all)] + fn validate_request<'a, 'b>( + &'b self, + _request: &PaymentsGetIntentRequest, + merchant_account: &'a domain::MerchantAccount, + ) -> RouterResult<( + PaymentsGetIntentOperation<'b, F>, + operations::ValidateResult, + )> { + Ok(( + Box::new(self), + operations::ValidateResult { + merchant_id: merchant_account.get_id().to_owned(), + storage_scheme: merchant_account.storage_scheme, + requeue: false, + }, + )) + } +} + +#[async_trait] +impl Domain> + for PaymentGetIntent +{ + #[instrument(skip_all)] + async fn get_customer_details<'a>( + &'a self, + state: &SessionState, + payment_data: &mut payments::PaymentIntentData, + merchant_key_store: &domain::MerchantKeyStore, + storage_scheme: enums::MerchantStorageScheme, + ) -> CustomResult< + ( + BoxedOperation<'a, F, PaymentsGetIntentRequest, payments::PaymentIntentData>, + Option, + ), + errors::StorageError, + > { + Ok((Box::new(self), None)) + } + + #[instrument(skip_all)] + async fn make_pm_data<'a>( + &'a self, + _state: &'a SessionState, + _payment_data: &mut payments::PaymentIntentData, + _storage_scheme: enums::MerchantStorageScheme, + _merchant_key_store: &domain::MerchantKeyStore, + _customer: &Option, + _business_profile: &domain::Profile, + ) -> RouterResult<( + PaymentsGetIntentOperation<'a, F>, + Option, + Option, + )> { + Ok((Box::new(self), None, None)) + } + + async fn get_connector<'a>( + &'a self, + _merchant_account: &domain::MerchantAccount, + state: &SessionState, + _request: &PaymentsGetIntentRequest, + _payment_intent: &storage::PaymentIntent, + _merchant_key_store: &domain::MerchantKeyStore, + ) -> CustomResult { + helpers::get_connector_default(state, None).await + } + + #[instrument(skip_all)] + async fn guard_payment_against_blocklist<'a>( + &'a self, + _state: &SessionState, + _merchant_account: &domain::MerchantAccount, + _key_store: &domain::MerchantKeyStore, + _payment_data: &mut payments::PaymentIntentData, + ) -> CustomResult { + Ok(false) + } +} diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index c623ad86e647..e059ebdb8b52 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -755,7 +755,7 @@ where } #[cfg(feature = "v2")] -impl ToResponse for api::PaymentsCreateIntentResponse +impl ToResponse for api::PaymentsIntentResponse where F: Clone, Op: Debug, diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index f54895ce7da3..ae099a36e444 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -527,6 +527,10 @@ impl Payments { web::resource("/confirm-intent") .route(web::post().to(payments::payment_confirm_intent)), ) + .service( + web::resource("/get-intent") + .route(web::get().to(payments::payments_get_intent)), + ) .service( web::resource("/create-external-sdk-tokens") .route(web::post().to(payments::payments_connector_session)), diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs index ac17cf802107..43ddc35b8ae6 100644 --- a/crates/router/src/routes/lock_utils.rs +++ b/crates/router/src/routes/lock_utils.rs @@ -139,6 +139,7 @@ impl From for ApiIdentifier { | Flow::SessionUpdateTaxCalculation | Flow::PaymentsConfirmIntent | Flow::PaymentsCreateIntent + | Flow::PaymentsGetIntent | Flow::PaymentsPostSessionTokens => Self::Payments, Flow::PayoutsCreate diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rs index bca7bd37cccb..62cb4a0b79b1 100644 --- a/crates/router/src/routes/payments.rs +++ b/crates/router/src/routes/payments.rs @@ -125,11 +125,11 @@ pub async fn payments_create_intent( json_payload.into_inner(), |state, auth: auth::AuthenticationDataV2, req, req_state| { payments::payments_intent_core::< - api_types::CreateIntent, - payment_types::PaymentsCreateIntentResponse, + api_types::PaymentCreateIntent, + payment_types::PaymentsIntentResponse, _, _, - PaymentIntentData, + PaymentIntentData, >( state, req_state, @@ -156,6 +156,57 @@ pub async fn payments_create_intent( .await } +#[cfg(feature = "v2")] +#[instrument(skip_all, fields(flow = ?Flow::PaymentsGetIntent, payment_id))] +pub async fn payments_get_intent( + state: web::Data, + req: actix_web::HttpRequest, + path: web::Path, +) -> impl Responder { + use api_models::payments::PaymentsGetIntentRequest; + use hyperswitch_domain_models::payments::PaymentIntentData; + + let flow = Flow::PaymentsGetIntent; + let header_payload = match HeaderPayload::foreign_try_from(req.headers()) { + Ok(headers) => headers, + Err(err) => { + return api::log_and_return_error_response(err); + } + }; + + let payload = PaymentsGetIntentRequest { + id: path.into_inner(), + }; + + Box::pin(api::server_wrap( + flow, + state, + &req, + payload, + |state, auth: auth::AuthenticationDataV2, req, req_state| { + payments::payments_intent_core::< + api_types::PaymentGetIntent, + payment_types::PaymentsIntentResponse, + _, + _, + PaymentIntentData, + >( + state, + req_state, + auth.merchant_account, + auth.profile, + auth.key_store, + payments::operations::PaymentGetIntent, + req, + header_payload.clone(), + ) + }, + &auth::HeaderAuth(auth::ApiKeyAuth), + api_locking::LockAction::NotApplicable, + )) + .await +} + #[cfg(feature = "v1")] #[instrument(skip(state, req), fields(flow = ?Flow::PaymentsStart, payment_id))] pub async fn payments_start( diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs index 02d4950a47d8..2cf8b721a057 100644 --- a/crates/router/src/services/api.rs +++ b/crates/router/src/services/api.rs @@ -1259,10 +1259,8 @@ impl Authenticate for api_models::payments::PaymentsIncrementalAuthorizationRequ impl Authenticate for api_models::payments::PaymentsStartRequest {} // impl Authenticate for api_models::payments::PaymentsApproveRequest {} impl Authenticate for api_models::payments::PaymentsRejectRequest {} -#[cfg(feature = "v2")] -impl Authenticate for api_models::payments::PaymentsCreateIntentRequest {} // #[cfg(feature = "v2")] -// impl Authenticate for api_models::payments::PaymentsCreateIntentResponse {} +// impl Authenticate for api_models::payments::PaymentsIntentResponse {} pub fn build_redirection_form( form: &RedirectForm, diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rs index fc13cc6a22b6..57ef1d3336f5 100644 --- a/crates/router/src/types/api/payments.rs +++ b/crates/router/src/types/api/payments.rs @@ -19,13 +19,13 @@ pub use api_models::payments::{ VerifyResponse, WalletData, }; #[cfg(feature = "v2")] -pub use api_models::payments::{PaymentsCreateIntentRequest, PaymentsCreateIntentResponse}; +pub use api_models::payments::{PaymentsCreateIntentRequest, PaymentsIntentResponse}; use error_stack::ResultExt; pub use hyperswitch_domain_models::router_flow_types::payments::{ Approve, Authorize, AuthorizeSessionToken, Balance, CalculateTax, Capture, CompleteAuthorize, - CreateConnectorCustomer, CreateIntent, IncrementalAuthorization, InitPayment, PSync, - PaymentMethodToken, PostProcessing, PostSessionTokens, PreProcessing, Reject, SdkSessionUpdate, - Session, SetupMandate, Void, + CreateConnectorCustomer, IncrementalAuthorization, InitPayment, PSync, PaymentCreateIntent, + PaymentGetIntent, PaymentMethodToken, PostProcessing, PostSessionTokens, PreProcessing, Reject, + SdkSessionUpdate, Session, SetupMandate, Void, }; pub use hyperswitch_interfaces::api::payments::{ ConnectorCustomer, MandateSetup, Payment, PaymentApprove, PaymentAuthorize, diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs index 652ce2b81dbc..2410be9750cb 100644 --- a/crates/router_env/src/logger/types.rs +++ b/crates/router_env/src/logger/types.rs @@ -171,6 +171,8 @@ pub enum Flow { PaymentsAggregate, /// Payments Create Intent flow PaymentsCreateIntent, + /// Payments Get Intent flow + PaymentsGetIntent, #[cfg(feature = "payouts")] /// Payouts create flow PayoutsCreate, From 37513e0f1e78f99da0accf0fee263c10ca4e03c6 Mon Sep 17 00:00:00 2001 From: awasthi21 <107559116+awasthi21@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:32:59 +0530 Subject: [PATCH 9/9] feat(connector): [Paybox] Add mandates Flow for Paybox (#6378) --- crates/api_models/src/payments.rs | 57 +++- crates/common_utils/src/lib.rs | 5 + crates/diesel_models/src/payment_attempt.rs | 12 +- .../connectors/deutschebank/transformers.rs | 3 +- .../src/connectors/fiuu/transformers.rs | 2 + .../src/connectors/nexinets/transformers.rs | 1 + .../src/connectors/novalnet/transformers.rs | 4 +- .../src/connectors/payeezy/transformers.rs | 3 +- crates/hyperswitch_connectors/src/utils.rs | 2 +- .../src/payments/payment_attempt.rs | 3 + .../src/router_data.rs | 2 + .../src/router_request_types.rs | 3 +- .../src/router_response_types.rs | 1 + .../router/src/connector/aci/transformers.rs | 1 + .../src/connector/adyen/transformers.rs | 7 +- .../connector/authorizedotnet/transformers.rs | 4 +- .../src/connector/bamboraapac/transformers.rs | 2 + .../connector/bankofamerica/transformers.rs | 2 + .../src/connector/braintree/transformers.rs | 4 + .../src/connector/cybersource/transformers.rs | 2 + .../src/connector/globalpay/transformers.rs | 3 +- .../src/connector/gocardless/transformers.rs | 2 + .../connector/multisafepay/transformers.rs | 5 +- .../router/src/connector/noon/transformers.rs | 1 + .../src/connector/nuvei/transformers.rs | 1 + crates/router/src/connector/paybox.rs | 17 +- .../src/connector/paybox/transformers.rs | 249 +++++++++++++++++- .../src/connector/payme/transformers.rs | 1 + .../src/connector/stripe/transformers.rs | 5 +- crates/router/src/connector/utils.rs | 38 ++- .../src/connector/wellsfargo/transformers.rs | 2 + crates/router/src/consts.rs | 3 + .../src/core/authentication/transformers.rs | 1 + .../core/fraud_check/flows/checkout_flow.rs | 1 + .../fraud_check/flows/fulfillment_flow.rs | 1 + .../core/fraud_check/flows/record_return.rs | 1 + .../src/core/fraud_check/flows/sale_flow.rs | 1 + .../fraud_check/flows/transaction_flow.rs | 1 + crates/router/src/core/mandate/utils.rs | 1 + crates/router/src/core/payments.rs | 27 +- crates/router/src/core/payments/helpers.rs | 1 + .../payments/operations/payment_confirm.rs | 100 ++++--- .../payments/operations/payment_create.rs | 84 ++++-- .../payments/operations/payment_response.rs | 64 ++++- .../payments/operations/payment_update.rs | 8 +- .../router/src/core/payments/tokenization.rs | 65 +++-- .../router/src/core/payments/transformers.rs | 57 +++- crates/router/src/core/utils.rs | 8 + crates/router/src/core/webhooks/utils.rs | 1 + .../router/src/services/conversion_impls.rs | 1 + crates/router/src/types.rs | 5 + .../router/src/types/api/verify_connector.rs | 2 + .../src/types/storage/payment_method.rs | 1 + crates/router/tests/connectors/aci.rs | 2 + crates/router/tests/connectors/utils.rs | 2 + 55 files changed, 729 insertions(+), 153 deletions(-) diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index ceb2b654871c..777cabe30025 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -1316,12 +1316,59 @@ pub struct NetworkTokenWithNTIRef { #[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq)] pub struct ConnectorMandateReferenceId { - pub connector_mandate_id: Option, - pub payment_method_id: Option, - pub update_history: Option>, - pub mandate_metadata: Option, -} + connector_mandate_id: Option, + payment_method_id: Option, + update_history: Option>, + mandate_metadata: Option, + connector_mandate_request_reference_id: Option, +} + +impl ConnectorMandateReferenceId { + pub fn new( + connector_mandate_id: Option, + payment_method_id: Option, + update_history: Option>, + mandate_metadata: Option, + connector_mandate_request_reference_id: Option, + ) -> Self { + Self { + connector_mandate_id, + payment_method_id, + update_history, + mandate_metadata, + connector_mandate_request_reference_id, + } + } + pub fn get_connector_mandate_id(&self) -> Option { + self.connector_mandate_id.clone() + } + pub fn get_payment_method_id(&self) -> Option { + self.payment_method_id.clone() + } + pub fn get_mandate_metadata(&self) -> Option { + self.mandate_metadata.clone() + } + pub fn get_connector_mandate_request_reference_id(&self) -> Option { + self.connector_mandate_request_reference_id.clone() + } + + pub fn update( + &mut self, + connector_mandate_id: Option, + payment_method_id: Option, + update_history: Option>, + mandate_metadata: Option, + connector_mandate_request_reference_id: Option, + ) { + self.connector_mandate_id = connector_mandate_id.or(self.connector_mandate_id.clone()); + self.payment_method_id = payment_method_id.or(self.payment_method_id.clone()); + self.update_history = update_history.or(self.update_history.clone()); + self.mandate_metadata = mandate_metadata.or(self.mandate_metadata.clone()); + self.connector_mandate_request_reference_id = connector_mandate_request_reference_id + .or(self.connector_mandate_request_reference_id.clone()); + } +} #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)] pub struct UpdateHistory { pub connector_mandate_id: Option, diff --git a/crates/common_utils/src/lib.rs b/crates/common_utils/src/lib.rs index 923bdf89c026..463ec3ee1b67 100644 --- a/crates/common_utils/src/lib.rs +++ b/crates/common_utils/src/lib.rs @@ -270,6 +270,11 @@ pub fn generate_time_ordered_id_without_prefix() -> String { uuid::Uuid::now_v7().as_simple().to_string() } +/// Generate a nanoid with the specified length +#[inline] +pub fn generate_id_with_len(length: usize) -> String { + nanoid::nanoid!(length, &consts::ALPHABETS) +} #[allow(missing_docs)] pub trait DbConnectionParams { fn get_username(&self) -> &str; diff --git a/crates/diesel_models/src/payment_attempt.rs b/crates/diesel_models/src/payment_attempt.rs index ae4722a6f37e..f8654d3cd963 100644 --- a/crates/diesel_models/src/payment_attempt.rs +++ b/crates/diesel_models/src/payment_attempt.rs @@ -21,7 +21,15 @@ pub struct ConnectorMandateReferenceId { pub connector_mandate_id: Option, pub payment_method_id: Option, pub mandate_metadata: Option, + pub connector_mandate_request_reference_id: Option, } + +impl ConnectorMandateReferenceId { + pub fn get_connector_mandate_request_reference_id(&self) -> Option { + self.connector_mandate_request_reference_id.clone() + } +} + #[cfg(feature = "v2")] #[derive( Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Serialize, Deserialize, Selectable, @@ -414,6 +422,7 @@ pub enum PaymentAttemptUpdate { customer_acceptance: Option, shipping_cost: Option, order_tax_amount: Option, + connector_mandate_detail: Option, }, VoidUpdate { status: storage_enums::AttemptStatus, @@ -2158,6 +2167,7 @@ impl From for PaymentAttemptUpdateInternal { customer_acceptance, shipping_cost, order_tax_amount, + connector_mandate_detail, } => Self { amount: Some(amount), currency: Some(currency), @@ -2209,7 +2219,7 @@ impl From for PaymentAttemptUpdateInternal { shipping_cost, order_tax_amount, connector_transaction_data: None, - connector_mandate_detail: None, + connector_mandate_detail, }, PaymentAttemptUpdate::VoidUpdate { status, diff --git a/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs b/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs index ccecdaa3d415..9dd842768f19 100644 --- a/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs @@ -176,7 +176,7 @@ impl TryFrom<&DeutschebankRouterData<&PaymentsAuthorizeRouterData>> } Some(api_models::payments::MandateReferenceId::ConnectorMandateId(mandate_data)) => { let mandate_metadata: DeutschebankMandateMetadata = mandate_data - .mandate_metadata + .get_mandate_metadata() .ok_or(errors::ConnectorError::MissingConnectorMandateMetadata)? .clone() .parse_value("DeutschebankMandateMetadata") @@ -325,6 +325,7 @@ impl reference: Secret::from(reference.clone()), signed_on, })), + connector_mandate_request_reference_id: None, })) } else { Box::new(None) diff --git a/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs b/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs index 7c346bd86cc5..3639a7db4c8d 100644 --- a/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs @@ -809,6 +809,7 @@ impl connector_mandate_id: Some(token.clone().expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }) }); let status = match non_threeds_data.status.as_str() { @@ -1184,6 +1185,7 @@ impl TryFrom> for PaymentsSy connector_mandate_id: Some(token.clone().expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id:None }) } Err(err) => { diff --git a/crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs index 4761581401f0..4149f740e76d 100644 --- a/crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs @@ -360,6 +360,7 @@ impl TryFrom> for NovalnetPaym .into()), }, Some(api_models::payments::MandateReferenceId::ConnectorMandateId(mandate_data)) => { - let connector_mandate_id = mandate_data.connector_mandate_id.ok_or( + let connector_mandate_id = mandate_data.get_connector_mandate_id().ok_or( errors::ConnectorError::MissingRequiredField { field_name: "connector_mandate_id", }, @@ -597,6 +597,7 @@ impl TryFrom connector_mandate_id: Some(id.clone()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, } })), connector_metadata: None, diff --git a/crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs b/crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs index af29d54117a0..707e34a158c5 100644 --- a/crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs @@ -185,7 +185,7 @@ fn get_transaction_type_and_stored_creds( match mandate_ids.mandate_reference_id.clone() { Some(api_models::payments::MandateReferenceId::ConnectorMandateId( connector_mandate_ids, - )) => connector_mandate_ids.connector_mandate_id, + )) => connector_mandate_ids.get_connector_mandate_id(), _ => None, } }); @@ -420,6 +420,7 @@ impl TryFrom { - connector_mandate_ids.connector_mandate_id.clone() + connector_mandate_ids.get_connector_mandate_id() } Some(payments::MandateReferenceId::NetworkMandateId(_)) | None diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs index 4b3fd1f8cf9f..831e97b54a17 100644 --- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs +++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs @@ -787,6 +787,7 @@ pub enum PaymentAttemptUpdate { client_source: Option, client_version: Option, customer_acceptance: Option, + connector_mandate_detail: Option, }, RejectUpdate { status: storage_enums::AttemptStatus, @@ -1027,6 +1028,7 @@ impl PaymentAttemptUpdate { client_source, client_version, customer_acceptance, + connector_mandate_detail, } => DieselPaymentAttemptUpdate::ConfirmUpdate { amount: net_amount.get_order_amount(), currency, @@ -1060,6 +1062,7 @@ impl PaymentAttemptUpdate { customer_acceptance, shipping_cost: net_amount.get_shipping_cost(), order_tax_amount: net_amount.get_order_tax_amount(), + connector_mandate_detail, }, Self::VoidUpdate { status, diff --git a/crates/hyperswitch_domain_models/src/router_data.rs b/crates/hyperswitch_domain_models/src/router_data.rs index ba76cc533ca4..186a4f012629 100644 --- a/crates/hyperswitch_domain_models/src/router_data.rs +++ b/crates/hyperswitch_domain_models/src/router_data.rs @@ -84,6 +84,8 @@ pub struct RouterData { pub additional_merchant_data: Option, pub header_payload: Option, + + pub connector_mandate_request_reference_id: Option, } // Different patterns of authentication. diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs index 5878a28f40d7..d20ac148b706 100644 --- a/crates/hyperswitch_domain_models/src/router_request_types.rs +++ b/crates/hyperswitch_domain_models/src/router_request_types.rs @@ -1,6 +1,6 @@ pub mod authentication; pub mod fraud_check; -use api_models::payments::{Address, RequestSurchargeDetails}; +use api_models::payments::{AdditionalPaymentData, Address, RequestSurchargeDetails}; use common_utils::{ consts, errors, ext_traits::OptionExt, @@ -72,6 +72,7 @@ pub struct PaymentsAuthorizeData { pub merchant_order_reference_id: Option, pub integrity_object: Option, pub shipping_cost: Option, + pub additional_payment_method_data: Option, } #[derive(Debug, Clone)] diff --git a/crates/hyperswitch_domain_models/src/router_response_types.rs b/crates/hyperswitch_domain_models/src/router_response_types.rs index 2ed77c8072d2..6356301c7264 100644 --- a/crates/hyperswitch_domain_models/src/router_response_types.rs +++ b/crates/hyperswitch_domain_models/src/router_response_types.rs @@ -83,6 +83,7 @@ pub struct MandateReference { pub connector_mandate_id: Option, pub payment_method_id: Option, pub mandate_metadata: Option, + pub connector_mandate_request_reference_id: Option, } #[derive(Debug, Clone)] diff --git a/crates/router/src/connector/aci/transformers.rs b/crates/router/src/connector/aci/transformers.rs index 7355617b53ae..77598f7be381 100644 --- a/crates/router/src/connector/aci/transformers.rs +++ b/crates/router/src/connector/aci/transformers.rs @@ -749,6 +749,7 @@ impl connector_mandate_id: Some(id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }); Ok(Self { diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs index bc75fd29c02c..95ac2a67a533 100644 --- a/crates/router/src/connector/adyen/transformers.rs +++ b/crates/router/src/connector/adyen/transformers.rs @@ -14,7 +14,7 @@ use time::{Duration, OffsetDateTime, PrimitiveDateTime}; use crate::{connector::utils::PayoutsData, types::api::payouts, utils::OptionExt}; use crate::{ connector::utils::{ - self, AddressDetailsData, BrowserInformationData, CardData, MandateReferenceData, + self, missing_field_err, AddressDetailsData, BrowserInformationData, CardData, PaymentsAuthorizeRequestData, PhoneDetailsData, RouterData, }, consts, @@ -2573,7 +2573,9 @@ impl<'a> None => PaymentType::Scheme, }, stored_payment_method_id: Secret::new( - connector_mandate_ids.get_connector_mandate_id()?, + connector_mandate_ids + .get_connector_mandate_id() + .ok_or_else(missing_field_err("mandate_id"))?, ), }; Ok::, Self::Error>(AdyenPaymentMethod::Mandate(Box::new( @@ -3365,6 +3367,7 @@ pub fn get_adyen_response( connector_mandate_id: Some(mandate_id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }); let network_txn_id = response.additional_data.and_then(|additional_data| { additional_data diff --git a/crates/router/src/connector/authorizedotnet/transformers.rs b/crates/router/src/connector/authorizedotnet/transformers.rs index 6961a87326b1..c9427683d883 100644 --- a/crates/router/src/connector/authorizedotnet/transformers.rs +++ b/crates/router/src/connector/authorizedotnet/transformers.rs @@ -399,6 +399,7 @@ impl ), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }, )), connector_metadata: None, @@ -647,7 +648,7 @@ impl ), ) -> Result { let mandate_id = connector_mandate_id - .connector_mandate_id + .get_connector_mandate_id() .ok_or(errors::ConnectorError::MissingConnectorMandateID)?; Ok(Self { transaction_type: TransactionType::try_from(item.router_data.request.capture_method)?, @@ -1113,6 +1114,7 @@ impl ), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, } }); diff --git a/crates/router/src/connector/bamboraapac/transformers.rs b/crates/router/src/connector/bamboraapac/transformers.rs index 8fcbcd98f090..1a254c052a49 100644 --- a/crates/router/src/connector/bamboraapac/transformers.rs +++ b/crates/router/src/connector/bamboraapac/transformers.rs @@ -281,6 +281,7 @@ impl connector_mandate_id, payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }) } else { None @@ -465,6 +466,7 @@ impl connector_mandate_id: Some(connector_mandate_id), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, })), connector_metadata: None, network_txn_id: None, diff --git a/crates/router/src/connector/bankofamerica/transformers.rs b/crates/router/src/connector/bankofamerica/transformers.rs index b5669decd867..c6490cd61398 100644 --- a/crates/router/src/connector/bankofamerica/transformers.rs +++ b/crates/router/src/connector/bankofamerica/transformers.rs @@ -362,6 +362,7 @@ impl .map(|payment_instrument| payment_instrument.id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, } }); let mut mandate_status = @@ -1512,6 +1513,7 @@ fn get_payment_response( .map(|payment_instrument| payment_instrument.id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }); Ok(types::PaymentsResponseData::TransactionResponse { diff --git a/crates/router/src/connector/braintree/transformers.rs b/crates/router/src/connector/braintree/transformers.rs index 948d6f2cfd30..f606e671a8d9 100644 --- a/crates/router/src/connector/braintree/transformers.rs +++ b/crates/router/src/connector/braintree/transformers.rs @@ -445,6 +445,7 @@ impl connector_mandate_id: Some(pm.id.clone().expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }, )), connector_metadata: None, @@ -620,6 +621,7 @@ impl connector_mandate_id: Some(pm.id.clone().expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }, )), connector_metadata: None, @@ -702,6 +704,7 @@ impl connector_mandate_id: Some(pm.id.clone().expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }, )), connector_metadata: None, @@ -766,6 +769,7 @@ impl connector_mandate_id: Some(pm.id.clone().expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }, )), connector_metadata: None, diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rs index 4331b4d79832..c187dcb6dfc4 100644 --- a/crates/router/src/connector/cybersource/transformers.rs +++ b/crates/router/src/connector/cybersource/transformers.rs @@ -2555,6 +2555,7 @@ fn get_payment_response( .map(|payment_instrument| payment_instrument.id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }); Ok(types::PaymentsResponseData::TransactionResponse { @@ -3283,6 +3284,7 @@ impl .map(|payment_instrument| payment_instrument.id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }); let mut mandate_status = enums::AttemptStatus::foreign_from(( item.response diff --git a/crates/router/src/connector/globalpay/transformers.rs b/crates/router/src/connector/globalpay/transformers.rs index d17c8a8fdfdb..8008cc309c27 100644 --- a/crates/router/src/connector/globalpay/transformers.rs +++ b/crates/router/src/connector/globalpay/transformers.rs @@ -262,6 +262,7 @@ fn get_payment_response( connector_mandate_id: Some(id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }) }); match status { @@ -472,7 +473,7 @@ fn get_mandate_details(item: &types::PaymentsAuthorizeRouterData) -> Result connector_mandate_ids.connector_mandate_id, + )) => connector_mandate_ids.get_connector_mandate_id(), _ => None, } }); diff --git a/crates/router/src/connector/gocardless/transformers.rs b/crates/router/src/connector/gocardless/transformers.rs index dac90b283664..6a8fe01eede5 100644 --- a/crates/router/src/connector/gocardless/transformers.rs +++ b/crates/router/src/connector/gocardless/transformers.rs @@ -516,6 +516,7 @@ impl connector_mandate_id: Some(item.response.mandates.id.clone().expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }); Ok(Self { response: Ok(types::PaymentsResponseData::TransactionResponse { @@ -669,6 +670,7 @@ impl connector_mandate_id: Some(item.data.request.get_connector_mandate_id()?), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }; Ok(Self { status: enums::AttemptStatus::from(item.response.payments.status), diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index 2831b63fcbe0..6a227cffb37b 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -830,7 +830,9 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> .and_then(|mandate_ids| match mandate_ids.mandate_reference_id { Some(api_models::payments::MandateReferenceId::ConnectorMandateId( connector_mandate_ids, - )) => connector_mandate_ids.connector_mandate_id.map(Secret::new), + )) => connector_mandate_ids + .get_connector_mandate_id() + .map(Secret::new), _ => None, }), days_active: Some(30), @@ -989,6 +991,7 @@ impl connector_mandate_id: Some(id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }), ), connector_metadata: None, diff --git a/crates/router/src/connector/noon/transformers.rs b/crates/router/src/connector/noon/transformers.rs index 634a9feccf38..4556121db239 100644 --- a/crates/router/src/connector/noon/transformers.rs +++ b/crates/router/src/connector/noon/transformers.rs @@ -577,6 +577,7 @@ impl connector_mandate_id: Some(subscription_data.identifier.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }); Ok(Self { status, diff --git a/crates/router/src/connector/nuvei/transformers.rs b/crates/router/src/connector/nuvei/transformers.rs index 68c25f58acb9..209d1a7476f6 100644 --- a/crates/router/src/connector/nuvei/transformers.rs +++ b/crates/router/src/connector/nuvei/transformers.rs @@ -1607,6 +1607,7 @@ where connector_mandate_id: Some(id), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }), ), // we don't need to save session token for capture, void flow so ignoring if it is not present diff --git a/crates/router/src/connector/paybox.rs b/crates/router/src/connector/paybox.rs index a251679be85b..dd54e185dac3 100644 --- a/crates/router/src/connector/paybox.rs +++ b/crates/router/src/connector/paybox.rs @@ -11,7 +11,7 @@ use super::utils::{ }; use crate::{ configs::settings, - connector::utils, + connector::{utils, utils::PaymentMethodDataType}, core::{ errors::{self, CustomResult}, payments, @@ -60,6 +60,13 @@ impl api::PaymentsCompleteAuthorize for Paybox {} impl ConnectorIntegration for Paybox { + fn build_request( + &self, + _req: &types::PaymentsCancelRouterData, + _connectors: &settings::Connectors, + ) -> CustomResult, errors::ConnectorError> { + Err(errors::ConnectorError::NotImplemented("Cancel/Void flow".to_string()).into()) + } } impl @@ -151,6 +158,14 @@ impl ConnectorValidation for Paybox { ), } } + fn validate_mandate_payment( + &self, + pm_type: Option, + pm_data: types::domain::payments::PaymentMethodData, + ) -> CustomResult<(), errors::ConnectorError> { + let mandate_supported_pmd = std::collections::HashSet::from([PaymentMethodDataType::Card]); + connector_utils::is_mandate_supported(pm_data, pm_type, mandate_supported_pmd, self.id()) + } } impl ConnectorIntegration diff --git a/crates/router/src/connector/paybox/transformers.rs b/crates/router/src/connector/paybox/transformers.rs index b52a6e463f63..4b9c25f6dba6 100644 --- a/crates/router/src/connector/paybox/transformers.rs +++ b/crates/router/src/connector/paybox/transformers.rs @@ -1,3 +1,4 @@ +use api_models::payments::AdditionalPaymentData; use bytes::Bytes; use common_utils::{ date_time::DateFormat, errors::CustomResult, ext_traits::ValueExt, types::MinorUnit, @@ -8,7 +9,7 @@ use hyperswitch_domain_models::{ router_data::ConnectorAuthType, router_response_types::RedirectForm, }; use hyperswitch_interfaces::consts; -use masking::{PeekInterface, Secret}; +use masking::{ExposeInterface, PeekInterface, Secret}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use crate::{ @@ -16,7 +17,7 @@ use crate::{ self, PaymentsAuthorizeRequestData, PaymentsCompleteAuthorizeRequestData, RouterData, }, core::errors, - types::{self, api, domain, storage::enums}, + types::{self, api, domain, storage::enums, MandateReference}, }; pub struct PayboxRouterData { @@ -42,6 +43,10 @@ const SUCCESS_CODE: &str = "00000"; const VERSION_PAYBOX: &str = "00104"; const PAY_ORIGIN_INTERNET: &str = "024"; const THREE_DS_FAIL_CODE: &str = "00000000"; +const RECURRING_ORIGIN: &str = "027"; +const MANDATE_REQUEST: &str = "00056"; +const MANDATE_AUTH_ONLY: &str = "00051"; +const MANDATE_AUTH_AND_CAPTURE_ONLY: &str = "00053"; type Error = error_stack::Report; @@ -50,6 +55,13 @@ type Error = error_stack::Report; pub enum PayboxPaymentsRequest { Card(PaymentsRequest), CardThreeDs(ThreeDSPaymentsRequest), + Mandate(MandatePaymentRequest), +} + +#[derive(Debug, Serialize)] +pub struct CardMandateInfo { + pub card_exp_month: Secret, + pub card_exp_year: Secret, } #[derive(Debug, Serialize)] @@ -99,6 +111,10 @@ pub struct PaymentsRequest { #[serde(rename = "ID3D")] #[serde(skip_serializing_if = "Option::is_none")] pub three_ds_data: Option>, + + #[serde(rename = "REFABONNE")] + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_id: Option>, } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "PascalCase")] @@ -367,8 +383,10 @@ impl TryFrom<&PayboxRouterData<&types::PaymentsAuthorizeRouterData>> for PayboxP let auth_data: PayboxAuthType = PayboxAuthType::try_from(&item.router_data.connector_auth_type) .change_context(errors::ConnectorError::FailedToObtainAuthType)?; - let transaction_type = - get_transaction_type(item.router_data.request.capture_method)?; + let transaction_type = get_transaction_type( + item.router_data.request.capture_method, + item.router_data.request.is_mandate_payment(), + )?; let currency = diesel_models::enums::Currency::iso_4217(&item.router_data.request.currency) .to_string(); @@ -420,18 +438,80 @@ impl TryFrom<&PayboxRouterData<&types::PaymentsAuthorizeRouterData>> for PayboxP rank: auth_data.rang, key: auth_data.cle, three_ds_data: None, + customer_id: match item.router_data.request.is_mandate_payment() { + true => { + let reference_id = item + .router_data + .connector_mandate_request_reference_id + .clone() + .ok_or_else(|| { + errors::ConnectorError::MissingRequiredField { + field_name: "connector_mandate_request_reference_id", + } + })?; + Some(Secret::new(reference_id)) + } + false => None, + }, })) } } + domain::PaymentMethodData::MandatePayment => { + let mandate_data = extract_card_mandate_info( + item.router_data + .request + .additional_payment_method_data + .clone(), + )?; + Ok(Self::Mandate(MandatePaymentRequest::try_from(( + item, + mandate_data, + ))?)) + } _ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()), } } } -fn get_transaction_type(capture_method: Option) -> Result { - match capture_method { - Some(enums::CaptureMethod::Automatic) | None => Ok(AUTH_AND_CAPTURE_REQUEST.to_string()), - Some(enums::CaptureMethod::Manual) => Ok(AUTH_REQUEST.to_string()), +fn extract_card_mandate_info( + additional_payment_method_data: Option, +) -> Result { + match additional_payment_method_data { + Some(AdditionalPaymentData::Card(card_data)) => Ok(CardMandateInfo { + card_exp_month: card_data.card_exp_month.clone().ok_or_else(|| { + errors::ConnectorError::MissingRequiredField { + field_name: "card_exp_month", + } + })?, + card_exp_year: card_data.card_exp_year.clone().ok_or_else(|| { + errors::ConnectorError::MissingRequiredField { + field_name: "card_exp_year", + } + })?, + }), + _ => Err(errors::ConnectorError::MissingRequiredFields { + field_names: vec!["card_exp_month", "card_exp_year"], + } + .into()), + } +} + +fn get_transaction_type( + capture_method: Option, + is_mandate_request: bool, +) -> Result { + match (capture_method, is_mandate_request) { + (Some(enums::CaptureMethod::Automatic), false) | (None, false) => { + Ok(AUTH_AND_CAPTURE_REQUEST.to_string()) + } + (Some(enums::CaptureMethod::Automatic), true) | (None, true) => { + Err(errors::ConnectorError::NotSupported { + message: "Capture Not allowed in case of Creating the Subscriber".to_string(), + connector: "Paybox", + })? + } + (Some(enums::CaptureMethod::Manual), false) => Ok(AUTH_REQUEST.to_string()), + (Some(enums::CaptureMethod::Manual), true) => Ok(MANDATE_REQUEST.to_string()), _ => Err(errors::ConnectorError::CaptureMethodNotSupported)?, } } @@ -499,6 +579,11 @@ pub struct TransactionResponse { #[serde(rename = "COMMENTAIRE")] pub response_message: String, + #[serde(rename = "PORTEUR")] + pub carrier_id: Option>, + + #[serde(rename = "REFABONNE")] + pub customer_id: Option>, } pub fn parse_url_encoded_to_struct( @@ -658,7 +743,15 @@ impl response.paybox_order_id, ), redirection_data: Box::new(None), - mandate_reference: Box::new(None), + mandate_reference: Box::new(response.carrier_id.as_ref().map( + |pm: &Secret| MandateReference { + connector_mandate_id: Some(pm.clone().expose()), + payment_method_id: None, + mandate_metadata: None, + connector_mandate_request_reference_id: + response.customer_id.map(|secret| secret.expose()), + }, + )), connector_metadata: Some(serde_json::json!(PayboxMeta { connector_request_id: response.transaction_number.clone() })), @@ -917,7 +1010,16 @@ impl response.paybox_order_id, ), redirection_data: Box::new(None), - mandate_reference: Box::new(None), + mandate_reference: Box::new(response.carrier_id.as_ref().map(|pm| { + MandateReference { + connector_mandate_id: Some(pm.clone().expose()), + payment_method_id: None, + mandate_metadata: None, + connector_mandate_request_reference_id: response + .customer_id + .map(|secret| secret.expose()), + } + })), connector_metadata: Some(serde_json::json!(PayboxMeta { connector_request_id: response.transaction_number.clone() })), @@ -973,8 +1075,10 @@ impl TryFrom<&PayboxRouterData<&types::PaymentsCompleteAuthorizeRouterData>> for let auth_data: PayboxAuthType = PayboxAuthType::try_from(&item.router_data.connector_auth_type) .change_context(errors::ConnectorError::FailedToObtainAuthType)?; - let transaction_type = - get_transaction_type(item.router_data.request.capture_method)?; + let transaction_type = get_transaction_type( + item.router_data.request.capture_method, + item.router_data.request.is_mandate_payment(), + )?; let currency = diesel_models::enums::Currency::iso_4217(&item.router_data.request.currency) .to_string(); @@ -1004,9 +1108,130 @@ impl TryFrom<&PayboxRouterData<&types::PaymentsCompleteAuthorizeRouterData>> for || Some(Secret::new(THREE_DS_FAIL_CODE.to_string())), |data| Some(data.clone()), ), + customer_id: match item.router_data.request.is_mandate_payment() { + true => Some(Secret::new(item.router_data.payment_id.clone())), + false => None, + }, }) } _ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()), } } } + +#[derive(Debug, Serialize)] +pub struct MandatePaymentRequest { + #[serde(rename = "DATEQ")] + pub date: String, + + #[serde(rename = "TYPE")] + pub transaction_type: String, + + #[serde(rename = "NUMQUESTION")] + pub paybox_request_number: String, + + #[serde(rename = "MONTANT")] + pub amount: MinorUnit, + + #[serde(rename = "REFERENCE")] + pub description_reference: String, + + #[serde(rename = "VERSION")] + pub version: String, + + #[serde(rename = "DEVISE")] + pub currency: String, + + #[serde(rename = "ACTIVITE")] + pub activity: String, + + #[serde(rename = "SITE")] + pub site: Secret, + + #[serde(rename = "RANG")] + pub rank: Secret, + + #[serde(rename = "CLE")] + pub key: Secret, + + #[serde(rename = "DATEVAL")] + pub cc_exp_date: Secret, + + #[serde(rename = "REFABONNE")] + pub customer_id: Secret, + + #[serde(rename = "PORTEUR")] + pub carrier_id: Secret, +} + +impl + TryFrom<( + &PayboxRouterData<&types::PaymentsAuthorizeRouterData>, + CardMandateInfo, + )> for MandatePaymentRequest +{ + type Error = error_stack::Report; + fn try_from( + (item, card_mandate_info): ( + &PayboxRouterData<&types::PaymentsAuthorizeRouterData>, + CardMandateInfo, + ), + ) -> Result { + let auth_data: PayboxAuthType = + PayboxAuthType::try_from(&item.router_data.connector_auth_type) + .change_context(errors::ConnectorError::FailedToObtainAuthType)?; + let transaction_type = match item.router_data.request.capture_method { + Some(enums::CaptureMethod::Automatic) | None => { + Ok(MANDATE_AUTH_AND_CAPTURE_ONLY.to_string()) + } + Some(enums::CaptureMethod::Manual) => Ok(MANDATE_AUTH_ONLY.to_string()), + _ => Err(errors::ConnectorError::CaptureMethodNotSupported), + }?; + let currency = diesel_models::enums::Currency::iso_4217(&item.router_data.request.currency) + .to_string(); + let format_time = common_utils::date_time::format_date( + common_utils::date_time::now(), + DateFormat::DDMMYYYYHHmmss, + ) + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + Ok(Self { + date: format_time.clone(), + transaction_type, + paybox_request_number: get_paybox_request_number()?, + amount: item.router_data.request.minor_amount, + description_reference: item.router_data.connector_request_reference_id.clone(), + version: VERSION_PAYBOX.to_string(), + currency, + activity: RECURRING_ORIGIN.to_string(), + site: auth_data.site, + rank: auth_data.rang, + key: auth_data.cle, + customer_id: Secret::new( + item.router_data + .request + .get_connector_mandate_request_reference_id()?, + ), + carrier_id: Secret::new(item.router_data.request.get_connector_mandate_id()?), + cc_exp_date: get_card_expiry_month_year_2_digit( + card_mandate_info.card_exp_month.clone(), + card_mandate_info.card_exp_year.clone(), + )?, + }) + } +} + +fn get_card_expiry_month_year_2_digit( + card_exp_month: Secret, + card_exp_year: Secret, +) -> Result, errors::ConnectorError> { + let year_2_digit = card_exp_year + .peek() + .get(..2) + .ok_or(errors::ConnectorError::RequestEncodingFailed)? + .to_string(); + Ok(Secret::new(format!( + "{}{}", + card_exp_month.peek(), + year_2_digit + ))) +} diff --git a/crates/router/src/connector/payme/transformers.rs b/crates/router/src/connector/payme/transformers.rs index ceeafb50251f..2f8b78e281ad 100644 --- a/crates/router/src/connector/payme/transformers.rs +++ b/crates/router/src/connector/payme/transformers.rs @@ -252,6 +252,7 @@ impl TryFrom<&PaymePaySaleResponse> for types::PaymentsResponseData { connector_mandate_id: Some(buyer_key.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, } })), connector_metadata: None, diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index fe69f43777e5..af82bda3e6af 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -1709,7 +1709,7 @@ impl TryFrom<(&types::PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntent connector_mandate_ids, )) => ( None, - connector_mandate_ids.connector_mandate_id, + connector_mandate_ids.get_connector_mandate_id(), StripeBillingAddress::default(), get_payment_method_type_for_saved_payment_method_payment(item)?, ), @@ -2450,6 +2450,7 @@ impl connector_mandate_id, payment_method_id, mandate_metadata: None, + connector_mandate_request_reference_id: None, } }); @@ -2655,6 +2656,7 @@ impl connector_mandate_id, payment_method_id: Some(payment_method_id), mandate_metadata: None, + connector_mandate_request_reference_id: None, } }); @@ -2746,6 +2748,7 @@ impl connector_mandate_id, payment_method_id, mandate_metadata: None, + connector_mandate_request_reference_id: None, } }); let status = enums::AttemptStatus::from(item.response.status); diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs index 9e9e43734dbb..76def480cffe 100644 --- a/crates/router/src/connector/utils.rs +++ b/crates/router/src/connector/utils.rs @@ -713,7 +713,7 @@ impl PaymentsPreProcessingData for types::PaymentsPreProcessingData { .as_ref() .and_then(|mandate_ids| match &mandate_ids.mandate_reference_id { Some(payments::MandateReferenceId::ConnectorMandateId(connector_mandate_ids)) => { - connector_mandate_ids.connector_mandate_id.clone() + connector_mandate_ids.get_connector_mandate_id() } Some(payments::MandateReferenceId::NetworkMandateId(_)) | None @@ -799,6 +799,7 @@ pub trait PaymentsAuthorizeRequestData { fn get_total_surcharge_amount(&self) -> Option; fn get_metadata_as_object(&self) -> Option; fn get_authentication_data(&self) -> Result; + fn get_connector_mandate_request_reference_id(&self) -> Result; } pub trait PaymentMethodTokenizationRequestData { @@ -861,7 +862,7 @@ impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData { .as_ref() .and_then(|mandate_ids| match &mandate_ids.mandate_reference_id { Some(payments::MandateReferenceId::ConnectorMandateId(connector_mandate_ids)) => { - connector_mandate_ids.connector_mandate_id.clone() + connector_mandate_ids.get_connector_mandate_id() } Some(payments::MandateReferenceId::NetworkMandateId(_)) | None @@ -979,6 +980,21 @@ impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData { .clone() .ok_or_else(missing_field_err("authentication_data")) } + + /// Attempts to retrieve the connector mandate reference ID as a `Result`. + fn get_connector_mandate_request_reference_id(&self) -> Result { + self.mandate_id + .as_ref() + .and_then(|mandate_ids| match &mandate_ids.mandate_reference_id { + Some(payments::MandateReferenceId::ConnectorMandateId(connector_mandate_ids)) => { + connector_mandate_ids.get_connector_mandate_request_reference_id() + } + Some(payments::MandateReferenceId::NetworkMandateId(_)) + | None + | Some(payments::MandateReferenceId::NetworkTokenWithNTI(_)) => None, + }) + .ok_or_else(missing_field_err("connector_mandate_request_reference_id")) + } } pub trait ConnectorCustomerData { @@ -1058,6 +1074,7 @@ pub trait PaymentsCompleteAuthorizeRequestData { fn get_redirect_response_payload(&self) -> Result; fn get_complete_authorize_url(&self) -> Result; fn is_mandate_payment(&self) -> bool; + fn get_connector_mandate_request_reference_id(&self) -> Result; } impl PaymentsCompleteAuthorizeRequestData for types::CompleteAuthorizeData { @@ -1098,6 +1115,20 @@ impl PaymentsCompleteAuthorizeRequestData for types::CompleteAuthorizeData { .and_then(|mandate_ids| mandate_ids.mandate_reference_id.as_ref()) .is_some() } + /// Attempts to retrieve the connector mandate reference ID as a `Result`. + fn get_connector_mandate_request_reference_id(&self) -> Result { + self.mandate_id + .as_ref() + .and_then(|mandate_ids| match &mandate_ids.mandate_reference_id { + Some(payments::MandateReferenceId::ConnectorMandateId(connector_mandate_ids)) => { + connector_mandate_ids.get_connector_mandate_request_reference_id() + } + Some(payments::MandateReferenceId::NetworkMandateId(_)) + | None + | Some(payments::MandateReferenceId::NetworkTokenWithNTI(_)) => None, + }) + .ok_or_else(missing_field_err("connector_mandate_request_reference_id")) + } } pub trait PaymentsSyncRequestData { @@ -1924,8 +1955,7 @@ pub trait MandateReferenceData { impl MandateReferenceData for payments::ConnectorMandateReferenceId { fn get_connector_mandate_id(&self) -> Result { - self.connector_mandate_id - .clone() + self.get_connector_mandate_id() .ok_or_else(missing_field_err("mandate_id")) } } diff --git a/crates/router/src/connector/wellsfargo/transformers.rs b/crates/router/src/connector/wellsfargo/transformers.rs index 4dd455d0da30..1ca6c7bd9683 100644 --- a/crates/router/src/connector/wellsfargo/transformers.rs +++ b/crates/router/src/connector/wellsfargo/transformers.rs @@ -1787,6 +1787,7 @@ fn get_payment_response( .map(|payment_instrument| payment_instrument.id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }); Ok(types::PaymentsResponseData::TransactionResponse { @@ -1973,6 +1974,7 @@ impl .map(|payment_instrument| payment_instrument.id.expose()), payment_method_id: None, mandate_metadata: None, + connector_mandate_request_reference_id: None, }); let mut mandate_status = enums::AttemptStatus::foreign_from(( item.response diff --git a/crates/router/src/consts.rs b/crates/router/src/consts.rs index 6a5f5b88f45c..090ddca961ba 100644 --- a/crates/router/src/consts.rs +++ b/crates/router/src/consts.rs @@ -142,6 +142,9 @@ pub const DEFAULT_UNIFIED_ERROR_MESSAGE: &str = "Something went wrong"; // Recon's feature tag pub const RECON_FEATURE_TAG: &str = "RECONCILIATION AND SETTLEMENT"; +// Length of the unique reference ID generated for connector mandate requests +pub const CONNECTOR_MANDATE_REQUEST_REFERENCE_ID_LENGTH: usize = 18; + /// Vault Add request url #[cfg(all(feature = "v2", feature = "payment_methods_v2"))] pub const ADD_VAULT_REQUEST_URL: &str = "/vault/add"; diff --git a/crates/router/src/core/authentication/transformers.rs b/crates/router/src/core/authentication/transformers.rs index 6013cdbe97f7..6b8a378a0701 100644 --- a/crates/router/src/core/authentication/transformers.rs +++ b/crates/router/src/core/authentication/transformers.rs @@ -184,6 +184,7 @@ pub fn construct_router_data( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }) } diff --git a/crates/router/src/core/fraud_check/flows/checkout_flow.rs b/crates/router/src/core/fraud_check/flows/checkout_flow.rs index 87e76b2c5fb8..4249559aab6b 100644 --- a/crates/router/src/core/fraud_check/flows/checkout_flow.rs +++ b/crates/router/src/core/fraud_check/flows/checkout_flow.rs @@ -160,6 +160,7 @@ impl ConstructFlowSpecificData( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) } diff --git a/crates/router/src/core/fraud_check/flows/record_return.rs b/crates/router/src/core/fraud_check/flows/record_return.rs index f80f604daa40..3ef2b9232082 100644 --- a/crates/router/src/core/fraud_check/flows/record_return.rs +++ b/crates/router/src/core/fraud_check/flows/record_return.rs @@ -128,6 +128,7 @@ impl ConstructFlowSpecificData( connector_wallets_details: router_data.connector_wallets_details, additional_merchant_data: router_data.additional_merchant_data, header_payload: router_data.header_payload, + connector_mandate_request_reference_id: router_data.connector_mandate_request_reference_id, } } diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs index 3a66094081ef..1bd3ddce7351 100644 --- a/crates/router/src/core/payments/operations/payment_confirm.rs +++ b/crates/router/src/core/payments/operations/payment_confirm.rs @@ -1,16 +1,17 @@ use std::marker::PhantomData; +// use api_models::{admin::ExtendedCardInfoConfig, enums::FrmSuggestion, payments::ExtendedCardInfo}; +#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))] +use api_models::payment_methods::PaymentMethodsData; use api_models::{ admin::ExtendedCardInfoConfig, enums::FrmSuggestion, // payment_methods::PaymentMethodsData, - payments::{ExtendedCardInfo, GetAddressFromPaymentMethodData}, + payments::{ConnectorMandateReferenceId, ExtendedCardInfo, GetAddressFromPaymentMethodData}, }; -// use api_models::{admin::ExtendedCardInfoConfig, enums::FrmSuggestion, payments::ExtendedCardInfo}; -#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))] -use api_models::{payment_methods::PaymentMethodsData, payments::AdditionalPaymentData}; use async_trait::async_trait; use common_utils::ext_traits::{AsyncExt, Encode, StringExt, ValueExt}; +use diesel_models::payment_attempt::ConnectorMandateReferenceId as DieselConnectorMandateReferenceId; use error_stack::{report, ResultExt}; use futures::FutureExt; #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))] @@ -23,6 +24,7 @@ use tracing_futures::Instrument; use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest}; #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))] use crate::{ + consts, core::payment_methods::cards::create_encrypted_data, events::audit_events::{AuditEvent, AuditEventType}, }; @@ -45,6 +47,7 @@ use crate::{ api::{self, ConnectorCallType, PaymentIdTypeExt}, domain::{self}, storage::{self, enums as storage_enums}, + transformers::ForeignFrom, }, utils::{self, OptionExt}, }; @@ -573,6 +576,39 @@ impl GetTracker, api::PaymentsRequest> for Pa payment_method_info, } = mandate_details; + let additional_pm_data_from_locker = if let Some(ref pm) = payment_method_info { + let card_detail_from_locker: Option = pm + .payment_method_data + .clone() + .map(|x| x.into_inner().expose()) + .and_then(|v| { + v.parse_value("PaymentMethodsData") + .map_err(|err| { + router_env::logger::info!( + "PaymentMethodsData deserialization failed: {:?}", + err + ) + }) + .ok() + }) + .and_then(|pmd| match pmd { + PaymentMethodsData::Card(crd) => Some(api::CardDetailFromLocker::from(crd)), + _ => None, + }); + card_detail_from_locker.map(|card_details| { + let additional_data = card_details.into(); + api_models::payments::AdditionalPaymentData::Card(Box::new(additional_data)) + }) + } else { + None + }; + payment_attempt.payment_method_data = additional_pm_data_from_locker + .as_ref() + .map(Encode::encode_to_value) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Failed to encode additional pm data")?; + payment_attempt.payment_method = payment_method.or(payment_attempt.payment_method); payment_attempt.payment_method_type = payment_method_type @@ -679,14 +715,13 @@ impl GetTracker, api::PaymentsRequest> for Pa mandate_id: None, mandate_reference_id: Some( api_models::payments::MandateReferenceId::ConnectorMandateId( - api_models::payments::ConnectorMandateReferenceId { - connector_mandate_id: Some( - token.processor_payment_token.clone(), - ), - payment_method_id: None, - update_history: None, - mandate_metadata: None, - }, + ConnectorMandateReferenceId::new( + Some(token.processor_payment_token.clone()), // connector_mandate_id + None, // payment_method_id + None, // update_history + None, // mandate_metadata + None, // connector_mandate_request_reference_id + ), ), ), }) @@ -714,6 +749,17 @@ impl GetTracker, api::PaymentsRequest> for Pa .net_amount .set_order_tax_amount(order_tax_amount); + payment_attempt.connector_mandate_detail = Some( + DieselConnectorMandateReferenceId::foreign_from(ConnectorMandateReferenceId::new( + None, + None, + None, // update_history + None, // mandate_metadata + Some(common_utils::generate_id_with_len( + consts::CONNECTOR_MANDATE_REQUEST_REFERENCE_ID_LENGTH.to_owned(), + )), // connector_mandate_request_reference_id + )), + ); let payment_data = PaymentData { flow: PhantomData, payment_intent, @@ -1198,31 +1244,6 @@ impl UpdateTracker, api::PaymentsRequest> for Paymen .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Failed to encode additional pm data")?; - let encode_additional_pm_to_value = if let Some(ref pm) = payment_data.payment_method_info { - let card_detail_from_locker: Option = pm - .payment_method_data - .clone() - .map(|x| x.into_inner().expose()) - .and_then(|v| serde_json::from_value::(v).ok()) - .and_then(|pmd| match pmd { - PaymentMethodsData::Card(crd) => Some(api::CardDetailFromLocker::from(crd)), - _ => None, - }); - - card_detail_from_locker.and_then(|card_details| { - let additional_data = card_details.into(); - let additional_data_payment = - AdditionalPaymentData::Card(Box::new(additional_data)); - additional_data_payment - .encode_to_value() - .change_context(errors::ApiErrorResponse::InternalServerError) - .attach_printable("Failed to encode additional pm data") - .ok() - }) - } else { - None - }; - let customer_details = payment_data.payment_intent.customer_details.clone(); let business_sub_label = payment_data.payment_attempt.business_sub_label.clone(); let authentication_type = payment_data.payment_attempt.authentication_type; @@ -1278,7 +1299,7 @@ impl UpdateTracker, api::PaymentsRequest> for Paymen let m_payment_token = payment_token.clone(); let m_additional_pm_data = encoded_additional_pm_data .clone() - .or(encode_additional_pm_to_value); + .or(payment_data.payment_attempt.payment_method_data); let m_business_sub_label = business_sub_label.clone(); let m_straight_through_algorithm = straight_through_algorithm.clone(); let m_error_code = error_code.clone(); @@ -1350,6 +1371,9 @@ impl UpdateTracker, api::PaymentsRequest> for Paymen surcharge_amount, tax_amount, ), + connector_mandate_detail: payment_data + .payment_attempt + .connector_mandate_detail, }, storage_scheme, ) diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs index 696bd1468e4b..a9b5b571c5e7 100644 --- a/crates/router/src/core/payments/operations/payment_create.rs +++ b/crates/router/src/core/payments/operations/payment_create.rs @@ -13,7 +13,10 @@ use common_utils::{ MinorUnit, }, }; -use diesel_models::ephemeral_key; +use diesel_models::{ + ephemeral_key, + payment_attempt::ConnectorMandateReferenceId as DieselConnectorMandateReferenceId, +}; use error_stack::{self, ResultExt}; use hyperswitch_domain_models::{ mandates::{MandateData, MandateDetails}, @@ -49,7 +52,7 @@ use crate::{ self, enums::{self, IntentStatus}, }, - transformers::ForeignTryFrom, + transformers::{ForeignFrom, ForeignTryFrom}, }, utils::{self, OptionExt}, }; @@ -344,7 +347,7 @@ impl GetTracker, api::PaymentsRequest> for Pa } #[cfg(feature = "v1")] - let payment_attempt = db + let mut payment_attempt = db .insert_payment_attempt(payment_attempt_new, storage_scheme) .await .to_duplicate_response(errors::ApiErrorResponse::DuplicatePayment { @@ -399,12 +402,13 @@ impl GetTracker, api::PaymentsRequest> for Pa api_models::payments::MandateIds { mandate_id: Some(mandate_obj.mandate_id), mandate_reference_id: Some(api_models::payments::MandateReferenceId::ConnectorMandateId( - api_models::payments::ConnectorMandateReferenceId{ - connector_mandate_id: connector_id.connector_mandate_id, - payment_method_id: connector_id.payment_method_id, - update_history: None, - mandate_metadata: None, - } + api_models::payments::ConnectorMandateReferenceId::new( + connector_id.get_connector_mandate_id(), + connector_id.get_payment_method_id(), + None, + None, + connector_id.get_connector_mandate_request_reference_id(), + ) )) } }), @@ -436,14 +440,13 @@ impl GetTracker, api::PaymentsRequest> for Pa mandate_id: None, mandate_reference_id: Some( api_models::payments::MandateReferenceId::ConnectorMandateId( - api_models::payments::ConnectorMandateReferenceId { - connector_mandate_id: Some( - token.processor_payment_token.clone(), - ), - payment_method_id: None, - update_history: None, - mandate_metadata: None, - }, + api_models::payments::ConnectorMandateReferenceId::new( + Some(token.processor_payment_token.clone()), + None, + None, + None, + None, + ), ), ), }) @@ -500,8 +503,55 @@ impl GetTracker, api::PaymentsRequest> for Pa .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Card cobadge check failed due to an invalid card network regex")?; + let additional_pm_data_from_locker = if let Some(ref pm) = payment_method_info { + let card_detail_from_locker: Option = pm + .payment_method_data + .clone() + .map(|x| x.into_inner().expose()) + .and_then(|v| { + v.parse_value("PaymentMethodsData") + .map_err(|err| { + router_env::logger::info!( + "PaymentMethodsData deserialization failed: {:?}", + err + ) + }) + .ok() + }) + .and_then(|pmd| match pmd { + PaymentMethodsData::Card(crd) => Some(api::CardDetailFromLocker::from(crd)), + _ => None, + }); + + card_detail_from_locker.map(|card_details| { + let additional_data = card_details.into(); + api_models::payments::AdditionalPaymentData::Card(Box::new(additional_data)) + }) + } else { + None + }; + + payment_attempt.payment_method_data = additional_pm_data_from_locker + .as_ref() + .map(Encode::encode_to_value) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Failed to encode additional pm data")?; let amount = payment_attempt.get_total_amount().into(); + payment_attempt.connector_mandate_detail = + Some(DieselConnectorMandateReferenceId::foreign_from( + api_models::payments::ConnectorMandateReferenceId::new( + None, + None, + None, // update_history + None, // mandate_metadata + Some(common_utils::generate_id_with_len( + consts::CONNECTOR_MANDATE_REQUEST_REFERENCE_ID_LENGTH.to_owned(), + )), // connector_mandate_request_reference_id + ), + )); + let address = PaymentAddress::new( shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs index 2c09ffd8ff20..0234b97032c7 100644 --- a/crates/router/src/core/payments/operations/payment_response.rs +++ b/crates/router/src/core/payments/operations/payment_response.rs @@ -181,7 +181,11 @@ impl PostUpdateTracker, types::PaymentsAuthor .ok(); } }; - + let connector_mandate_reference_id = payment_data + .payment_attempt + .connector_mandate_detail + .as_ref() + .map(|detail| ConnectorMandateReferenceId::foreign_from(detail.clone())); let save_payment_call_future = Box::pin(tokenization::save_payment_method( state, connector_name.clone(), @@ -193,6 +197,7 @@ impl PostUpdateTracker, types::PaymentsAuthor billing_name.clone(), payment_method_billing_address, business_profile, + connector_mandate_reference_id.clone(), )); let is_connector_mandate = resp.request.customer_acceptance.is_some() @@ -307,6 +312,7 @@ impl PostUpdateTracker, types::PaymentsAuthor billing_name, payment_method_billing_address.as_ref(), &business_profile, + connector_mandate_reference_id, )) .await; @@ -571,7 +577,7 @@ impl PostUpdateTracker, types::PaymentsSyncData> for where F: 'b + Clone + Send + Sync, { - let (connector_mandate_id, mandate_metadata) = resp + let (connector_mandate_id, mandate_metadata, connector_mandate_request_reference_id) = resp .response .clone() .ok() @@ -584,17 +590,19 @@ impl PostUpdateTracker, types::PaymentsSyncData> for ( mandate_ref.connector_mandate_id.clone(), mandate_ref.mandate_metadata.clone(), + mandate_ref.connector_mandate_request_reference_id.clone(), ) }) } else { None } }) - .unwrap_or((None, None)); + .unwrap_or((None, None, None)); update_connector_mandate_details_for_the_flow( connector_mandate_id, mandate_metadata, + connector_mandate_request_reference_id, payment_data, )?; @@ -1066,6 +1074,12 @@ impl PostUpdateTracker, types::SetupMandateRequestDa field_name: "connector_name", } })?; + let connector_mandate_reference_id = payment_data + .payment_attempt + .connector_mandate_detail + .as_ref() + .map(|detail| ConnectorMandateReferenceId::foreign_from(detail.clone())); + let merchant_connector_id = payment_data.payment_attempt.merchant_connector_id.clone(); let tokenization::SavePaymentMethodDataResponse { payment_method_id, @@ -1082,6 +1096,7 @@ impl PostUpdateTracker, types::SetupMandateRequestDa billing_name, payment_method_billing_address, business_profile, + connector_mandate_reference_id, )) .await?; @@ -1186,7 +1201,7 @@ impl PostUpdateTracker, types::CompleteAuthorizeData where F: 'b + Clone + Send + Sync, { - let (connector_mandate_id, mandate_metadata) = resp + let (connector_mandate_id, mandate_metadata, connector_mandate_request_reference_id) = resp .response .clone() .ok() @@ -1199,16 +1214,18 @@ impl PostUpdateTracker, types::CompleteAuthorizeData ( mandate_ref.connector_mandate_id.clone(), mandate_ref.mandate_metadata.clone(), + mandate_ref.connector_mandate_request_reference_id.clone(), ) }) } else { None } }) - .unwrap_or((None, None)); + .unwrap_or((None, None, None)); update_connector_mandate_details_for_the_flow( connector_mandate_id, mandate_metadata, + connector_mandate_request_reference_id, payment_data, )?; @@ -1595,10 +1612,10 @@ async fn payment_response_update_tracker( }) .unwrap_or(false) { - let (connector_mandate_id, mandate_metadata) = payment_data.payment_attempt.connector_mandate_detail.clone() - .map(|cmr| (cmr.connector_mandate_id, cmr.mandate_metadata)) - .unwrap_or((None, None)); + let (connector_mandate_id, mandate_metadata,connector_mandate_request_reference_id) = payment_data.payment_attempt.connector_mandate_detail.clone() + .map(|cmr| (cmr.connector_mandate_id, cmr.mandate_metadata,cmr.connector_mandate_request_reference_id)) + .unwrap_or((None, None,None)); // Update the connector mandate details with the payment attempt connector mandate id let connector_mandate_details = tokenization::update_connector_mandate_details( @@ -1615,6 +1632,7 @@ async fn payment_response_update_tracker( payment_data.payment_attempt.merchant_connector_id.clone(), connector_mandate_id, mandate_metadata, + connector_mandate_request_reference_id )?; // Update the payment method table with the active mandate record payment_methods::cards::update_payment_method_connector_mandate_details( @@ -2318,15 +2336,33 @@ impl PostUpdateTracker, types::PaymentsAuthor fn update_connector_mandate_details_for_the_flow( connector_mandate_id: Option, mandate_metadata: Option, + connector_mandate_request_reference_id: Option, payment_data: &mut PaymentData, ) -> RouterResult<()> { + let mut original_connector_mandate_reference_id = payment_data + .payment_attempt + .connector_mandate_detail + .as_ref() + .map(|detail| ConnectorMandateReferenceId::foreign_from(detail.clone())); let connector_mandate_reference_id = if connector_mandate_id.is_some() { - Some(ConnectorMandateReferenceId { - connector_mandate_id: connector_mandate_id.clone(), - payment_method_id: None, - update_history: None, - mandate_metadata: mandate_metadata.clone(), - }) + if let Some(ref mut record) = original_connector_mandate_reference_id { + record.update( + connector_mandate_id, + None, + None, + mandate_metadata, + connector_mandate_request_reference_id, + ); + Some(record.clone()) + } else { + Some(ConnectorMandateReferenceId::new( + connector_mandate_id, + None, + None, + mandate_metadata, + connector_mandate_request_reference_id, + )) + } } else { None }; diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs index 0b530d4d0541..9005e94c9629 100644 --- a/crates/router/src/core/payments/operations/payment_update.rs +++ b/crates/router/src/core/payments/operations/payment_update.rs @@ -329,7 +329,13 @@ impl GetTracker, api::PaymentsRequest> for Pa api_models::payments::MandateIds { mandate_id: Some(mandate_obj.mandate_id), mandate_reference_id: Some(api_models::payments::MandateReferenceId::ConnectorMandateId( - api_models::payments::ConnectorMandateReferenceId {connector_mandate_id:connector_id.connector_mandate_id,payment_method_id:connector_id.payment_method_id, update_history: None, mandate_metadata:connector_id.mandate_metadata, }, + api_models::payments::ConnectorMandateReferenceId::new( + connector_id.get_connector_mandate_id(), // connector_mandate_id + connector_id.get_payment_method_id(), // payment_method_id + None, // update_history + connector_id.get_mandate_metadata(), // mandate_metadata + connector_id.get_connector_mandate_request_reference_id() // connector_mandate_request_reference_id + ) )) } }), diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rs index c14542de5476..553eb6724868 100644 --- a/crates/router/src/core/payments/tokenization.rs +++ b/crates/router/src/core/payments/tokenization.rs @@ -80,6 +80,7 @@ pub async fn save_payment_method( billing_name: Option>, payment_method_billing_address: Option<&api::Address>, business_profile: &domain::Profile, + mut original_connector_mandate_reference_id: Option, ) -> RouterResult where FData: mandate::MandateBehaviour + Clone, @@ -155,21 +156,23 @@ where .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Unable to serialize customer acceptance to value")?; - let (connector_mandate_id, mandate_metadata) = match responses { - types::PaymentsResponseData::TransactionResponse { - mandate_reference, .. - } => { - if let Some(ref mandate_ref) = *mandate_reference { - ( - mandate_ref.connector_mandate_id.clone(), - mandate_ref.mandate_metadata.clone(), - ) - } else { - (None, None) + let (connector_mandate_id, mandate_metadata, connector_mandate_request_reference_id) = + match responses { + types::PaymentsResponseData::TransactionResponse { + mandate_reference, .. + } => { + if let Some(ref mandate_ref) = *mandate_reference { + ( + mandate_ref.connector_mandate_id.clone(), + mandate_ref.mandate_metadata.clone(), + mandate_ref.connector_mandate_request_reference_id.clone(), + ) + } else { + (None, None, None) + } } - } - _ => (None, None), - }; + _ => (None, None, None), + }; let pm_id = if customer_acceptance.is_some() { let payment_method_create_request = @@ -689,12 +692,24 @@ where }; // check if there needs to be a config if yes then remove it to a different place let connector_mandate_reference_id = if connector_mandate_id.is_some() { - Some(ConnectorMandateReferenceId { - connector_mandate_id: connector_mandate_id.clone(), - payment_method_id: None, - update_history: None, - mandate_metadata: mandate_metadata.clone(), - }) + if let Some(ref mut record) = original_connector_mandate_reference_id { + record.update( + connector_mandate_id, + None, + None, + mandate_metadata, + connector_mandate_request_reference_id, + ); + Some(record.clone()) + } else { + Some(ConnectorMandateReferenceId::new( + connector_mandate_id, + None, + None, + mandate_metadata, + connector_mandate_request_reference_id, + )) + } } else { None }; @@ -728,6 +743,7 @@ pub async fn save_payment_method( _billing_name: Option>, _payment_method_billing_address: Option<&api::Address>, _business_profile: &domain::Profile, + _connector_mandate_request_reference_id: Option, ) -> RouterResult where FData: mandate::MandateBehaviour + Clone, @@ -1134,6 +1150,7 @@ pub fn add_connector_mandate_details_in_payment_method( merchant_connector_id: Option, connector_mandate_id: Option, mandate_metadata: Option, + connector_mandate_request_reference_id: Option, ) -> Option { let mut mandate_details = HashMap::new(); @@ -1149,6 +1166,7 @@ pub fn add_connector_mandate_details_in_payment_method( original_payment_authorized_currency: authorized_currency, mandate_metadata, connector_mandate_status: Some(ConnectorMandateStatus::Active), + connector_mandate_request_reference_id, }, ); Some(storage::PaymentsMandateReference(mandate_details)) @@ -1156,7 +1174,7 @@ pub fn add_connector_mandate_details_in_payment_method( None } } - +#[allow(clippy::too_many_arguments)] pub fn update_connector_mandate_details( mandate_details: Option, payment_method_type: Option, @@ -1165,6 +1183,7 @@ pub fn update_connector_mandate_details( merchant_connector_id: Option, connector_mandate_id: Option, mandate_metadata: Option, + connector_mandate_request_reference_id: Option, ) -> RouterResult> { let mandate_reference = match mandate_details { Some(mut payment_mandate_reference) => { @@ -1178,6 +1197,8 @@ pub fn update_connector_mandate_details( original_payment_authorized_currency: authorized_currency, mandate_metadata: mandate_metadata.clone(), connector_mandate_status: Some(ConnectorMandateStatus::Active), + connector_mandate_request_reference_id: connector_mandate_request_reference_id + .clone(), }; payment_mandate_reference @@ -1190,6 +1211,7 @@ pub fn update_connector_mandate_details( original_payment_authorized_currency: authorized_currency, mandate_metadata: mandate_metadata.clone(), connector_mandate_status: Some(ConnectorMandateStatus::Active), + connector_mandate_request_reference_id, }); Some(payment_mandate_reference) } else { @@ -1203,6 +1225,7 @@ pub fn update_connector_mandate_details( merchant_connector_id, connector_mandate_id, mandate_metadata, + connector_mandate_request_reference_id, ), }; let connector_mandate_details = mandate_reference diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index e059ebdb8b52..95d114d3d684 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -102,6 +102,12 @@ where customer_data: customer, }; + let connector_mandate_request_reference_id = payment_data + .payment_attempt + .connector_mandate_detail + .as_ref() + .and_then(|detail| detail.get_connector_mandate_request_reference_id()); + let router_data = types::RouterData { flow: PhantomData, merchant_id: merchant_account.get_id().clone(), @@ -159,6 +165,7 @@ where integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id, }; Ok(router_data) } @@ -279,7 +286,13 @@ pub async fn construct_payment_router_data_for_authorize<'a>( merchant_order_reference_id: None, integrity_object: None, shipping_cost: payment_data.payment_intent.amount_details.shipping_cost, + additional_payment_method_data: None, }; + let connector_mandate_request_reference_id = payment_data + .payment_attempt + .connector_mandate_detail + .as_ref() + .and_then(|detail| detail.get_connector_mandate_request_reference_id()); // TODO: evaluate the fields in router data, if they are required or not let router_data = types::RouterData { @@ -355,6 +368,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>( integrity_check: Ok(()), additional_merchant_data: None, header_payload, + connector_mandate_request_reference_id, }; Ok(router_data) @@ -501,6 +515,11 @@ where } else { payment_data.address }; + let connector_mandate_request_reference_id = payment_data + .payment_attempt + .connector_mandate_detail + .as_ref() + .and_then(|detail| detail.get_connector_mandate_request_reference_id()); crate::logger::debug!("unified address details {:?}", unified_address); @@ -570,6 +589,7 @@ where ) }), header_payload, + connector_mandate_request_reference_id, }; Ok(router_data) @@ -1538,7 +1558,7 @@ where .and_then(|mandate_ref| match mandate_ref { api_models::payments::MandateReferenceId::ConnectorMandateId( connector_mandate_reference_id, - ) => connector_mandate_reference_id.connector_mandate_id.clone(), + ) => connector_mandate_reference_id.get_connector_mandate_id(), _ => None, }) }); @@ -2112,7 +2132,18 @@ impl TryFrom> for types::PaymentsAuthoriz payment_data.creds_identifier.as_deref(), )); - // payment_method_data is not required during recurring mandate payment, in such case keep default PaymentMethodData as MandatePayment + let additional_payment_method_data = if payment_data.mandate_id.is_some() { + let parsed_additional_payment_data: Option = + payment_data.payment_attempt + .payment_method_data + .as_ref().map(|data| data.clone().parse_value("AdditionalPaymentData")) + .transpose() + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("Failed to parse AdditionalPaymentData from payment_data.payment_attempt.payment_method_data")?; + parsed_additional_payment_data + } else { + None + }; let payment_method_data = payment_data.payment_method_data.or_else(|| { if payment_data.mandate_id.is_some() { Some(domain::PaymentMethodData::MandatePayment) @@ -2198,6 +2229,7 @@ impl TryFrom> for types::PaymentsAuthoriz charges, merchant_order_reference_id, integrity_object: None, + additional_payment_method_data, shipping_cost, }) } @@ -3277,20 +3309,23 @@ impl ForeignFrom impl ForeignFrom for ConnectorMandateReferenceId { fn foreign_from(value: DieselConnectorMandateReferenceId) -> Self { - Self { - connector_mandate_id: value.connector_mandate_id, - payment_method_id: value.payment_method_id, - update_history: None, - mandate_metadata: value.mandate_metadata, - } + Self::new( + value.connector_mandate_id, + value.payment_method_id, + None, + value.mandate_metadata, + value.connector_mandate_request_reference_id, + ) } } impl ForeignFrom for DieselConnectorMandateReferenceId { fn foreign_from(value: ConnectorMandateReferenceId) -> Self { Self { - connector_mandate_id: value.connector_mandate_id, - payment_method_id: value.payment_method_id, - mandate_metadata: value.mandate_metadata, + connector_mandate_id: value.get_connector_mandate_id(), + payment_method_id: value.get_payment_method_id(), + mandate_metadata: value.get_mandate_metadata(), + connector_mandate_request_reference_id: value + .get_connector_mandate_request_reference_id(), } } } diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs index def869079117..abd602760fae 100644 --- a/crates/router/src/core/utils.rs +++ b/crates/router/src/core/utils.rs @@ -217,6 +217,7 @@ pub async fn construct_payout_router_data<'a, F>( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) @@ -395,6 +396,7 @@ pub async fn construct_refund_router_data<'a, F>( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) @@ -705,6 +707,7 @@ pub async fn construct_accept_dispute_router_data<'a>( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) } @@ -800,6 +803,7 @@ pub async fn construct_submit_evidence_router_data<'a>( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) } @@ -901,6 +905,7 @@ pub async fn construct_upload_file_router_data<'a>( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) } @@ -1022,6 +1027,7 @@ pub async fn construct_payments_dynamic_tax_calculation_router_data<'a, F: Clone integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) } @@ -1120,6 +1126,7 @@ pub async fn construct_defend_dispute_router_data<'a>( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) } @@ -1212,6 +1219,7 @@ pub async fn construct_retrieve_file_router_data<'a>( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) } diff --git a/crates/router/src/core/webhooks/utils.rs b/crates/router/src/core/webhooks/utils.rs index 3d71f5f5553d..fff675503ad4 100644 --- a/crates/router/src/core/webhooks/utils.rs +++ b/crates/router/src/core/webhooks/utils.rs @@ -122,6 +122,7 @@ pub async fn construct_webhook_router_data<'a>( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, }; Ok(router_data) } diff --git a/crates/router/src/services/conversion_impls.rs b/crates/router/src/services/conversion_impls.rs index 22930916093d..33c655eed78a 100644 --- a/crates/router/src/services/conversion_impls.rs +++ b/crates/router/src/services/conversion_impls.rs @@ -76,6 +76,7 @@ fn get_default_router_data( integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, } } diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs index 1f7c635da004..230ac7531103 100644 --- a/crates/router/src/types.rs +++ b/crates/router/src/types.rs @@ -879,6 +879,7 @@ impl ForeignFrom<&SetupMandateRouterData> for PaymentsAuthorizeData { charges: None, // TODO: allow charges on mandates? merchant_order_reference_id: None, integrity_object: None, + additional_payment_method_data: None, shipping_cost: data.request.shipping_cost, } } @@ -936,6 +937,9 @@ impl ForeignFrom<(&RouterData, T2) integrity_check: Ok(()), additional_merchant_data: data.additional_merchant_data.clone(), header_payload: data.header_payload.clone(), + connector_mandate_request_reference_id: data + .connector_mandate_request_reference_id + .clone(), } } } @@ -1000,6 +1004,7 @@ impl integrity_check: Ok(()), additional_merchant_data: data.additional_merchant_data.clone(), header_payload: data.header_payload.clone(), + connector_mandate_request_reference_id: None, } } } diff --git a/crates/router/src/types/api/verify_connector.rs b/crates/router/src/types/api/verify_connector.rs index 052bd5823175..a472296d2a75 100644 --- a/crates/router/src/types/api/verify_connector.rs +++ b/crates/router/src/types/api/verify_connector.rs @@ -57,6 +57,7 @@ impl VerifyConnectorData { charges: None, merchant_order_reference_id: None, integrity_object: None, + additional_payment_method_data: None, shipping_cost: None, } } @@ -116,6 +117,7 @@ impl VerifyConnectorData { integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, } } } diff --git a/crates/router/src/types/storage/payment_method.rs b/crates/router/src/types/storage/payment_method.rs index 20d0ee74b011..7739c0f0ba8f 100644 --- a/crates/router/src/types/storage/payment_method.rs +++ b/crates/router/src/types/storage/payment_method.rs @@ -126,6 +126,7 @@ pub struct PaymentsMandateReferenceRecord { pub original_payment_authorized_currency: Option, pub mandate_metadata: Option, pub connector_mandate_status: Option, + pub connector_mandate_request_reference_id: Option, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] diff --git a/crates/router/tests/connectors/aci.rs b/crates/router/tests/connectors/aci.rs index 5d48a0188ff5..6f4855d1e22a 100644 --- a/crates/router/tests/connectors/aci.rs +++ b/crates/router/tests/connectors/aci.rs @@ -128,6 +128,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, } } @@ -197,6 +198,7 @@ fn construct_refund_router_data() -> types::RefundsRouterData { integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, } } diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs index eccade536c42..52218b211ac1 100644 --- a/crates/router/tests/connectors/utils.rs +++ b/crates/router/tests/connectors/utils.rs @@ -546,6 +546,7 @@ pub trait ConnectorActions: Connector { integrity_check: Ok(()), additional_merchant_data: None, header_payload: None, + connector_mandate_request_reference_id: None, } } @@ -947,6 +948,7 @@ impl Default for PaymentAuthorizeType { charges: None, integrity_object: None, merchant_order_reference_id: None, + additional_payment_method_data: None, shipping_cost: None, }; Self(data)