From 1eaba9a10b11a4f1d540e0a848a798c81e3f6fd1 Mon Sep 17 00:00:00 2001 From: DEEPANSHU BANSAL <41580413+deepanshu-iiitu@users.noreply.github.com> Date: Tue, 4 Jun 2024 20:29:11 +0530 Subject: [PATCH] feat(connector): [CRYPTOPAY] Make payment_method_data.crypto.network as enum (#4853) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> --- crates/api_models/src/enums.rs | 2 ++ crates/router/src/configs/defaults.rs | 2 +- openapi/openapi_spec.json | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs index 81e50b020e73..c2969a166125 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 }, //for country inside payment method data ex- bank redirect UserCurrency { options: Vec }, + 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 7177488cb3cc..2c02dddaab0a 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 560f61bc2652..87f05f3b6755 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": [