diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs index d3d83d18bf..ba69da857f 100644 --- a/crates/api_models/src/enums.rs +++ b/crates/api_models/src/enums.rs @@ -461,9 +461,9 @@ pub enum FieldType { UserAddressState, UserAddressCountry, UserBlikCode, - FieldsComplete, UserBillingName, UserBank, + UserCurrency { options: Vec }, Text, DropDown { options: Vec }, } diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index 8495186a4a..cb14b37b65 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -694,6 +694,55 @@ impl Default for super::settings::RequiredFields { ), ])), ), + ( + enums::PaymentMethod::Crypto, + PaymentMethodType(HashMap::from([ + ( + enums::PaymentMethodType::CryptoCurrency, + ConnectorFields { + fields: HashMap::from([ + ( + enums::Connector::Cryptopay, + RequiredFieldFinal { + mandate : HashMap::new(), + non_mandate: HashMap::new(), + common : 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(), + "BUSD".to_string(), + "USDT".to_string(), + "USDC".to_string(), + "DAI".to_string(), + ] + }, + value: None, + } + ), + ]), + } + ), + ]), + }, + ), + ])), + ), ( enums::PaymentMethod::BankDebit, PaymentMethodType(HashMap::from([( diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 9b80657b80..79131df656 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -4883,12 +4883,6 @@ "user_blik_code" ] }, - { - "type": "string", - "enum": [ - "fields_complete" - ] - }, { "type": "string", "enum": [ @@ -4901,6 +4895,28 @@ "user_bank" ] }, + { + "type": "object", + "required": [ + "user_currency" + ], + "properties": { + "user_currency": { + "type": "object", + "required": [ + "options" + ], + "properties": { + "options": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, { "type": "string", "enum": [