Skip to content

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

feat(connector): [CRYPTOPAY] Make payment_method_data.crypto.network as enum (#4853)

DEEPANSHU BANSAL1eaba9a10b11
diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs
index 81e50b020e..c2969a1661 100644
--- a/crates/api_models/src/enums.rs
+++ b/crates/api_models/src/enums.rs
@@ -430,6 +430,7 @@ pub enum FieldType {
UserCountryCode, //phone number's country code
UserCountry { options: Vec<String> }, //for country inside payment method data ex- bank redirect
UserCurrency { options: Vec<String> },
+ UserCryptoCurrencyNetwork, //for crypto network associated with the cryptopcurrency
UserBillingName,
UserAddressLine1,
UserAddressLine2,
@@ -504,6 +505,7 @@ impl PartialEq for FieldType {
options: options_other,
},
) => options_self.eq(options_other),
+ (Self::UserCryptoCurrencyNetwork, Self::UserCryptoCurrencyNetwork) => true,
(Self::UserBillingName, Self::UserBillingName) => true,
(Self::UserAddressLine1, Self::UserAddressLine1) => true,
(Self::UserAddressLine2, Self::UserAddressLine2) => true,
diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs
index 7177488cb3..2c02dddaab 100644
--- a/crates/router/src/configs/defaults.rs
+++ b/crates/router/src/configs/defaults.rs
@@ -8303,7 +8303,7 @@ impl Default for super::settings::RequiredFields {
RequiredFieldInfo {
required_field: "payment_method_data.crypto.network".to_string(),
display_name: "network".to_string(),
- field_type: enums::FieldType::Text,
+ field_type: enums::FieldType::UserCryptoCurrencyNetwork,
value: None,
}
),
diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json
index 560f61bc26..87f05f3b67 100644
--- a/openapi/openapi_spec.json
+++ b/openapi/openapi_spec.json
@@ -9296,6 +9296,12 @@
}
}
},
+ {
+ "type": "string",
+ "enum": [
+ "user_crypto_currency_network"
+ ]
+ },
{
"type": "string",
"enum": [