id
stringlengths
20
153
type
stringclasses
1 value
granularity
stringclasses
14 values
content
stringlengths
16
84.3k
metadata
dict
hyperswitch_method_api_models_DynamicRoutingAlgorithmRef_is_elimination_enabled
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for DynamicRoutingAlgorithmRef pub fn is_elimination_enabled(&self) -> bool { self.elimination_routing_algorithm .as_ref() .map(|elimination_routing| { elimination_routing.enabled_feature == DynamicRoutingFeatures::DynamicConnectorSelection || elimination_routing.enabled_feature == DynamicRoutingFeatures::Metrics }) .unwrap_or_default() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "DynamicRoutingAlgorithmRef", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "is_elimination_enabled", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_RoutingType_is_dynamic_routing
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for RoutingType pub fn is_dynamic_routing(self) -> bool { self == Self::Dynamic }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "RoutingType", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "is_dynamic_routing", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_SuccessBasedAlgorithm_update_enabled_features
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for SuccessBasedAlgorithm pub fn update_enabled_features(&mut self, feature_to_enable: DynamicRoutingFeatures) { self.enabled_feature = feature_to_enable }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "SuccessBasedAlgorithm", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "update_enabled_features", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_DynamicRoutingAlgorithmRef_update_algorithm_id
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for DynamicRoutingAlgorithmRef pub fn update_algorithm_id( &mut self, new_id: common_utils::id_type::RoutingId, enabled_feature: DynamicRoutingFeatures, dynamic_routing_type: DynamicRoutingType, ) { match dynamic_routing_type { DynamicRoutingType::SuccessRateBasedRouting => { self.success_based_algorithm = Some(SuccessBasedAlgorithm { algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp::new(Some(new_id)), enabled_feature, }) } DynamicRoutingType::EliminationRouting => { self.elimination_routing_algorithm = Some(EliminationRoutingAlgorithm { algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp::new(Some(new_id)), enabled_feature, }) } DynamicRoutingType::ContractBasedRouting => { self.contract_based_routing = Some(ContractRoutingAlgorithm { algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp::new(Some(new_id)), enabled_feature, }) } }; }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "DynamicRoutingAlgorithmRef", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "update_algorithm_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_DynamicRoutingAlgorithmRef_update_feature
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for DynamicRoutingAlgorithmRef pub fn update_feature( &mut self, enabled_feature: DynamicRoutingFeatures, dynamic_routing_type: DynamicRoutingType, ) { match dynamic_routing_type { DynamicRoutingType::SuccessRateBasedRouting => { self.success_based_algorithm = Some(SuccessBasedAlgorithm { algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp::new(None), enabled_feature, }) } DynamicRoutingType::EliminationRouting => { self.elimination_routing_algorithm = Some(EliminationRoutingAlgorithm { algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp::new(None), enabled_feature, }) } DynamicRoutingType::ContractBasedRouting => { self.contract_based_routing = Some(ContractRoutingAlgorithm { algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp::new(None), enabled_feature, }) } }; }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "DynamicRoutingAlgorithmRef", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "update_feature", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_DynamicRoutingAlgorithmRef_disable_algorithm_id
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for DynamicRoutingAlgorithmRef pub fn disable_algorithm_id(&mut self, dynamic_routing_type: DynamicRoutingType) { match dynamic_routing_type { DynamicRoutingType::SuccessRateBasedRouting => { if let Some(success_based_algo) = &self.success_based_algorithm { self.success_based_algorithm = Some(SuccessBasedAlgorithm { algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp::new(None), enabled_feature: success_based_algo.enabled_feature, }); } } DynamicRoutingType::EliminationRouting => { if let Some(elimination_based_algo) = &self.elimination_routing_algorithm { self.elimination_routing_algorithm = Some(EliminationRoutingAlgorithm { algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp::new(None), enabled_feature: elimination_based_algo.enabled_feature, }); } } DynamicRoutingType::ContractBasedRouting => { if let Some(contract_based_algo) = &self.contract_based_routing { self.contract_based_routing = Some(ContractRoutingAlgorithm { algorithm_id_with_timestamp: DynamicAlgorithmWithTimestamp::new(None), enabled_feature: contract_based_algo.enabled_feature, }); } } } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "DynamicRoutingAlgorithmRef", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "disable_algorithm_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_SuccessBasedRoutingConfig_open_router_config_default
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for SuccessBasedRoutingConfig pub fn open_router_config_default() -> Self { Self { params: None, config: None, decision_engine_configs: Some(open_router::DecisionEngineSuccessRateData { default_latency_threshold: Some(DEFAULT_LATENCY_THRESHOLD), default_bucket_size: Some(DEFAULT_BUCKET_SIZE), default_hedging_percent: Some(DEFAULT_HEDGING_PERCENT), default_lower_reset_factor: None, default_upper_reset_factor: None, default_gateway_extra_score: None, sub_level_input_config: Some(vec![ open_router::DecisionEngineSRSubLevelInputConfig { payment_method_type: Some(DEFAULT_PAYMENT_METHOD.to_string()), payment_method: None, latency_threshold: None, bucket_size: Some(DEFAULT_BUCKET_SIZE), hedging_percent: Some(DEFAULT_HEDGING_PERCENT), lower_reset_factor: None, upper_reset_factor: None, gateway_extra_score: None, }, ]), }), } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "SuccessBasedRoutingConfig", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "open_router_config_default", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_SuccessBasedRoutingConfig_get_decision_engine_configs
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for SuccessBasedRoutingConfig pub fn get_decision_engine_configs( &self, ) -> Result<open_router::DecisionEngineSuccessRateData, error_stack::Report<ValidationError>> { self.decision_engine_configs .clone() .ok_or(error_stack::Report::new( ValidationError::MissingRequiredField { field_name: "decision_engine_configs".to_string(), }, )) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "SuccessBasedRoutingConfig", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_decision_engine_configs", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_LabelInformation_update_target_time
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for LabelInformation pub fn update_target_time(&mut self, new: &Self) { self.target_time = new.target_time; }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "LabelInformation", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "update_target_time", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_LabelInformation_update_target_count
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for LabelInformation pub fn update_target_count(&mut self, new: &Self) { self.target_count = new.target_count; }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "LabelInformation", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "update_target_count", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_ContractBasedRoutingConfigBody_update
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for ContractBasedRoutingConfigBody pub fn update(&mut self, new: Self) { if let Some(new_cons) = new.constants { self.constants = Some(new_cons) } if let Some(new_time_scale) = new.time_scale { self.time_scale = Some(new_time_scale) } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "ContractBasedRoutingConfigBody", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "update", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_RoutingApproach_from_decision_engine_approach
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for RoutingApproach pub fn from_decision_engine_approach(approach: &str) -> Self { match approach { "SR_SELECTION_V3_ROUTING" => Self::Exploitation, "SR_V3_HEDGING" => Self::Exploration, _ => Self::Default, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "RoutingApproach", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "from_decision_engine_approach", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_RoutingApproach_from_decision_engine_approach
clm
method
// hyperswitch/crates/router/src/core/payments/routing/utils.rs // impl for RoutingApproach pub fn from_decision_engine_approach(approach: &str) -> Self { match approach { "SR_SELECTION_V3_ROUTING" => Self::Exploitation, "SR_V3_HEDGING" => Self::Exploration, _ => Self::Default, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "RoutingApproach", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "from_decision_engine_approach", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_RuleMigrationQuery_validated_limit
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for RuleMigrationQuery pub fn validated_limit(&self) -> u32 { self.limit.unwrap_or(50).min(1000) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "RuleMigrationQuery", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "validated_limit", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_RuleMigrationResponse_new
clm
method
// hyperswitch/crates/api_models/src/routing.rs // impl for RuleMigrationResponse pub fn new( profile_id: common_utils::id_type::ProfileId, euclid_algorithm_id: common_utils::id_type::RoutingId, decision_engine_algorithm_id: String, is_active_rule: bool, ) -> Self { Self { profile_id, euclid_algorithm_id, decision_engine_algorithm_id, is_active_rule, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "RuleMigrationResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_curringDetails {__network_transaction_id_and_card_details_flow(s
clm
method
// hyperswitch/crates/api_models/src/mandates.rs // impl for curringDetails { b fn is_network_transaction_id_and_card_details_flow(self) -> bool { matches!(self, Self::NetworkTransactionIdAndCardDetails(_)) } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "curringDetails {", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "_network_transaction_id_and_card_details_flow(s", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_TotalEventsResponse_new
clm
method
// hyperswitch/crates/api_models/src/webhook_events.rs // impl for TotalEventsResponse pub fn new(total_count: i64, events: Vec<EventListItemResponse>) -> Self { Self { events, total_count, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "TotalEventsResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountCreate_get_merchant_reference_id
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountCreate pub fn get_merchant_reference_id(&self) -> id_type::MerchantId { id_type::MerchantId::from_merchant_name(self.merchant_name.clone().expose()) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountCreate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_merchant_reference_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountCreate_get_payment_response_hash_key
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountCreate pub fn get_payment_response_hash_key(&self) -> Option<String> { self.payment_response_hash_key.clone().or(Some( common_utils::crypto::generate_cryptographically_secure_random_string(64), )) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountCreate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_payment_response_hash_key", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountCreate_get_merchant_reference_id
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountCreate pub fn get_merchant_reference_id(&self) -> id_type::MerchantId { id_type::MerchantId::from_merchant_name(self.merchant_name.clone().expose()) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountCreate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_merchant_reference_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountUpdate_get_primary_details_as_value
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountUpdate pub fn get_primary_details_as_value( &self, ) -> CustomResult<Option<serde_json::Value>, errors::ParsingError> { self.primary_business_details .as_ref() .map(|primary_business_details| primary_business_details.encode_to_value()) .transpose() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_primary_details_as_value", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountUpdate_get_pm_link_config_as_value
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountUpdate pub fn get_pm_link_config_as_value( &self, ) -> CustomResult<Option<serde_json::Value>, errors::ParsingError> { self.pm_collect_link_config .as_ref() .map(|pm_collect_link_config| pm_collect_link_config.encode_to_value()) .transpose() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_pm_link_config_as_value", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountUpdate_get_merchant_details_as_secret
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountUpdate pub fn get_merchant_details_as_secret( &self, ) -> CustomResult<Option<pii::SecretSerdeValue>, errors::ParsingError> { self.merchant_details .as_ref() .map(|merchant_details| merchant_details.encode_to_value().map(Secret::new)) .transpose() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_merchant_details_as_secret", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountUpdate_get_metadata_as_secret
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountUpdate pub fn get_metadata_as_secret( &self, ) -> CustomResult<Option<pii::SecretSerdeValue>, errors::ParsingError> { self.metadata .as_ref() .map(|metadata| metadata.encode_to_value().map(Secret::new)) .transpose() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_metadata_as_secret", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountUpdate_parse_routing_algorithm
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountUpdate pub fn parse_routing_algorithm(&self) -> CustomResult<(), errors::ParsingError> { match self.routing_algorithm { Some(ref routing_algorithm) => { let _: routing::StaticRoutingAlgorithm = routing_algorithm .clone() .parse_value("StaticRoutingAlgorithm")?; Ok(()) } None => Ok(()), } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "parse_routing_algorithm", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountUpdate_get_enable_payment_response_hash
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountUpdate pub fn get_enable_payment_response_hash(&self) -> bool { self.enable_payment_response_hash.unwrap_or(true) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_enable_payment_response_hash", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountUpdate_get_webhook_details_as_value
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountUpdate pub fn get_webhook_details_as_value( &self, ) -> CustomResult<Option<serde_json::Value>, errors::ParsingError> { self.webhook_details .as_ref() .map(|webhook_details| webhook_details.encode_to_value()) .transpose() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_webhook_details_as_value", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountUpdate_get_merchant_details_as_secret
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountUpdate pub fn get_merchant_details_as_secret( &self, ) -> CustomResult<Option<pii::SecretSerdeValue>, errors::ParsingError> { self.merchant_details .as_ref() .map(|merchant_details| merchant_details.encode_to_value().map(Secret::new)) .transpose() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_merchant_details_as_secret", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantAccountUpdate_get_metadata_as_secret
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantAccountUpdate pub fn get_metadata_as_secret( &self, ) -> CustomResult<Option<pii::SecretSerdeValue>, errors::ParsingError> { self.metadata .as_ref() .map(|metadata| metadata.encode_to_value().map(Secret::new)) .transpose() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantAccountUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_metadata_as_secret", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantConnectorCreate_get_transaction_type
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantConnectorCreate pub fn get_transaction_type(&self) -> api_enums::TransactionType { match self.connector_type { #[cfg(feature = "payouts")] api_enums::ConnectorType::PayoutProcessor => api_enums::TransactionType::Payout, _ => api_enums::TransactionType::Payment, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantConnectorCreate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_transaction_type", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantConnectorCreate_get_connector_label
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantConnectorCreate pub fn get_connector_label(&self, profile_name: String) -> String { match self.connector_label.clone() { Some(connector_label) => connector_label, None => format!("{}_{}", self.connector_name, profile_name), } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantConnectorCreate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_connector_label", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantConnectorCreate_get_transaction_type
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantConnectorCreate pub fn get_transaction_type(&self) -> api_enums::TransactionType { match self.connector_type { #[cfg(feature = "payouts")] api_enums::ConnectorType::PayoutProcessor => api_enums::TransactionType::Payout, _ => api_enums::TransactionType::Payment, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantConnectorCreate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_transaction_type", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantConnectorInfo_new
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantConnectorInfo pub fn new( connector_label: String, merchant_connector_id: id_type::MerchantConnectorAccountId, ) -> Self { Self { connector_label, merchant_connector_id, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantConnectorInfo", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantConnectorListResponse_to_merchant_connector_info
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantConnectorListResponse pub fn to_merchant_connector_info(&self, connector_label: &String) -> MerchantConnectorInfo { MerchantConnectorInfo { connector_label: connector_label.to_string(), merchant_connector_id: self.id.clone(), } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantConnectorListResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "to_merchant_connector_info", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantConnectorListResponse_get_connector_name
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantConnectorListResponse pub fn get_connector_name(&self) -> common_enums::connector_enums::Connector { self.connector_name }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantConnectorListResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_connector_name", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantConnectorListResponse_to_merchant_connector_info
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantConnectorListResponse pub fn to_merchant_connector_info(&self, connector_label: &String) -> MerchantConnectorInfo { MerchantConnectorInfo { connector_label: connector_label.to_string(), merchant_connector_id: self.id.clone(), } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantConnectorListResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "to_merchant_connector_info", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantConnectorListResponse_get_connector_name
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantConnectorListResponse pub fn get_connector_name(&self) -> common_enums::connector_enums::Connector { self.connector_name }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantConnectorListResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_connector_name", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MerchantConnectorUpdate_get_frm_config_as_secret
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MerchantConnectorUpdate pub fn get_frm_config_as_secret(&self) -> Option<Vec<Secret<serde_json::Value>>> { match self.frm_configs.as_ref() { Some(frm_value) => { let configs_for_frm_value: Vec<Secret<serde_json::Value>> = frm_value .iter() .map(|config| config.encode_to_value().map(Secret::new)) .collect::<Result<Vec<_>, _>>() .ok()?; Some(configs_for_frm_value) } None => None, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MerchantConnectorUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_frm_config_as_secret", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_PaymentMethodsEnabled_get_payment_method
clm
method
// hyperswitch/crates/common_types/src/payment_methods.rs // impl for PaymentMethodsEnabled pub fn get_payment_method(&self) -> Option<common_enums::PaymentMethod> { Some(self.payment_method_type) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodsEnabled", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_payment_method", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_PaymentMethodsEnabled_get_payment_method
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for PaymentMethodsEnabled pub fn get_payment_method(&self) -> Option<common_enums::PaymentMethod> { Some(self.payment_method) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodsEnabled", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_payment_method", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_PaymentMethodsEnabled_get_payment_method_type
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for PaymentMethodsEnabled pub fn get_payment_method_type( &self, ) -> Option<&Vec<payment_methods::RequestPaymentMethodTypes>> { self.payment_method_types.as_ref() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodsEnabled", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_payment_method_type", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MaskedHeaders_mask_value
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MaskedHeaders fn mask_value(value: &str) -> String { let value_len = value.len(); let masked_value = if value_len <= 4 { "*".repeat(value_len) } else { value .char_indices() .map(|(index, ch)| { if index < 2 || index >= value_len - 2 { // Show the first two and last two characters, mask the rest with '*' ch } else { // Mask the remaining characters '*' } }) .collect::<String>() }; masked_value }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MaskedHeaders", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "mask_value", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_MaskedHeaders_from_headers
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for MaskedHeaders pub fn from_headers(headers: HashMap<String, Secret<String>>) -> Self { let masked_headers = headers .into_iter() .map(|(key, value)| (key, Self::mask_value(value.peek()))) .collect(); Self(masked_headers) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "MaskedHeaders", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "from_headers", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_BusinessPaymentLinkConfig_validate
clm
method
// hyperswitch/crates/api_models/src/admin.rs // impl for BusinessPaymentLinkConfig pub fn validate(&self) -> Result<(), &str> { let host_domain_valid = self .domain_name .clone() .map(|host_domain| link_utils::validate_strict_domain(&host_domain)) .unwrap_or(true); if !host_domain_valid { return Err("Invalid host domain name received in payment_link_config"); } let are_allowed_domains_valid = self .allowed_domains .clone() .map(|allowed_domains| { allowed_domains .iter() .all(|allowed_domain| link_utils::validate_wildcard_domain(allowed_domain)) }) .unwrap_or(true); if !are_allowed_domains_valid { return Err("Invalid allowed domain names received in payment_link_config"); } Ok(()) }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "BusinessPaymentLinkConfig", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "validate", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_ApiError_new
clm
method
// hyperswitch/crates/api_models/src/errors/types.rs // impl for ApiError pub fn new( sub_code: &'static str, error_identifier: u16, error_message: impl ToString, extra: Option<Extra>, ) -> Self { Self { sub_code, error_identifier, error_message: error_message.to_string(), extra, #[cfg(feature = "detailed_errors")] stacktrace: None, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "ApiError", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_ApiErrorResponse_get_internal_error
clm
method
// hyperswitch/crates/api_models/src/errors/types.rs // impl for ApiErrorResponse pub(crate) fn get_internal_error(&self) -> &ApiError { match self { Self::Unauthorized(i) | Self::ForbiddenCommonResource(i) | Self::ForbiddenPrivateResource(i) | Self::Conflict(i) | Self::Gone(i) | Self::Unprocessable(i) | Self::InternalServerError(i) | Self::NotImplemented(i) | Self::NotFound(i) | Self::MethodNotAllowed(i) | Self::BadRequest(i) | Self::DomainError(i) | Self::ConnectorError(i, _) => i, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "ApiErrorResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_internal_error", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_ApiErrorResponse_get_internal_error_mut
clm
method
// hyperswitch/crates/api_models/src/errors/types.rs // impl for ApiErrorResponse pub fn get_internal_error_mut(&mut self) -> &mut ApiError { match self { Self::Unauthorized(i) | Self::ForbiddenCommonResource(i) | Self::ForbiddenPrivateResource(i) | Self::Conflict(i) | Self::Gone(i) | Self::Unprocessable(i) | Self::InternalServerError(i) | Self::NotImplemented(i) | Self::NotFound(i) | Self::MethodNotAllowed(i) | Self::BadRequest(i) | Self::DomainError(i) | Self::ConnectorError(i, _) => i, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "ApiErrorResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_internal_error_mut", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_ApiErrorResponse_error_type
clm
method
// hyperswitch/crates/api_models/src/errors/types.rs // impl for ApiErrorResponse pub(crate) fn error_type(&self) -> &'static str { match self { Self::Unauthorized(_) | Self::ForbiddenCommonResource(_) | Self::ForbiddenPrivateResource(_) | Self::Conflict(_) | Self::Gone(_) | Self::Unprocessable(_) | Self::NotImplemented(_) | Self::MethodNotAllowed(_) | Self::NotFound(_) | Self::BadRequest(_) => "invalid_request", Self::InternalServerError(_) => "api", Self::DomainError(_) => "blocked", Self::ConnectorError(_, _) => "connector", } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "ApiErrorResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "error_type", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_PaymentIntentMetricsBucketIdentifier_new
clm
method
// hyperswitch/crates/api_models/src/analytics/payment_intents.rs // impl for PaymentIntentMetricsBucketIdentifier pub fn new( status: Option<IntentStatus>, currency: Option<Currency>, profile_id: Option<String>, connector: Option<String>, auth_type: Option<AuthenticationType>, payment_method: Option<String>, payment_method_type: Option<String>, card_network: Option<String>, merchant_id: Option<String>, card_last_4: Option<String>, card_issuer: Option<String>, error_reason: Option<String>, normalized_time_range: TimeRange, ) -> Self { Self { status, currency, profile_id, connector, auth_type, payment_method, payment_method_type, card_network, merchant_id, card_last_4, card_issuer, error_reason, time_bucket: normalized_time_range, start_time: normalized_time_range.start_time, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "PaymentIntentMetricsBucketIdentifier", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_ApiEventMetricsBucketIdentifier_new
clm
method
// hyperswitch/crates/api_models/src/analytics/api_event.rs // impl for ApiEventMetricsBucketIdentifier pub fn new(normalized_time_range: TimeRange) -> Self { Self { time_bucket: normalized_time_range, start_time: normalized_time_range.start_time, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "ApiEventMetricsBucketIdentifier", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_RefundMetricsBucketIdentifier_new
clm
method
// hyperswitch/crates/api_models/src/analytics/refunds.rs // impl for RefundMetricsBucketIdentifier pub fn new( currency: Option<Currency>, refund_status: Option<String>, connector: Option<String>, refund_type: Option<String>, profile_id: Option<String>, refund_reason: Option<String>, refund_error_message: Option<String>, normalized_time_range: TimeRange, ) -> Self { Self { currency, refund_status, connector, refund_type, profile_id, refund_reason, refund_error_message, time_bucket: normalized_time_range, start_time: normalized_time_range.start_time, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "RefundMetricsBucketIdentifier", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_PaymentMetricsBucketIdentifier_new
clm
method
// hyperswitch/crates/api_models/src/analytics/payments.rs // impl for PaymentMetricsBucketIdentifier pub fn new( currency: Option<Currency>, status: Option<AttemptStatus>, connector: Option<String>, auth_type: Option<AuthenticationType>, payment_method: Option<String>, payment_method_type: Option<String>, client_source: Option<String>, client_version: Option<String>, profile_id: Option<String>, card_network: Option<String>, merchant_id: Option<String>, card_last_4: Option<String>, card_issuer: Option<String>, error_reason: Option<String>, routing_approach: Option<RoutingApproach>, signature_network: Option<String>, is_issuer_regulated: Option<bool>, is_debit_routed: Option<bool>, normalized_time_range: TimeRange, ) -> Self { Self { currency, status, connector, auth_type, payment_method, payment_method_type, client_source, client_version, profile_id, card_network, merchant_id, card_last_4, card_issuer, error_reason, routing_approach, signature_network, is_issuer_regulated, is_debit_routed, time_bucket: normalized_time_range, start_time: normalized_time_range.start_time, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "PaymentMetricsBucketIdentifier", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_AuthEventMetricsBucketIdentifier_new
clm
method
// hyperswitch/crates/api_models/src/analytics/auth_events.rs // impl for AuthEventMetricsBucketIdentifier pub fn new( authentication_status: Option<AuthenticationStatus>, trans_status: Option<TransactionStatus>, authentication_type: Option<DecoupledAuthenticationType>, error_message: Option<String>, authentication_connector: Option<AuthenticationConnectors>, message_version: Option<String>, acs_reference_number: Option<String>, mcc: Option<String>, currency: Option<Currency>, merchant_country: Option<String>, billing_country: Option<String>, shipping_country: Option<String>, issuer_country: Option<String>, earliest_supported_version: Option<String>, latest_supported_version: Option<String>, whitelist_decision: Option<bool>, device_manufacturer: Option<String>, device_type: Option<String>, device_brand: Option<String>, device_os: Option<String>, device_display: Option<String>, browser_name: Option<String>, browser_version: Option<String>, issuer_id: Option<String>, scheme_name: Option<String>, exemption_requested: Option<bool>, exemption_accepted: Option<bool>, normalized_time_range: TimeRange, ) -> Self { Self { authentication_status, trans_status, authentication_type, error_message, authentication_connector, message_version, acs_reference_number, mcc, currency, merchant_country, billing_country, shipping_country, issuer_country, earliest_supported_version, latest_supported_version, whitelist_decision, device_manufacturer, device_type, device_brand, device_os, device_display, browser_name, browser_version, issuer_id, scheme_name, exemption_requested, exemption_accepted, time_bucket: normalized_time_range, start_time: normalized_time_range.start_time, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "AuthEventMetricsBucketIdentifier", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_DisputeMetricsBucketIdentifier_new
clm
method
// hyperswitch/crates/api_models/src/analytics/disputes.rs // impl for DisputeMetricsBucketIdentifier pub fn new( dispute_stage: Option<DisputeStage>, connector: Option<String>, currency: Option<Currency>, normalized_time_range: TimeRange, ) -> Self { Self { dispute_stage, connector, currency, time_bucket: normalized_time_range, start_time: normalized_time_range.start_time, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "DisputeMetricsBucketIdentifier", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_FrmMetricsBucketIdentifier_new
clm
method
// hyperswitch/crates/api_models/src/analytics/frm.rs // impl for FrmMetricsBucketIdentifier pub fn new( frm_status: Option<String>, frm_name: Option<String>, frm_transaction_type: Option<String>, normalized_time_range: TimeRange, ) -> Self { Self { frm_status, frm_name, frm_transaction_type, time_bucket: normalized_time_range, start_time: normalized_time_range.start_time, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "FrmMetricsBucketIdentifier", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_ActivePaymentsMetricsBucketIdentifier_new
clm
method
// hyperswitch/crates/api_models/src/analytics/active_payments.rs // impl for ActivePaymentsMetricsBucketIdentifier pub fn new(time_bucket: Option<String>) -> Self { Self { time_bucket } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "ActivePaymentsMetricsBucketIdentifier", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_SearchFilters_is_all_none
clm
method
// hyperswitch/crates/api_models/src/analytics/search.rs // impl for SearchFilters pub fn is_all_none(&self) -> bool { self.payment_method.is_none() && self.currency.is_none() && self.status.is_none() && self.customer_email.is_none() && self.search_tags.is_none() && self.connector.is_none() && self.payment_method_type.is_none() && self.card_network.is_none() && self.card_last_4.is_none() && self.payment_id.is_none() && self.amount.is_none() && self.customer_id.is_none() }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "SearchFilters", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "is_all_none", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_api_models_SdkEventMetricsBucketIdentifier_new
clm
method
// hyperswitch/crates/api_models/src/analytics/sdk_events.rs // impl for SdkEventMetricsBucketIdentifier pub fn new( payment_method: Option<String>, platform: Option<String>, browser_name: Option<String>, source: Option<String>, component: Option<String>, payment_experience: Option<String>, time_bucket: Option<String>, ) -> Self { Self { payment_method, platform, browser_name, source, component, payment_experience, time_bucket, } }
{ "chunk": null, "crate": "api_models", "enum_name": null, "file_size": null, "for_type": "SdkEventMetricsBucketIdentifier", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_router_env_Level_into_level
clm
method
// hyperswitch/crates/router_env/src/logger/config.rs // impl for Level pub fn into_level(self) -> tracing::Level { self.0 }
{ "chunk": null, "crate": "router_env", "enum_name": null, "file_size": null, "for_type": "Level", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "into_level", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_router_env_Storage<'a>_new
clm
method
// hyperswitch/crates/router_env/src/logger/storage.rs // impl for Storage<'a> pub fn new() -> Self { Self::default() }
{ "chunk": null, "crate": "router_env", "enum_name": null, "file_size": null, "for_type": "Storage<'a>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_router_env_Storage<'a>_record_value
clm
method
// hyperswitch/crates/router_env/src/logger/storage.rs // impl for Storage<'a> pub fn record_value(&mut self, key: &'a str, value: serde_json::Value) { if super::formatter::IMPLICIT_KEYS.contains(key) { tracing::warn!(value =? value, "{} is a reserved entry. Skipping it.", key); } else { self.values.insert(key, value); } }
{ "chunk": null, "crate": "router_env", "enum_name": null, "file_size": null, "for_type": "Storage<'a>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "record_value", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_router_env_TraceUrlAssert_compare_url
clm
method
// hyperswitch/crates/router_env/src/logger/setup.rs // impl for TraceUrlAssert fn compare_url(&self, url: &str) -> bool { match self { Self::Match(value) => url == value, Self::EndsWith(end) => url.ends_with(end), } }
{ "chunk": null, "crate": "router_env", "enum_name": null, "file_size": null, "for_type": "TraceUrlAssert", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "compare_url", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_router_env_TraceAssertion_should_trace_url
clm
method
// hyperswitch/crates/router_env/src/logger/setup.rs // impl for TraceAssertion fn should_trace_url(&self, url: &str) -> bool { match &self.clauses { Some(clauses) => clauses.iter().all(|cur| cur.compare_url(url)), None => self.default, } }
{ "chunk": null, "crate": "router_env", "enum_name": null, "file_size": null, "for_type": "TraceAssertion", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "should_trace_url", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_RedisValue_new
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for RedisValue pub fn new(value: FredRedisValue) -> Self { Self { inner: value } }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "RedisValue", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_RedisValue_into_inner
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for RedisValue pub fn into_inner(self) -> FredRedisValue { self.inner }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "RedisValue", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "into_inner", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_RedisValue_from_bytes
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for RedisValue pub fn from_bytes(val: Vec<u8>) -> Self { Self { inner: FredRedisValue::Bytes(val.into()), } }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "RedisValue", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "from_bytes", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_RedisValue_from_string
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for RedisValue pub fn from_string(value: String) -> Self { Self { inner: FredRedisValue::String(value.into()), } }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "RedisValue", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "from_string", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_RedisSettings_validate
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for RedisSettings pub fn validate(&self) -> CustomResult<(), errors::RedisError> { use common_utils::{ext_traits::ConfigExt, fp_utils::when}; when(self.host.is_default_or_empty(), || { Err(errors::RedisError::InvalidConfiguration( "Redis `host` must be specified".into(), )) })?; when(self.cluster_enabled && self.cluster_urls.is_empty(), || { Err(errors::RedisError::InvalidConfiguration( "Redis `cluster_urls` must be specified if `cluster_enabled` is `true`".into(), )) })?; when( self.default_command_timeout < self.unresponsive_timeout, || { Err(errors::RedisError::InvalidConfiguration( "Unresponsive timeout cannot be greater than the command timeout".into(), ) .into()) }, ) }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "RedisSettings", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "validate", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_DelReply_is_key_deleted
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for DelReply pub fn is_key_deleted(&self) -> bool { matches!(self, Self::KeyDeleted) }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "DelReply", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "is_key_deleted", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_DelReply_is_key_not_deleted
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for DelReply pub fn is_key_not_deleted(&self) -> bool { matches!(self, Self::KeyNotDeleted) }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "DelReply", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "is_key_not_deleted", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_SetGetReply<T>_get_value
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for SetGetReply<T> pub fn get_value(&self) -> &T { match self { Self::ValueSet(value) => value, Self::ValueExists(value) => value, } }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "SetGetReply<T>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_value", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_RedisKey_tenant_aware_key
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for RedisKey pub fn tenant_aware_key(&self, pool: &RedisConnectionPool) -> String { pool.add_prefix(&self.0) }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "RedisKey", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "tenant_aware_key", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_redis_interface_RedisKey_tenant_unaware_key
clm
method
// hyperswitch/crates/redis_interface/src/types.rs // impl for RedisKey pub fn tenant_unaware_key(&self, _pool: &RedisConnectionPool) -> String { self.0.clone() }
{ "chunk": null, "crate": "redis_interface", "enum_name": null, "file_size": null, "for_type": "RedisKey", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "tenant_unaware_key", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_events_EventBuilder<T, A, E, D>_with
clm
method
// hyperswitch/crates/events/src/lib.rs // impl for EventBuilder<T, A, E, D> pub fn with<F: ErasedMaskSerialize, G: EventInfo<Data = F> + 'static>( mut self, info: G, ) -> Self { info.data() .and_then(|i| { i.masked_serialize() .change_context(EventsError::SerializationError) }) .map_err(|e| { logger::error!("Error adding event info: {:?}", e); }) .ok() .and_then(|data| self.metadata.insert(info.key(), data)); self }
{ "chunk": null, "crate": "events", "enum_name": null, "file_size": null, "for_type": "EventBuilder<T, A, E, D>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "with", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_events_EventContext<T, A>_emit
clm
method
// hyperswitch/crates/events/src/lib.rs // impl for EventContext<T, A> pub fn emit<D, E: Event<EventType = T, Data = D>>(&self, event: E) { EventBuilder { message_sink: self.message_sink.clone(), metadata: self.metadata.clone(), event, } .emit() }
{ "chunk": null, "crate": "events", "enum_name": null, "file_size": null, "for_type": "EventContext<T, A>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "emit", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_events_EventContext<T, A>_try_emit
clm
method
// hyperswitch/crates/events/src/lib.rs // impl for EventContext<T, A> pub fn try_emit<E: Event<EventType = T>>(&self, event: E) -> Result<(), EventsError> { EventBuilder { message_sink: self.message_sink.clone(), metadata: self.metadata.clone(), event, } .try_emit() }
{ "chunk": null, "crate": "events", "enum_name": null, "file_size": null, "for_type": "EventContext<T, A>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "try_emit", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_events_EventContext<T, A>_new
clm
method
// hyperswitch/crates/events/src/lib.rs // impl for EventContext<T, A> pub fn new(message_sink: A) -> Self { Self { message_sink: Arc::new(message_sink), metadata: HashMap::new(), } }
{ "chunk": null, "crate": "events", "enum_name": null, "file_size": null, "for_type": "EventContext<T, A>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_events_EventContext<T, A>_record_info
clm
method
// hyperswitch/crates/events/src/lib.rs // impl for EventContext<T, A> pub fn record_info<G: ErasedMaskSerialize, E: EventInfo<Data = G> + 'static>( &mut self, info: E, ) { match info.data().and_then(|i| { i.masked_serialize() .change_context(EventsError::SerializationError) }) { Ok(data) => { self.metadata.insert(info.key(), data); } Err(e) => { logger::error!("Error recording event info: {:?}", e); } } }
{ "chunk": null, "crate": "events", "enum_name": null, "file_size": null, "for_type": "EventContext<T, A>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "record_info", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_events_EventContext<T, A>_event
clm
method
// hyperswitch/crates/events/src/lib.rs // impl for EventContext<T, A> pub fn event<D, E: Event<EventType = T, Data = D>>( &self, event: E, ) -> EventBuilder<T, A, E, D> { EventBuilder { message_sink: self.message_sink.clone(), metadata: self.metadata.clone(), event, } }
{ "chunk": null, "crate": "events", "enum_name": null, "file_size": null, "for_type": "EventContext<T, A>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "event", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_payment_methods_PaymentMethodsState_find_payment_method
clm
method
// hyperswitch/crates/payment_methods/src/state.rs // impl for PaymentMethodsState pub async fn find_payment_method( &self, key_store: &merchant_key_store::MerchantKeyStore, merchant_account: &merchant_account::MerchantAccount, payment_method_id: String, ) -> CustomResult<pm_domain::PaymentMethod, errors::StorageError> { let db = &*self.store; let key_manager_state = &(self.key_manager_state).clone(); match db .find_payment_method( key_manager_state, key_store, &payment_method_id, merchant_account.storage_scheme, ) .await { Err(err) if err.current_context().is_db_not_found() => { db.find_payment_method_by_locker_id( key_manager_state, key_store, &payment_method_id, merchant_account.storage_scheme, ) .await } Ok(pm) => Ok(pm), Err(err) => Err(err), } }
{ "chunk": null, "crate": "payment_methods", "enum_name": null, "file_size": null, "for_type": "PaymentMethodsState", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "find_payment_method", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_payment_methods_RecordMigrationStatusBuilder_new
clm
method
// hyperswitch/crates/payment_methods/src/core/migration.rs // impl for RecordMigrationStatusBuilder pub fn new() -> Self { Self { card_migrated: None, network_token_migrated: None, connector_mandate_details_migrated: None, network_transaction_migrated: None, } }
{ "chunk": null, "crate": "payment_methods", "enum_name": null, "file_size": null, "for_type": "RecordMigrationStatusBuilder", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_payment_methods_RecordMigrationStatusBuilder_card_migrated
clm
method
// hyperswitch/crates/payment_methods/src/core/migration.rs // impl for RecordMigrationStatusBuilder pub fn card_migrated(&mut self, card_migrated: bool) { self.card_migrated = Some(card_migrated); }
{ "chunk": null, "crate": "payment_methods", "enum_name": null, "file_size": null, "for_type": "RecordMigrationStatusBuilder", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "card_migrated", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_payment_methods_RecordMigrationStatusBuilder_network_token_migrated
clm
method
// hyperswitch/crates/payment_methods/src/core/migration.rs // impl for RecordMigrationStatusBuilder pub fn network_token_migrated(&mut self, network_token_migrated: Option<bool>) { self.network_token_migrated = network_token_migrated; }
{ "chunk": null, "crate": "payment_methods", "enum_name": null, "file_size": null, "for_type": "RecordMigrationStatusBuilder", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "network_token_migrated", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_payment_methods_RecordMigrationStatusBuilder_connector_mandate_details_migrated
clm
method
// hyperswitch/crates/payment_methods/src/core/migration.rs // impl for RecordMigrationStatusBuilder pub fn connector_mandate_details_migrated( &mut self, connector_mandate_details_migrated: Option<bool>, ) { self.connector_mandate_details_migrated = connector_mandate_details_migrated; }
{ "chunk": null, "crate": "payment_methods", "enum_name": null, "file_size": null, "for_type": "RecordMigrationStatusBuilder", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "connector_mandate_details_migrated", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_payment_methods_RecordMigrationStatusBuilder_network_transaction_id_migrated
clm
method
// hyperswitch/crates/payment_methods/src/core/migration.rs // impl for RecordMigrationStatusBuilder pub fn network_transaction_id_migrated(&mut self, network_transaction_migrated: Option<bool>) { self.network_transaction_migrated = network_transaction_migrated; }
{ "chunk": null, "crate": "payment_methods", "enum_name": null, "file_size": null, "for_type": "RecordMigrationStatusBuilder", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "network_transaction_id_migrated", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_payment_methods_RecordMigrationStatusBuilder_build
clm
method
// hyperswitch/crates/payment_methods/src/core/migration.rs // impl for RecordMigrationStatusBuilder pub fn build(self) -> RecordMigrationStatus { RecordMigrationStatus { card_migrated: self.card_migrated, network_token_migrated: self.network_token_migrated, connector_mandate_details_migrated: self.connector_mandate_details_migrated, network_transaction_migrated: self.network_transaction_migrated, } }
{ "chunk": null, "crate": "payment_methods", "enum_name": null, "file_size": null, "for_type": "RecordMigrationStatusBuilder", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "build", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_payment_methods_RequiredField_to_tuple
clm
method
// hyperswitch/crates/payment_methods/src/configs/payment_connector_required_fields.rs // impl for RequiredField fn to_tuple(&self) -> (String, RequiredFieldInfo) { match self { Self::CardNumber => ( "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: FieldType::UserCardNumber, value: None, }, ), Self::CardExpMonth => ( "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: FieldType::UserCardExpiryMonth, value: None, }, ), Self::CardExpYear => ( "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: FieldType::UserCardExpiryYear, value: None, }, ), Self::CardCvc => ( "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: FieldType::UserCardCvc, value: None, }, ), Self::CardNetwork => ( "payment_method_data.card.card_network".to_string(), RequiredFieldInfo { required_field: "payment_method_data.card.card_network".to_string(), display_name: "card_network".to_string(), field_type: FieldType::UserCardNetwork, value: None, }, ), Self::BillingUserFirstName => ( "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: FieldType::UserFullName, value: None, }, ), Self::BillingUserLastName => ( "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: FieldType::UserFullName, value: None, }, ), Self::BillingFirstName(display_name, field_type) => ( "billing.address.first_name".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.address.first_name".to_string(), display_name: display_name.to_string(), field_type: field_type.clone(), value: None, }, ), Self::BillingLastName(display_name, field_type) => ( "billing.address.last_name".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.address.last_name".to_string(), display_name: display_name.to_string(), field_type: field_type.clone(), value: None, }, ), Self::Email => ( "email".to_string(), RequiredFieldInfo { required_field: "email".to_string(), display_name: "email".to_string(), field_type: FieldType::UserEmailAddress, value: None, }, ), Self::BillingEmail => ( "billing.email".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.email".to_string(), display_name: "email".to_string(), field_type: FieldType::UserEmailAddress, value: None, }, ), Self::BillingPhone => ( "billing.phone.number".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.phone.number".to_string(), display_name: "phone".to_string(), field_type: FieldType::UserPhoneNumber, value: None, }, ), Self::BillingPhoneCountryCode => ( "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: FieldType::UserPhoneNumberCountryCode, value: None, }, ), Self::BillingAddressLine1 => ( "billing.address.line1".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.address.line1".to_string(), display_name: "line1".to_string(), field_type: FieldType::UserAddressLine1, value: None, }, ), Self::BillingAddressLine2 => ( "billing.address.line2".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.address.line2".to_string(), display_name: "line2".to_string(), field_type: FieldType::UserAddressLine2, value: None, }, ), Self::BillingAddressCity => ( "billing.address.city".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.address.city".to_string(), display_name: "city".to_string(), field_type: FieldType::UserAddressCity, value: None, }, ), Self::BillingAddressState => ( "billing.address.state".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.address.state".to_string(), display_name: "state".to_string(), field_type: FieldType::UserAddressState, value: None, }, ), Self::BillingAddressZip => ( "billing.address.zip".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.address.zip".to_string(), display_name: "zip".to_string(), field_type: FieldType::UserAddressPincode, value: None, }, ), Self::BillingCountries(countries) => ( "billing.address.country".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: FieldType::UserCountry { options: countries.iter().map(|c| c.to_string()).collect(), }, value: None, }, ), Self::BillingAddressCountries(countries) => ( "billing.address.country".to_string(), RequiredFieldInfo { required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: FieldType::UserAddressCountry { options: countries.iter().map(|c| c.to_string()).collect(), }, value: None, }, ), Self::ShippingFirstName => ( "shipping.address.first_name".to_string(), RequiredFieldInfo { required_field: "shipping.address.first_name".to_string(), display_name: "shipping_first_name".to_string(), field_type: FieldType::UserShippingName, value: None, }, ), Self::ShippingLastName => ( "shipping.address.last_name".to_string(), RequiredFieldInfo { required_field: "shipping.address.last_name".to_string(), display_name: "shipping_last_name".to_string(), field_type: FieldType::UserShippingName, value: None, }, ), Self::ShippingAddressCity => ( "shipping.address.city".to_string(), RequiredFieldInfo { required_field: "shipping.address.city".to_string(), display_name: "city".to_string(), field_type: FieldType::UserShippingAddressCity, value: None, }, ), Self::ShippingAddressState => ( "shipping.address.state".to_string(), RequiredFieldInfo { required_field: "shipping.address.state".to_string(), display_name: "state".to_string(), field_type: FieldType::UserShippingAddressState, value: None, }, ), Self::ShippingAddressZip => ( "shipping.address.zip".to_string(), RequiredFieldInfo { required_field: "shipping.address.zip".to_string(), display_name: "zip".to_string(), field_type: FieldType::UserShippingAddressPincode, value: None, }, ), Self::ShippingCountries(countries) => ( "shipping.address.country".to_string(), RequiredFieldInfo { required_field: "shipping.address.country".to_string(), display_name: "country".to_string(), field_type: FieldType::UserCountry { options: countries.iter().map(|c| c.to_string()).collect(), }, value: None, }, ), Self::ShippingAddressCountries(countries) => ( "shipping.address.country".to_string(), RequiredFieldInfo { required_field: "shipping.address.country".to_string(), display_name: "country".to_string(), field_type: FieldType::UserShippingAddressCountry { options: countries.iter().map(|c| c.to_string()).collect(), }, value: None, }, ), Self::ShippingAddressLine1 => ( "shipping.address.line1".to_string(), RequiredFieldInfo { required_field: "shipping.address.line1".to_string(), display_name: "line1".to_string(), field_type: FieldType::UserShippingAddressLine1, value: None, }, ), Self::ShippingAddressLine2 => ( "shipping.address.line2".to_string(), RequiredFieldInfo { required_field: "shipping.address.line2".to_string(), display_name: "line2".to_string(), field_type: FieldType::UserShippingAddressLine2, value: None, }, ), Self::ShippingPhone => ( "shipping.phone.number".to_string(), RequiredFieldInfo { required_field: "shipping.phone.number".to_string(), display_name: "phone_number".to_string(), field_type: FieldType::UserPhoneNumber, value: None, }, ), Self::ShippingPhoneCountryCode => ( "shipping.phone.country_code".to_string(), RequiredFieldInfo { required_field: "shipping.phone.country_code".to_string(), display_name: "dialing_code".to_string(), field_type: FieldType::UserPhoneNumberCountryCode, value: None, }, ), Self::ShippingEmail => ( "shipping.email".to_string(), RequiredFieldInfo { required_field: "shipping.email".to_string(), display_name: "email".to_string(), field_type: FieldType::UserEmailAddress, value: None, }, ), Self::OpenBankingUkIssuer => ( "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: FieldType::UserBank, value: None, }, ), Self::OpenBankingCzechRepublicIssuer => ( "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: FieldType::UserBank, value: None, }, ), Self::OpenBankingPolandIssuer => ( "payment_method_data.bank_redirect.online_banking_poland.issuer".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_redirect.online_banking_poland.issuer".to_string(), display_name: "issuer".to_string(), field_type: FieldType::UserBank, value: None, }, ), Self::OpenBankingSlovakiaIssuer => ( "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: FieldType::UserBank, value: None, }, ), Self::OpenBankingFpxIssuer => ( "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: FieldType::UserBank, value: None, }, ), Self::OpenBankingThailandIssuer => ( "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: FieldType::UserBank, value: None, }, ), Self::BanContactCardNumber => ( "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: FieldType::UserCardNumber, value: None, }, ), Self::BanContactCardExpMonth => ( "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: FieldType::UserCardExpiryMonth, value: None, }, ), Self::BanContactCardExpYear => ( "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: FieldType::UserCardExpiryYear, value: None, }, ), Self::IdealBankName => ( "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: FieldType::UserBank, value: None, }, ), Self::EpsBankName => ( "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: FieldType::UserBank, value: None, }, ), Self::EpsBankOptions(bank) => ( "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: FieldType::UserBankOptions { options: bank.iter().map(|bank| bank.to_string()).collect(), }, value: None, }, ), Self::BlikCode => ( "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: FieldType::UserBlikCode, value: None, }, ), Self::MifinityDateOfBirth => ( "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: FieldType::UserDateOfBirth, value: None, }, ), Self::MifinityLanguagePreference(languages) => ( "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: FieldType::LanguagePreference { options: languages.iter().map(|l| l.to_string()).collect(), }, value: None, }, ), Self::CryptoNetwork => ( "payment_method_data.crypto.network".to_string(), RequiredFieldInfo { required_field: "payment_method_data.crypto.network".to_string(), display_name: "network".to_string(), field_type: FieldType::UserCryptoCurrencyNetwork, value: None, }, ), Self::CyptoPayCurrency(currencies) => ( "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: FieldType::UserCurrency { options: currencies.iter().map(|c| c.to_string()).collect(), }, value: None, }, ), Self::BoletoSocialSecurityNumber => ( "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: FieldType::UserSocialSecurityNumber, value: None, }, ), Self::UpiCollectVpaId => ( "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: FieldType::UserVpaId, value: None, }, ), Self::AchBankDebitAccountNumber => ( "payment_method_data.bank_debit.ach_bank_debit.account_number".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_debit.ach_bank_debit.account_number" .to_string(), display_name: "bank_account_number".to_string(), field_type: FieldType::UserBankAccountNumber, value: None, }, ), Self::AchBankDebitRoutingNumber => ( "payment_method_data.bank_debit.ach_bank_debit.routing_number".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_debit.ach_bank_debit.routing_number" .to_string(), display_name: "bank_routing_number".to_string(), field_type: FieldType::UserBankRoutingNumber, value: None, }, ), Self::AchBankDebitBankType(bank_type) => ( "payment_method_data.bank_debit.ach_bank_debit.bank_type".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_debit.ach_bank_debit.bank_type" .to_string(), display_name: "bank_type".to_string(), field_type: FieldType::UserBankType { options: bank_type.iter().map(|bt| bt.to_string()).collect(), }, value: None, }, ), Self::AchBankDebitBankAccountHolderName => ( "payment_method_data.bank_debit.ach_bank_debit.bank_account_holder_name" .to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_debit.ach_bank_debit.bank_account_holder_name" .to_string(), display_name: "bank_account_holder_name".to_string(), field_type: FieldType::UserBankAccountHolderName, value: None, }, ), Self::SepaBankDebitIban => ( "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: FieldType::UserIban, value: None, }, ), Self::BacsBankDebitAccountNumber => ( "payment_method_data.bank_debit.bacs_bank_debit.account_number".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_debit.bacs_bank_debit.account_number" .to_string(), display_name: "bank_account_number".to_string(), field_type: FieldType::UserBankAccountNumber, value: None, }, ), Self::BacsBankDebitSortCode => ( "payment_method_data.bank_debit.bacs_bank_debit.sort_code".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_debit.bacs_bank_debit.sort_code" .to_string(), display_name: "bank_sort_code".to_string(), field_type: FieldType::UserBankSortCode, value: None, }, ), Self::BecsBankDebitAccountNumber => ( "payment_method_data.bank_debit.becs_bank_debit.account_number".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_debit.becs_bank_debit.account_number" .to_string(), display_name: "bank_account_number".to_string(), field_type: FieldType::UserBankAccountNumber, value: None, }, ), Self::BecsBankDebitBsbNumber => ( "payment_method_data.bank_debit.becs_bank_debit.bsb_number".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_debit.becs_bank_debit.bsb_number" .to_string(), display_name: "bsb_number".to_string(), field_type: FieldType::UserBsbNumber, value: None, }, ), Self::BecsBankDebitSortCode => ( "payment_method_data.bank_debit.becs_bank_debit.sort_code".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_debit.becs_bank_debit.sort_code" .to_string(), display_name: "bank_sort_code".to_string(), field_type: FieldType::UserBankSortCode, value: None, }, ), Self::PixKey => ( "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: FieldType::UserPixKey, value: None, }, ), Self::PixCnpj => ( "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: FieldType::UserCnpj, value: None, }, ), Self::PixCpf => ( "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: FieldType::UserCpf, value: None, }, ), Self::PixSourceBankAccountId => ( "payment_method_data.bank_transfer.pix.source_bank_account_id".to_string(), RequiredFieldInfo { required_field: "payment_method_data.bank_transfer.pix.source_bank_account_id" .to_string(), display_name: "source_bank_account_id".to_string(), field_type: FieldType::UserSourceBankAccountId, value: None, }, ), Self::GiftCardNumber => ( "payment_method_data.gift_card.number".to_string(), RequiredFieldInfo { required_field: "payment_method_data.gift_card.givex.number".to_string(), display_name: "gift_card_number".to_string(), field_type: FieldType::UserCardNumber, value: None, }, ), Self::GiftCardCvc => ( "payment_method_data.gift_card.cvc".to_string(), RequiredFieldInfo { required_field: "payment_method_data.gift_card.givex.cvc".to_string(), display_name: "gift_card_cvc".to_string(), field_type: FieldType::UserCardCvc, value: None, }, ), Self::DcbMsisdn => ( "payment_method_data.mobile_payment.direct_carrier_billing.msisdn".to_string(), RequiredFieldInfo { required_field: "payment_method_data.mobile_payment.direct_carrier_billing.msisdn" .to_string(), display_name: "mobile_number".to_string(), field_type: FieldType::UserMsisdn, value: None, }, ), Self::DcbClientUid => ( "payment_method_data.mobile_payment.direct_carrier_billing.client_uid".to_string(), RequiredFieldInfo { required_field: "payment_method_data.mobile_payment.direct_carrier_billing.client_uid" .to_string(), display_name: "client_identifier".to_string(), field_type: FieldType::UserClientIdentifier, value: None, }, ), Self::OrderDetailsProductName => ( "order_details.0.product_name".to_string(), RequiredFieldInfo { required_field: "order_details.0.product_name".to_string(), display_name: "product_name".to_string(), field_type: FieldType::OrderDetailsProductName, value: None, }, ), Self::Description => ( "description".to_string(), RequiredFieldInfo { required_field: "description".to_string(), display_name: "description".to_string(), field_type: FieldType::Text, value: None, }, ), } }
{ "chunk": null, "crate": "payment_methods", "enum_name": null, "file_size": null, "for_type": "RequiredField", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "to_tuple", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_payment_methods_RequiredFields_new
clm
method
// hyperswitch/crates/payment_methods/src/configs/payment_connector_required_fields.rs // impl for RequiredFields pub fn new(bank_config: &BankRedirectConfig) -> Self { let cards_required_fields = get_cards_required_fields(); let mut debit_required_fields = cards_required_fields.clone(); debit_required_fields.extend(HashMap::from([ ( Connector::Bankofamerica, fields( vec![], vec![], [card_basic(), email(), full_name(), billing_address()].concat(), ), ), ( Connector::Getnet, fields( vec![], vec![], [card_basic(), vec![RequiredField::CardNetwork]].concat(), ), ), ])); Self(HashMap::from([ ( enums::PaymentMethod::Card, PaymentMethodType(HashMap::from([ ( enums::PaymentMethodType::Debit, ConnectorFields { fields: cards_required_fields.clone(), }, ), ( enums::PaymentMethodType::Credit, ConnectorFields { fields: debit_required_fields.clone(), }, ), ])), ), ( enums::PaymentMethod::BankRedirect, PaymentMethodType(get_bank_redirect_required_fields(bank_config)), ), ( enums::PaymentMethod::Wallet, PaymentMethodType(get_wallet_required_fields()), ), ( enums::PaymentMethod::PayLater, PaymentMethodType(get_pay_later_required_fields()), ), ( enums::PaymentMethod::Crypto, PaymentMethodType(HashMap::from([( enums::PaymentMethodType::CryptoCurrency, connectors(vec![( Connector::Cryptopay, fields( vec![], vec![ RequiredField::CyptoPayCurrency(vec![ "BTC", "LTC", "ETH", "XRP", "XLM", "BCH", "ADA", "SOL", "SHIB", "TRX", "DOGE", "BNB", "USDT", "USDC", "DAI", ]), RequiredField::CryptoNetwork, ], vec![], ), )]), )])), ), ( enums::PaymentMethod::Voucher, PaymentMethodType(get_voucher_required_fields()), ), ( enums::PaymentMethod::Upi, PaymentMethodType(HashMap::from([( enums::PaymentMethodType::UpiCollect, connectors(vec![ ( Connector::Razorpay, fields( vec![], vec![], vec![ RequiredField::UpiCollectVpaId, RequiredField::BillingEmail, RequiredField::BillingPhone, RequiredField::BillingPhoneCountryCode, ], ), ), ( Connector::Phonepe, fields( vec![], vec![], vec![ RequiredField::UpiCollectVpaId, RequiredField::BillingEmail, RequiredField::BillingPhone, RequiredField::BillingPhoneCountryCode, ], ), ), ( Connector::Paytm, fields( vec![], vec![], vec![ RequiredField::UpiCollectVpaId, RequiredField::BillingEmail, RequiredField::BillingPhone, RequiredField::BillingPhoneCountryCode, ], ), ), ]), )])), ), ( enums::PaymentMethod::BankDebit, PaymentMethodType(get_bank_debit_required_fields()), ), ( enums::PaymentMethod::BankTransfer, PaymentMethodType(get_bank_transfer_required_fields()), ), ( enums::PaymentMethod::GiftCard, PaymentMethodType(HashMap::from([ ( enums::PaymentMethodType::PaySafeCard, connectors(vec![(Connector::Adyen, fields(vec![], vec![], vec![]))]), ), ( enums::PaymentMethodType::Givex, connectors(vec![( Connector::Adyen, fields( vec![], vec![RequiredField::GiftCardNumber, RequiredField::GiftCardCvc], vec![], ), )]), ), ])), ), ( enums::PaymentMethod::CardRedirect, PaymentMethodType(HashMap::from([ ( enums::PaymentMethodType::Benefit, connectors(vec![( Connector::Adyen, fields( vec![], vec![ RequiredField::BillingFirstName( "first_name", FieldType::UserFullName, ), RequiredField::BillingLastName( "last_name", FieldType::UserFullName, ), RequiredField::BillingEmail, RequiredField::BillingPhone, RequiredField::BillingPhoneCountryCode, ], vec![], ), )]), ), ( enums::PaymentMethodType::Knet, connectors(vec![( Connector::Adyen, fields( vec![], vec![ RequiredField::BillingFirstName( "first_name", FieldType::UserFullName, ), RequiredField::BillingLastName( "last_name", FieldType::UserFullName, ), RequiredField::BillingEmail, RequiredField::BillingPhone, RequiredField::BillingPhoneCountryCode, ], vec![], ), )]), ), ( enums::PaymentMethodType::MomoAtm, connectors(vec![( Connector::Adyen, fields( vec![], vec![ RequiredField::BillingEmail, RequiredField::BillingPhone, RequiredField::BillingPhoneCountryCode, ], vec![], ), )]), ), ])), ), ( enums::PaymentMethod::MobilePayment, PaymentMethodType(HashMap::from([( enums::PaymentMethodType::DirectCarrierBilling, connectors(vec![( Connector::Digitalvirgo, RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::new(), common: HashMap::from([ RequiredField::DcbMsisdn.to_tuple(), RequiredField::DcbClientUid.to_tuple(), RequiredField::OrderDetailsProductName.to_tuple(), ]), }, )]), )])), ), ])) }
{ "chunk": null, "crate": "payment_methods", "enum_name": null, "file_size": null, "for_type": "RequiredFields", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_pm_auth_ErrorResponse_get_not_implemented
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for ErrorResponse pub fn get_not_implemented() -> Self { Self { code: "IR_00".to_string(), message: "This API is under development and will be made available soon.".to_string(), reason: None, status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(), attempt_status: None, connector_transaction_id: None, network_decline_code: None, network_advice_code: None, network_error_message: None, connector_metadata: None, } }
{ "chunk": null, "crate": "pm_auth", "enum_name": null, "file_size": null, "for_type": "ErrorResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_not_implemented", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_pm_auth_ErrorResponse_get_not_implemented
clm
method
// hyperswitch/crates/pm_auth/src/types.rs // impl for ErrorResponse fn get_not_implemented() -> Self { Self { code: "IR_00".to_string(), message: "This API is under development and will be made available soon.".to_string(), reason: None, status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(), } }
{ "chunk": null, "crate": "pm_auth", "enum_name": null, "file_size": null, "for_type": "ErrorResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_not_implemented", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_CrmManagerConfig_validate
clm
method
// hyperswitch/crates/external_services/src/crm.rs // impl for CrmManagerConfig pub fn validate(&self) -> Result<(), InvalidCrmConfig> { match self { Self::HubspotProxy { hubspot_proxy } => hubspot_proxy.validate(), Self::NoCrm => Ok(()), } }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "CrmManagerConfig", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "validate", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_CrmManagerConfig_get_crm_client
clm
method
// hyperswitch/crates/external_services/src/crm.rs // impl for CrmManagerConfig pub async fn get_crm_client(&self) -> Arc<dyn CrmInterface> { match self { Self::HubspotProxy { hubspot_proxy } => Arc::new(hubspot_proxy.clone()), Self::NoCrm => Arc::new(NoCrm), } }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "CrmManagerConfig", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_crm_client", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_GrpcClientSettings_get_grpc_client_interface
clm
method
// hyperswitch/crates/external_services/src/grpc_client.rs // impl for GrpcClientSettings pub async fn get_grpc_client_interface(&self) -> Arc<GrpcClients> { #[cfg(any(feature = "dynamic_routing", feature = "revenue_recovery"))] let client = hyper_util::client::legacy::Client::builder(hyper_util::rt::TokioExecutor::new()) .http2_only(true) .build_http(); #[cfg(feature = "dynamic_routing")] let dynamic_routing_connection = self .dynamic_routing_client .clone() .map(|config| config.get_dynamic_routing_connection(client.clone())) .transpose() .expect("Failed to establish a connection with the Dynamic Routing Server") .flatten(); #[cfg(feature = "dynamic_routing")] let health_client = HealthCheckClient::build_connections(self, client.clone()) .await .expect("Failed to build gRPC connections"); let unified_connector_service_client = UnifiedConnectorServiceClient::build_connections(self).await; #[cfg(feature = "revenue_recovery")] let recovery_decider_client = { match &self.recovery_decider_client { Some(config) => { // Validate the config first config .validate() .expect("Recovery Decider configuration validation failed"); // Create the client let client = config .get_recovery_decider_connection(client.clone()) .expect( "Failed to establish a connection with the Recovery Decider Server", ); logger::info!("Recovery Decider gRPC client successfully initialized"); let boxed_client: Box<dyn RecoveryDeciderClientInterface> = Box::new(client); Some(boxed_client) } None => { logger::debug!("Recovery Decider client configuration not provided, client will be disabled"); None } } }; Arc::new(GrpcClients { #[cfg(feature = "dynamic_routing")] dynamic_routing: dynamic_routing_connection, #[cfg(feature = "dynamic_routing")] health_client, #[cfg(feature = "revenue_recovery")] recovery_decider_client, unified_connector_service_client, }) }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "GrpcClientSettings", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_grpc_client_interface", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_IntermediateString_new
clm
method
// hyperswitch/crates/external_services/src/email.rs // impl for IntermediateString pub fn new(inner: String) -> Self { Self(inner) }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "IntermediateString", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_IntermediateString_into_inner
clm
method
// hyperswitch/crates/external_services/src/email.rs // impl for IntermediateString pub fn into_inner(self) -> String { self.0 }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "IntermediateString", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "into_inner", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_FileStorageConfig_validate
clm
method
// hyperswitch/crates/external_services/src/file_storage.rs // impl for FileStorageConfig pub fn validate(&self) -> Result<(), InvalidFileStorageConfig> { match self { #[cfg(feature = "aws_s3")] Self::AwsS3 { aws_s3 } => aws_s3.validate(), Self::FileSystem => Ok(()), } }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "FileStorageConfig", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "validate", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_FileStorageConfig_get_file_storage_client
clm
method
// hyperswitch/crates/external_services/src/file_storage.rs // impl for FileStorageConfig pub async fn get_file_storage_client(&self) -> Arc<dyn FileStorageInterface> { match self { #[cfg(feature = "aws_s3")] Self::AwsS3 { aws_s3 } => Arc::new(aws_s3::AwsFileStorageClient::new(aws_s3).await), Self::FileSystem => Arc::new(file_system::FileSystem), } }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "FileStorageConfig", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_file_storage_client", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_HubspotRequest_new
clm
method
// hyperswitch/crates/external_services/src/hubspot_proxy.rs // impl for HubspotRequest pub fn new( country: String, hubspot_form_id: String, firstname: Secret<String>, email: Secret<String>, company_name: String, website: String, ) -> Self { Self { use_hubspot: true, country, hubspot_form_id, firstname, email, company_name, lead_source: HUBSPOT_LEAD_SOURCE.to_string(), website, ..Default::default() } }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "HubspotRequest", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_HashiCorpVaultConfig_validate
clm
method
// hyperswitch/crates/external_services/src/hashicorp_vault/core.rs // impl for HashiCorpVaultConfig pub fn validate(&self) -> Result<(), &'static str> { when(self.url.is_default_or_empty(), || { Err("HashiCorp vault url must not be empty") })?; when(self.token.is_default_or_empty(), || { Err("HashiCorp vault token must not be empty") }) }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "HashiCorpVaultConfig", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "validate", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_external_services_HashiCorpVault_new
clm
method
// hyperswitch/crates/external_services/src/hashicorp_vault/core.rs // impl for HashiCorpVault pub fn new(config: &HashiCorpVaultConfig) -> error_stack::Result<Self, HashiCorpError> { VaultClient::new( VaultClientSettingsBuilder::default() .address(&config.url) .token(config.token.peek()) .build() .map_err(Into::<Report<_>>::into) .change_context(HashiCorpError::ClientCreationFailed) .attach_printable("Failed while building vault settings")?, ) .map_err(Into::<Report<_>>::into) .change_context(HashiCorpError::ClientCreationFailed) .map(|client| Self { client }) }
{ "chunk": null, "crate": "external_services", "enum_name": null, "file_size": null, "for_type": "HashiCorpVault", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }