id
stringlengths
20
153
type
stringclasses
1 value
granularity
stringclasses
14 values
content
stringlengths
16
84.3k
metadata
dict
hyperswitch_fn_hyperswitch_domain_models_2798124759534596319
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs pub fn get_shipping_address_line2(&self) -> Option<Secret<String>> { self.shipping_details .as_ref() .and_then(|address| address.line2.clone()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_shipping_address_line2", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_8008755875213417906
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs pub fn from_option_secret_value( value: Option<common_utils::pii::SecretSerdeValue>, ) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> { value .parse_value::<Self>("ConnectorAuthType") .change_context(common_utils::errors::ParsingError::StructParseFailure( "ConnectorAuthType", )) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from_option_secret_value", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-7937323988987455151
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs pub fn from_secret_value( value: common_utils::pii::SecretSerdeValue, ) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> { value .parse_value::<Self>("ConnectorAuthType") .change_context(common_utils::errors::ParsingError::StructParseFailure( "ConnectorAuthType", )) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from_secret_value", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_8017410775586829368
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn mask_key(&self, key: String) -> Secret<String> { let key_len = key.len(); let masked_key = if key_len <= 4 { "*".repeat(key_len) } else { // Show the first two and last two characters, mask the rest with '*' let mut masked_key = String::new(); let key_len = key.len(); // Iterate through characters by their index for (index, character) in key.chars().enumerate() { if index < 2 || index >= key_len - 2 { masked_key.push(character); // Keep the first two and last two characters } else { masked_key.push('*'); // Mask the middle characters } } masked_key }; Secret::new(masked_key) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "mask_key", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_8895708029516682004
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs pub fn get_masked_keys(&self) -> Self { match self { Self::TemporaryAuth => Self::TemporaryAuth, Self::NoKey => Self::NoKey, Self::HeaderKey { api_key } => Self::HeaderKey { api_key: self.mask_key(api_key.clone().expose()), }, Self::BodyKey { api_key, key1 } => Self::BodyKey { api_key: self.mask_key(api_key.clone().expose()), key1: self.mask_key(key1.clone().expose()), }, Self::SignatureKey { api_key, key1, api_secret, } => Self::SignatureKey { api_key: self.mask_key(api_key.clone().expose()), key1: self.mask_key(key1.clone().expose()), api_secret: self.mask_key(api_secret.clone().expose()), }, Self::MultiAuthKey { api_key, key1, api_secret, key2, } => Self::MultiAuthKey { api_key: self.mask_key(api_key.clone().expose()), key1: self.mask_key(key1.clone().expose()), api_secret: self.mask_key(api_secret.clone().expose()), key2: self.mask_key(key2.clone().expose()), }, Self::CurrencyAuthKey { auth_key_map } => Self::CurrencyAuthKey { auth_key_map: auth_key_map.clone(), }, Self::CertificateAuth { certificate, private_key, } => Self::CertificateAuth { certificate: self.mask_key(certificate.clone().expose()), private_key: self.mask_key(private_key.clone().expose()), }, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_masked_keys", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_7298016394674977711
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn try_from(data: ApplePayPredecryptDataInternal) -> Result<Self, Self::Error> { let application_expiration_month = data.clone().get_expiry_month()?; let application_expiration_year = data.clone().get_four_digit_expiry_year()?; Ok(Self { application_primary_account_number: data.application_primary_account_number.clone(), application_expiration_month, application_expiration_year, payment_data: data.payment_data.into(), }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "try_from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_2517073608052043209
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn from(payment_data: ApplePayCryptogramDataInternal) -> Self { Self { online_payment_cryptogram: payment_data.online_payment_cryptogram, eci_indicator: payment_data.eci_indicator, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-3152482745398264155
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn get_four_digit_expiry_year( &self, ) -> Result<Secret<String>, common_utils::errors::ValidationError> { Ok(Secret::new(format!( "20{}", self.application_expiration_date.get(0..2).ok_or( common_utils::errors::ValidationError::InvalidValue { message: "Invalid two-digit year".to_string(), } )? ))) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_four_digit_expiry_year", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_3287911433080994420
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn get_expiry_month(&self) -> Result<Secret<String>, common_utils::errors::ValidationError> { Ok(Secret::new( self.application_expiration_date .get(2..4) .ok_or(common_utils::errors::ValidationError::InvalidValue { message: "Invalid two-digit month".to_string(), })? .to_owned(), )) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_expiry_month", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_4441313392895992683
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs pub fn with_additional_payment_method_data( additional_payment_method_data: AdditionalPaymentMethodConnectorResponse, ) -> Self { Self { additional_payment_method_data: Some(additional_payment_method_data), extended_authorization_response_data: None, is_overcapture_enabled: None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "with_additional_payment_method_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_2338272097028943684
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs pub fn new( additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>, is_overcapture_enabled: Option<primitive_wrappers::OvercaptureEnabledBool>, extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>, ) -> Self { Self { additional_payment_method_data, extended_authorization_response_data, is_overcapture_enabled, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "new", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-3097459491099464926
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs pub fn get_extended_authorization_response_data( &self, ) -> Option<&ExtendedAuthorizationResponseData> { self.extended_authorization_response_data.as_ref() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_extended_authorization_response_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-2745092923745869860
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs pub fn is_overcapture_enabled(&self) -> Option<primitive_wrappers::OvercaptureEnabledBool> { self.is_overcapture_enabled }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "is_overcapture_enabled", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-6299516292557787223
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn default() -> Self { Self { code: "HE_00".to_string(), message: "Something went wrong".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": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "default", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-1054767063913199868
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs 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": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_not_implemented", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_1062021228294712176
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn get_payment_intent_update( &self, payment_data: &payments::PaymentCancelData<router_flow_types::Void>, storage_scheme: common_enums::MerchantStorageScheme, ) -> PaymentIntentUpdate { let intent_status = common_enums::IntentStatus::from(self.get_attempt_status_for_db_update(payment_data)); PaymentIntentUpdate::VoidUpdate { status: intent_status, updated_by: storage_scheme.to_string(), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_payment_intent_update", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-7501310123883914700
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn get_payment_attempt_update( &self, payment_data: &payments::PaymentCancelData<router_flow_types::Void>, storage_scheme: common_enums::MerchantStorageScheme, ) -> PaymentAttemptUpdate { match &self.response { Err(ref error_response) => { let ErrorResponse { code, message, reason, status_code: _, attempt_status: _, connector_transaction_id, network_decline_code, network_advice_code, network_error_message, connector_metadata: _, } = error_response.clone(); // Handle errors exactly let status = match error_response.attempt_status { // Use the status sent by connector in error_response if it's present Some(status) => status, None => match error_response.status_code { 500..=511 => common_enums::AttemptStatus::Pending, _ => common_enums::AttemptStatus::VoidFailed, }, }; let error_details = ErrorDetails { code, message, reason, unified_code: None, unified_message: None, network_advice_code, network_decline_code, network_error_message, }; PaymentAttemptUpdate::ErrorUpdate { status, amount_capturable: Some(MinorUnit::zero()), error: error_details, updated_by: storage_scheme.to_string(), connector_payment_id: connector_transaction_id, } } Ok(ref _response) => PaymentAttemptUpdate::VoidUpdate { status: self.status, cancellation_reason: payment_data.payment_attempt.cancellation_reason.clone(), updated_by: storage_scheme.to_string(), }, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_payment_attempt_update", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-52112974173616685
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn get_attempt_status_for_db_update( &self, _payment_data: &payments::PaymentCancelData<router_flow_types::Void>, ) -> common_enums::AttemptStatus { // For void operations, determine status based on response match &self.response { Err(ref error_response) => match error_response.attempt_status { Some(status) => status, None => match error_response.status_code { 500..=511 => common_enums::AttemptStatus::Pending, _ => common_enums::AttemptStatus::VoidFailed, }, }, Ok(ref _response) => self.status, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_attempt_status_for_db_update", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-5871156169944085460
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn get_amount_capturable( &self, _payment_data: &payments::PaymentCancelData<router_flow_types::Void>, ) -> Option<MinorUnit> { // For void operations, no amount is capturable Some(MinorUnit::zero()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_amount_capturable", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-6837823449876397526
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs fn get_captured_amount( &self, _payment_data: &payments::PaymentCancelData<router_flow_types::Void>, ) -> Option<MinorUnit> { // For void operations, no amount is captured Some(MinorUnit::zero()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_captured_amount", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_3273793139541347750
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn is_external_vault_enabled(&self) -> bool { self.is_external_vault_enabled.unwrap_or(false) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "is_external_vault_enabled", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-2442451268795841653
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs fn try_from( item: (Option<bool>, Option<ExternalVaultConnectorDetails>), ) -> Result<Self, Self::Error> { match item { (is_external_vault_enabled, external_vault_connector_details) if is_external_vault_enabled.unwrap_or(false) => { Ok(Self::ExternalVaultEnabled( external_vault_connector_details .get_required_value("ExternalVaultConnectorDetails")?, )) } _ => Ok(Self::Skip), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "try_from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_4081015309504726830
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs fn from(profile_update: ProfileUpdate) -> Self { let now = date_time::now(); match profile_update { ProfileUpdate::Update(update) => { let ProfileGeneralUpdate { profile_name, return_url, enable_payment_response_hash, payment_response_hash_key, redirect_to_merchant_with_http_post, webhook_details, metadata, applepay_verified_domains, payment_link_config, session_expiry, authentication_connector_details, payout_link_config, extended_card_info_config, use_billing_as_payment_method_billing, collect_shipping_details_from_wallet_connector, collect_billing_details_from_wallet_connector, is_connector_agnostic_mit_enabled, outgoing_webhook_custom_http_headers, always_collect_billing_details_from_wallet_connector, always_collect_shipping_details_from_wallet_connector, order_fulfillment_time, order_fulfillment_time_origin, is_network_tokenization_enabled, is_click_to_pay_enabled, authentication_product_ids, three_ds_decision_manager_config, card_testing_guard_config, card_testing_secret_key, is_debit_routing_enabled, merchant_business_country, is_iframe_redirection_enabled, is_external_vault_enabled, external_vault_connector_details, merchant_category_code, merchant_country_code, revenue_recovery_retry_algorithm_type, split_txns_enabled, billing_processor_id, } = *update; Self { profile_name, modified_at: now, return_url, enable_payment_response_hash, payment_response_hash_key, redirect_to_merchant_with_http_post, webhook_details, metadata, is_recon_enabled: None, applepay_verified_domains, payment_link_config, session_expiry, authentication_connector_details, payout_link_config, is_extended_card_info_enabled: None, extended_card_info_config, is_connector_agnostic_mit_enabled, use_billing_as_payment_method_billing, collect_shipping_details_from_wallet_connector, collect_billing_details_from_wallet_connector, outgoing_webhook_custom_http_headers: outgoing_webhook_custom_http_headers .map(Encryption::from), routing_algorithm_id: None, always_collect_billing_details_from_wallet_connector, always_collect_shipping_details_from_wallet_connector, order_fulfillment_time, order_fulfillment_time_origin, frm_routing_algorithm_id: None, payout_routing_algorithm_id: None, default_fallback_routing: None, should_collect_cvv_during_payment: None, tax_connector_id: None, is_tax_connector_enabled: None, is_l2_l3_enabled: None, is_network_tokenization_enabled, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled, authentication_product_ids, three_ds_decision_manager_config, card_testing_guard_config, card_testing_secret_key: card_testing_secret_key.map(Encryption::from), is_clear_pan_retries_enabled: None, is_debit_routing_enabled, merchant_business_country, revenue_recovery_retry_algorithm_type, revenue_recovery_retry_algorithm_data: None, is_iframe_redirection_enabled, is_external_vault_enabled, external_vault_connector_details, merchant_category_code, merchant_country_code, split_txns_enabled, billing_processor_id, } } ProfileUpdate::RoutingAlgorithmUpdate { routing_algorithm_id, payout_routing_algorithm_id, } => Self { profile_name: None, modified_at: now, return_url: None, enable_payment_response_hash: None, payment_response_hash_key: None, redirect_to_merchant_with_http_post: None, webhook_details: None, metadata: None, is_recon_enabled: None, applepay_verified_domains: None, payment_link_config: None, session_expiry: None, authentication_connector_details: None, payout_link_config: None, is_extended_card_info_enabled: None, extended_card_info_config: None, is_connector_agnostic_mit_enabled: None, use_billing_as_payment_method_billing: None, collect_shipping_details_from_wallet_connector: None, collect_billing_details_from_wallet_connector: None, outgoing_webhook_custom_http_headers: None, routing_algorithm_id, always_collect_billing_details_from_wallet_connector: None, always_collect_shipping_details_from_wallet_connector: None, order_fulfillment_time: None, order_fulfillment_time_origin: None, frm_routing_algorithm_id: None, payout_routing_algorithm_id, default_fallback_routing: None, should_collect_cvv_during_payment: None, tax_connector_id: None, is_tax_connector_enabled: None, is_l2_l3_enabled: None, is_network_tokenization_enabled: None, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: None, authentication_product_ids: None, three_ds_decision_manager_config: None, card_testing_guard_config: None, card_testing_secret_key: None, is_clear_pan_retries_enabled: None, is_debit_routing_enabled: None, merchant_business_country: None, revenue_recovery_retry_algorithm_type: None, revenue_recovery_retry_algorithm_data: None, is_iframe_redirection_enabled: None, is_external_vault_enabled: None, external_vault_connector_details: None, merchant_category_code: None, merchant_country_code: None, split_txns_enabled: None, billing_processor_id: None, }, ProfileUpdate::ExtendedCardInfoUpdate { is_extended_card_info_enabled, } => Self { profile_name: None, modified_at: now, return_url: None, enable_payment_response_hash: None, payment_response_hash_key: None, redirect_to_merchant_with_http_post: None, webhook_details: None, metadata: None, is_recon_enabled: None, applepay_verified_domains: None, payment_link_config: None, session_expiry: None, authentication_connector_details: None, payout_link_config: None, is_extended_card_info_enabled: Some(is_extended_card_info_enabled), extended_card_info_config: None, is_connector_agnostic_mit_enabled: None, use_billing_as_payment_method_billing: None, collect_shipping_details_from_wallet_connector: None, collect_billing_details_from_wallet_connector: None, outgoing_webhook_custom_http_headers: None, always_collect_billing_details_from_wallet_connector: None, always_collect_shipping_details_from_wallet_connector: None, routing_algorithm_id: None, payout_routing_algorithm_id: None, order_fulfillment_time: None, order_fulfillment_time_origin: None, frm_routing_algorithm_id: None, default_fallback_routing: None, should_collect_cvv_during_payment: None, tax_connector_id: None, is_tax_connector_enabled: None, is_l2_l3_enabled: None, is_network_tokenization_enabled: None, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: None, authentication_product_ids: None, three_ds_decision_manager_config: None, card_testing_guard_config: None, card_testing_secret_key: None, is_clear_pan_retries_enabled: None, is_debit_routing_enabled: None, merchant_business_country: None, revenue_recovery_retry_algorithm_type: None, revenue_recovery_retry_algorithm_data: None, is_iframe_redirection_enabled: None, is_external_vault_enabled: None, external_vault_connector_details: None, merchant_category_code: None, merchant_country_code: None, split_txns_enabled: None, billing_processor_id: None, }, ProfileUpdate::ConnectorAgnosticMitUpdate { is_connector_agnostic_mit_enabled, } => Self { profile_name: None, modified_at: now, return_url: None, enable_payment_response_hash: None, payment_response_hash_key: None, redirect_to_merchant_with_http_post: None, webhook_details: None, metadata: None, is_recon_enabled: None, applepay_verified_domains: None, payment_link_config: None, is_l2_l3_enabled: None, session_expiry: None, authentication_connector_details: None, payout_link_config: None, is_extended_card_info_enabled: None, extended_card_info_config: None, is_connector_agnostic_mit_enabled: Some(is_connector_agnostic_mit_enabled), use_billing_as_payment_method_billing: None, collect_shipping_details_from_wallet_connector: None, collect_billing_details_from_wallet_connector: None, outgoing_webhook_custom_http_headers: None, always_collect_billing_details_from_wallet_connector: None, always_collect_shipping_details_from_wallet_connector: None, routing_algorithm_id: None, payout_routing_algorithm_id: None, order_fulfillment_time: None, order_fulfillment_time_origin: None, frm_routing_algorithm_id: None, default_fallback_routing: None, should_collect_cvv_during_payment: None, tax_connector_id: None, is_tax_connector_enabled: None, is_network_tokenization_enabled: None, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: None, authentication_product_ids: None, three_ds_decision_manager_config: None, card_testing_guard_config: None, card_testing_secret_key: None, is_clear_pan_retries_enabled: None, is_debit_routing_enabled: None, merchant_business_country: None, revenue_recovery_retry_algorithm_type: None, revenue_recovery_retry_algorithm_data: None, is_iframe_redirection_enabled: None, is_external_vault_enabled: None, external_vault_connector_details: None, merchant_category_code: None, merchant_country_code: None, split_txns_enabled: None, billing_processor_id: None, }, ProfileUpdate::DefaultRoutingFallbackUpdate { default_fallback_routing, } => Self { profile_name: None, modified_at: now, return_url: None, enable_payment_response_hash: None, payment_response_hash_key: None, redirect_to_merchant_with_http_post: None, webhook_details: None, metadata: None, is_recon_enabled: None, applepay_verified_domains: None, is_l2_l3_enabled: None, payment_link_config: None, session_expiry: None, authentication_connector_details: None, payout_link_config: None, is_extended_card_info_enabled: None, extended_card_info_config: None, is_connector_agnostic_mit_enabled: None, use_billing_as_payment_method_billing: None, collect_shipping_details_from_wallet_connector: None, collect_billing_details_from_wallet_connector: None, outgoing_webhook_custom_http_headers: None, always_collect_billing_details_from_wallet_connector: None, always_collect_shipping_details_from_wallet_connector: None, routing_algorithm_id: None, payout_routing_algorithm_id: None, order_fulfillment_time: None, order_fulfillment_time_origin: None, frm_routing_algorithm_id: None, default_fallback_routing, should_collect_cvv_during_payment: None, tax_connector_id: None, is_tax_connector_enabled: None, is_network_tokenization_enabled: None, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: None, authentication_product_ids: None, three_ds_decision_manager_config: None, card_testing_guard_config: None, card_testing_secret_key: None, is_clear_pan_retries_enabled: None, is_debit_routing_enabled: None, merchant_business_country: None, revenue_recovery_retry_algorithm_type: None, revenue_recovery_retry_algorithm_data: None, is_iframe_redirection_enabled: None, is_external_vault_enabled: None, external_vault_connector_details: None, merchant_category_code: None, merchant_country_code: None, split_txns_enabled: None, billing_processor_id: None, }, ProfileUpdate::NetworkTokenizationUpdate { is_network_tokenization_enabled, } => Self { profile_name: None, modified_at: now, return_url: None, enable_payment_response_hash: None, is_l2_l3_enabled: None, payment_response_hash_key: None, redirect_to_merchant_with_http_post: None, webhook_details: None, metadata: None, is_recon_enabled: None, applepay_verified_domains: None, payment_link_config: None, session_expiry: None, authentication_connector_details: None, payout_link_config: None, is_extended_card_info_enabled: None, extended_card_info_config: None, is_connector_agnostic_mit_enabled: None, use_billing_as_payment_method_billing: None, collect_shipping_details_from_wallet_connector: None, collect_billing_details_from_wallet_connector: None, outgoing_webhook_custom_http_headers: None, always_collect_billing_details_from_wallet_connector: None, always_collect_shipping_details_from_wallet_connector: None, routing_algorithm_id: None, payout_routing_algorithm_id: None, order_fulfillment_time: None, order_fulfillment_time_origin: None, frm_routing_algorithm_id: None, default_fallback_routing: None, should_collect_cvv_during_payment: None, tax_connector_id: None, is_tax_connector_enabled: None, is_network_tokenization_enabled: Some(is_network_tokenization_enabled), is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: None, authentication_product_ids: None, three_ds_decision_manager_config: None, card_testing_guard_config: None, card_testing_secret_key: None, is_clear_pan_retries_enabled: None, is_debit_routing_enabled: None, merchant_business_country: None, revenue_recovery_retry_algorithm_type: None, revenue_recovery_retry_algorithm_data: None, is_iframe_redirection_enabled: None, is_external_vault_enabled: None, external_vault_connector_details: None, merchant_category_code: None, merchant_country_code: None, split_txns_enabled: None, billing_processor_id: None, }, ProfileUpdate::CollectCvvDuringPaymentUpdate { should_collect_cvv_during_payment, } => Self { profile_name: None, modified_at: now, return_url: None, enable_payment_response_hash: None, payment_response_hash_key: None, redirect_to_merchant_with_http_post: None, webhook_details: None, metadata: None, is_recon_enabled: None, applepay_verified_domains: None, payment_link_config: None, session_expiry: None, authentication_connector_details: None, payout_link_config: None, is_extended_card_info_enabled: None, extended_card_info_config: None, is_connector_agnostic_mit_enabled: None, use_billing_as_payment_method_billing: None, collect_shipping_details_from_wallet_connector: None, collect_billing_details_from_wallet_connector: None, outgoing_webhook_custom_http_headers: None, always_collect_billing_details_from_wallet_connector: None, always_collect_shipping_details_from_wallet_connector: None, routing_algorithm_id: None, payout_routing_algorithm_id: None, order_fulfillment_time: None, order_fulfillment_time_origin: None, frm_routing_algorithm_id: None, default_fallback_routing: None, should_collect_cvv_during_payment: Some(should_collect_cvv_during_payment), tax_connector_id: None, is_tax_connector_enabled: None, is_network_tokenization_enabled: None, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: None, authentication_product_ids: None, is_l2_l3_enabled: None, three_ds_decision_manager_config: None, card_testing_guard_config: None, card_testing_secret_key: None, is_clear_pan_retries_enabled: None, is_debit_routing_enabled: None, merchant_business_country: None, revenue_recovery_retry_algorithm_type: None, revenue_recovery_retry_algorithm_data: None, is_iframe_redirection_enabled: None, is_external_vault_enabled: None, external_vault_connector_details: None, merchant_category_code: None, merchant_country_code: None, split_txns_enabled: None, billing_processor_id: None, }, ProfileUpdate::DecisionManagerRecordUpdate { three_ds_decision_manager_config, } => Self { profile_name: None, modified_at: now, return_url: None, enable_payment_response_hash: None, payment_response_hash_key: None, redirect_to_merchant_with_http_post: None, webhook_details: None, metadata: None, is_recon_enabled: None, applepay_verified_domains: None, payment_link_config: None, session_expiry: None, authentication_connector_details: None, payout_link_config: None, is_extended_card_info_enabled: None, extended_card_info_config: None, is_connector_agnostic_mit_enabled: None, use_billing_as_payment_method_billing: None, collect_shipping_details_from_wallet_connector: None, collect_billing_details_from_wallet_connector: None, outgoing_webhook_custom_http_headers: None, always_collect_billing_details_from_wallet_connector: None, always_collect_shipping_details_from_wallet_connector: None, routing_algorithm_id: None, payout_routing_algorithm_id: None, order_fulfillment_time: None, order_fulfillment_time_origin: None, frm_routing_algorithm_id: None, default_fallback_routing: None, should_collect_cvv_during_payment: None, tax_connector_id: None, is_tax_connector_enabled: None, is_network_tokenization_enabled: None, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: None, authentication_product_ids: None, three_ds_decision_manager_config: Some(three_ds_decision_manager_config), card_testing_guard_config: None, card_testing_secret_key: None, is_l2_l3_enabled: None, is_clear_pan_retries_enabled: None, is_debit_routing_enabled: None, merchant_business_country: None, revenue_recovery_retry_algorithm_type: None, revenue_recovery_retry_algorithm_data: None, is_iframe_redirection_enabled: None, is_external_vault_enabled: None, external_vault_connector_details: None, merchant_category_code: None, merchant_country_code: None, split_txns_enabled: None, billing_processor_id: None, }, ProfileUpdate::CardTestingSecretKeyUpdate { card_testing_secret_key, } => Self { profile_name: None, modified_at: now, return_url: None, enable_payment_response_hash: None, payment_response_hash_key: None, redirect_to_merchant_with_http_post: None, webhook_details: None, metadata: None, is_recon_enabled: None, applepay_verified_domains: None, payment_link_config: None, session_expiry: None, authentication_connector_details: None, payout_link_config: None, is_extended_card_info_enabled: None, extended_card_info_config: None, is_connector_agnostic_mit_enabled: None, use_billing_as_payment_method_billing: None, collect_shipping_details_from_wallet_connector: None, collect_billing_details_from_wallet_connector: None, outgoing_webhook_custom_http_headers: None, always_collect_billing_details_from_wallet_connector: None, always_collect_shipping_details_from_wallet_connector: None, routing_algorithm_id: None, payout_routing_algorithm_id: None, order_fulfillment_time: None, order_fulfillment_time_origin: None, frm_routing_algorithm_id: None, default_fallback_routing: None, should_collect_cvv_during_payment: None, tax_connector_id: None, is_tax_connector_enabled: None, is_network_tokenization_enabled: None, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: None, authentication_product_ids: None, three_ds_decision_manager_config: None, card_testing_guard_config: None, card_testing_secret_key: card_testing_secret_key.map(Encryption::from), is_clear_pan_retries_enabled: None, is_debit_routing_enabled: None, is_l2_l3_enabled: None, merchant_business_country: None, revenue_recovery_retry_algorithm_type: None, revenue_recovery_retry_algorithm_data: None, is_iframe_redirection_enabled: None, is_external_vault_enabled: None, external_vault_connector_details: None, merchant_category_code: None, merchant_country_code: None, split_txns_enabled: None, billing_processor_id: None, }, ProfileUpdate::RevenueRecoveryAlgorithmUpdate { revenue_recovery_retry_algorithm_type, revenue_recovery_retry_algorithm_data, } => Self { profile_name: None, modified_at: now, return_url: None, enable_payment_response_hash: None, payment_response_hash_key: None, redirect_to_merchant_with_http_post: None, webhook_details: None, metadata: None, is_recon_enabled: None, applepay_verified_domains: None, payment_link_config: None, session_expiry: None, authentication_connector_details: None, payout_link_config: None, is_extended_card_info_enabled: None, extended_card_info_config: None, is_connector_agnostic_mit_enabled: None, use_billing_as_payment_method_billing: None, collect_shipping_details_from_wallet_connector: None, collect_billing_details_from_wallet_connector: None, outgoing_webhook_custom_http_headers: None, always_collect_billing_details_from_wallet_connector: None, always_collect_shipping_details_from_wallet_connector: None, routing_algorithm_id: None, is_l2_l3_enabled: None, payout_routing_algorithm_id: None, order_fulfillment_time: None, order_fulfillment_time_origin: None, frm_routing_algorithm_id: None, default_fallback_routing: None, should_collect_cvv_during_payment: None, tax_connector_id: None, is_tax_connector_enabled: None, is_network_tokenization_enabled: None, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: None, authentication_product_ids: None, three_ds_decision_manager_config: None, card_testing_guard_config: None, card_testing_secret_key: None, is_clear_pan_retries_enabled: None, is_debit_routing_enabled: None, merchant_business_country: None, revenue_recovery_retry_algorithm_type: Some(revenue_recovery_retry_algorithm_type), revenue_recovery_retry_algorithm_data, is_iframe_redirection_enabled: None, is_external_vault_enabled: None, external_vault_connector_details: None, merchant_category_code: None, merchant_country_code: None, split_txns_enabled: None, billing_processor_id: None, }, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_8316620933519471714
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_id(&self) -> &common_utils::id_type::ProfileId { &self.id }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_id", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_1991440591267882457
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs async fn convert(self) -> CustomResult<Self::DstType, ValidationError> { Ok(diesel_models::business_profile::Profile { id: self.id, merchant_id: self.merchant_id, profile_name: self.profile_name, created_at: self.created_at, modified_at: self.modified_at, return_url: self.return_url, enable_payment_response_hash: self.enable_payment_response_hash, payment_response_hash_key: self.payment_response_hash_key, redirect_to_merchant_with_http_post: self.redirect_to_merchant_with_http_post, webhook_details: self.webhook_details, metadata: self.metadata, is_recon_enabled: self.is_recon_enabled, applepay_verified_domains: self.applepay_verified_domains, payment_link_config: self.payment_link_config, session_expiry: self.session_expiry, authentication_connector_details: self.authentication_connector_details, payout_link_config: self.payout_link_config, is_extended_card_info_enabled: self.is_extended_card_info_enabled, extended_card_info_config: self.extended_card_info_config, is_connector_agnostic_mit_enabled: self.is_connector_agnostic_mit_enabled, use_billing_as_payment_method_billing: self.use_billing_as_payment_method_billing, collect_shipping_details_from_wallet_connector: self .collect_shipping_details_from_wallet_connector, collect_billing_details_from_wallet_connector: self .collect_billing_details_from_wallet_connector, outgoing_webhook_custom_http_headers: self .outgoing_webhook_custom_http_headers .map(Encryption::from), routing_algorithm_id: self.routing_algorithm_id, always_collect_billing_details_from_wallet_connector: self .always_collect_billing_details_from_wallet_connector, always_collect_shipping_details_from_wallet_connector: self .always_collect_shipping_details_from_wallet_connector, payout_routing_algorithm_id: self.payout_routing_algorithm_id, order_fulfillment_time: self.order_fulfillment_time, order_fulfillment_time_origin: self.order_fulfillment_time_origin, frm_routing_algorithm_id: self.frm_routing_algorithm_id, default_fallback_routing: self.default_fallback_routing, should_collect_cvv_during_payment: self.should_collect_cvv_during_payment, tax_connector_id: self.tax_connector_id, is_tax_connector_enabled: Some(self.is_tax_connector_enabled), version: self.version, dynamic_routing_algorithm: None, is_network_tokenization_enabled: self.is_network_tokenization_enabled, is_auto_retries_enabled: None, max_auto_retries_enabled: None, always_request_extended_authorization: None, is_click_to_pay_enabled: self.is_click_to_pay_enabled, authentication_product_ids: self.authentication_product_ids, three_ds_decision_manager_config: self.three_ds_decision_manager_config, card_testing_guard_config: self.card_testing_guard_config, card_testing_secret_key: self.card_testing_secret_key.map(|name| name.into()), is_clear_pan_retries_enabled: self.is_clear_pan_retries_enabled, force_3ds_challenge: None, is_debit_routing_enabled: self.is_debit_routing_enabled, merchant_business_country: self.merchant_business_country, revenue_recovery_retry_algorithm_type: self.revenue_recovery_retry_algorithm_type, revenue_recovery_retry_algorithm_data: self.revenue_recovery_retry_algorithm_data, is_iframe_redirection_enabled: self.is_iframe_redirection_enabled, is_external_vault_enabled: self.is_external_vault_enabled, external_vault_connector_details: self.external_vault_connector_details, three_ds_decision_rule_algorithm: None, acquirer_config_map: None, merchant_category_code: self.merchant_category_code, merchant_country_code: self.merchant_country_code, dispute_polling_interval: None, split_txns_enabled: Some(self.split_txns_enabled), is_manual_retry_enabled: None, is_l2_l3_enabled: None, always_enable_overcapture: None, billing_processor_id: self.billing_processor_id, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "convert", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-9112634224180046096
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs async fn convert_back( state: &keymanager::KeyManagerState, item: Self::DstType, key: &Secret<Vec<u8>>, key_manager_identifier: keymanager::Identifier, ) -> CustomResult<Self, ValidationError> where Self: Sized, { async { Ok::<Self, error_stack::Report<common_utils::errors::CryptoError>>(Self { id: item.id, merchant_id: item.merchant_id, profile_name: item.profile_name, created_at: item.created_at, modified_at: item.modified_at, return_url: item.return_url, enable_payment_response_hash: item.enable_payment_response_hash, payment_response_hash_key: item.payment_response_hash_key, redirect_to_merchant_with_http_post: item.redirect_to_merchant_with_http_post, webhook_details: item.webhook_details, metadata: item.metadata, is_recon_enabled: item.is_recon_enabled, applepay_verified_domains: item.applepay_verified_domains, payment_link_config: item.payment_link_config, session_expiry: item.session_expiry, authentication_connector_details: item.authentication_connector_details, payout_link_config: item.payout_link_config, is_extended_card_info_enabled: item.is_extended_card_info_enabled, extended_card_info_config: item.extended_card_info_config, is_connector_agnostic_mit_enabled: item.is_connector_agnostic_mit_enabled, use_billing_as_payment_method_billing: item.use_billing_as_payment_method_billing, collect_shipping_details_from_wallet_connector: item .collect_shipping_details_from_wallet_connector, collect_billing_details_from_wallet_connector: item .collect_billing_details_from_wallet_connector, outgoing_webhook_custom_http_headers: item .outgoing_webhook_custom_http_headers .async_lift(|inner| async { crypto_operation( state, type_name!(Self::DstType), CryptoOperation::DecryptOptional(inner), key_manager_identifier.clone(), key.peek(), ) .await .and_then(|val| val.try_into_optionaloperation()) }) .await?, routing_algorithm_id: item.routing_algorithm_id, always_collect_billing_details_from_wallet_connector: item .always_collect_billing_details_from_wallet_connector, always_collect_shipping_details_from_wallet_connector: item .always_collect_shipping_details_from_wallet_connector, order_fulfillment_time: item.order_fulfillment_time, order_fulfillment_time_origin: item.order_fulfillment_time_origin, frm_routing_algorithm_id: item.frm_routing_algorithm_id, payout_routing_algorithm_id: item.payout_routing_algorithm_id, default_fallback_routing: item.default_fallback_routing, should_collect_cvv_during_payment: item.should_collect_cvv_during_payment, tax_connector_id: item.tax_connector_id, is_tax_connector_enabled: item.is_tax_connector_enabled.unwrap_or(false), version: item.version, is_network_tokenization_enabled: item.is_network_tokenization_enabled, is_click_to_pay_enabled: item.is_click_to_pay_enabled, authentication_product_ids: item.authentication_product_ids, three_ds_decision_manager_config: item.three_ds_decision_manager_config, card_testing_guard_config: item.card_testing_guard_config, card_testing_secret_key: match item.card_testing_secret_key { Some(encrypted_value) => crypto_operation( state, type_name!(Self::DstType), CryptoOperation::DecryptOptional(Some(encrypted_value)), key_manager_identifier.clone(), key.peek(), ) .await .and_then(|val| val.try_into_optionaloperation()) .unwrap_or_default(), None => None, }, is_clear_pan_retries_enabled: item.is_clear_pan_retries_enabled, is_debit_routing_enabled: item.is_debit_routing_enabled, merchant_business_country: item.merchant_business_country, revenue_recovery_retry_algorithm_type: item.revenue_recovery_retry_algorithm_type, revenue_recovery_retry_algorithm_data: item.revenue_recovery_retry_algorithm_data, is_iframe_redirection_enabled: item.is_iframe_redirection_enabled, is_external_vault_enabled: item.is_external_vault_enabled, external_vault_connector_details: item.external_vault_connector_details, merchant_category_code: item.merchant_category_code, merchant_country_code: item.merchant_country_code, split_txns_enabled: item.split_txns_enabled.unwrap_or_default(), billing_processor_id: item.billing_processor_id, }) } .await .change_context(ValidationError::InvalidValue { message: "Failed while decrypting business profile data".to_string(), }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "convert_back", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_6603977517262897144
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> { Ok(diesel_models::business_profile::ProfileNew { id: self.id, merchant_id: self.merchant_id, profile_name: self.profile_name, created_at: self.created_at, modified_at: self.modified_at, return_url: self.return_url, enable_payment_response_hash: self.enable_payment_response_hash, payment_response_hash_key: self.payment_response_hash_key, redirect_to_merchant_with_http_post: self.redirect_to_merchant_with_http_post, webhook_details: self.webhook_details, metadata: self.metadata, is_recon_enabled: self.is_recon_enabled, applepay_verified_domains: self.applepay_verified_domains, payment_link_config: self.payment_link_config, session_expiry: self.session_expiry, authentication_connector_details: self.authentication_connector_details, payout_link_config: self.payout_link_config, is_extended_card_info_enabled: self.is_extended_card_info_enabled, extended_card_info_config: self.extended_card_info_config, is_connector_agnostic_mit_enabled: self.is_connector_agnostic_mit_enabled, use_billing_as_payment_method_billing: self.use_billing_as_payment_method_billing, collect_shipping_details_from_wallet_connector: self .collect_shipping_details_from_wallet_connector, collect_billing_details_from_wallet_connector: self .collect_billing_details_from_wallet_connector, outgoing_webhook_custom_http_headers: self .outgoing_webhook_custom_http_headers .map(Encryption::from), routing_algorithm_id: self.routing_algorithm_id, always_collect_billing_details_from_wallet_connector: self .always_collect_billing_details_from_wallet_connector, always_collect_shipping_details_from_wallet_connector: self .always_collect_shipping_details_from_wallet_connector, order_fulfillment_time: self.order_fulfillment_time, order_fulfillment_time_origin: self.order_fulfillment_time_origin, frm_routing_algorithm_id: self.frm_routing_algorithm_id, payout_routing_algorithm_id: self.payout_routing_algorithm_id, default_fallback_routing: self.default_fallback_routing, should_collect_cvv_during_payment: self.should_collect_cvv_during_payment, tax_connector_id: self.tax_connector_id, is_tax_connector_enabled: Some(self.is_tax_connector_enabled), version: self.version, is_network_tokenization_enabled: self.is_network_tokenization_enabled, is_auto_retries_enabled: None, max_auto_retries_enabled: None, is_click_to_pay_enabled: self.is_click_to_pay_enabled, authentication_product_ids: self.authentication_product_ids, three_ds_decision_manager_config: self.three_ds_decision_manager_config, card_testing_guard_config: self.card_testing_guard_config, card_testing_secret_key: self.card_testing_secret_key.map(Encryption::from), is_clear_pan_retries_enabled: Some(self.is_clear_pan_retries_enabled), is_debit_routing_enabled: self.is_debit_routing_enabled, merchant_business_country: self.merchant_business_country, revenue_recovery_retry_algorithm_type: self.revenue_recovery_retry_algorithm_type, revenue_recovery_retry_algorithm_data: self.revenue_recovery_retry_algorithm_data, is_iframe_redirection_enabled: self.is_iframe_redirection_enabled, is_external_vault_enabled: self.is_external_vault_enabled, external_vault_connector_details: self.external_vault_connector_details, merchant_category_code: self.merchant_category_code, is_l2_l3_enabled: None, merchant_country_code: self.merchant_country_code, split_txns_enabled: Some(self.split_txns_enabled), billing_processor_id: self.billing_processor_id, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "construct_new", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-4299557702363524328
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_is_tax_connector_enabled(&self) -> bool { let is_tax_connector_enabled = self.is_tax_connector_enabled; match &self.tax_connector_id { Some(_id) => is_tax_connector_enabled, _ => false, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_is_tax_connector_enabled", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-5546393308042285567
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_order_fulfillment_time(&self) -> Option<i64> { self.order_fulfillment_time }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_order_fulfillment_time", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_2678511727807818345
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_webhook_url_from_profile(&self) -> CustomResult<String, ValidationError> { self.webhook_details .clone() .and_then(|details| details.webhook_url) .get_required_value("webhook_details.webhook_url") .map(ExposeInterface::expose) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_webhook_url_from_profile", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-2198905311449298682
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn is_vault_sdk_enabled(&self) -> bool { self.external_vault_connector_details.is_some() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "is_vault_sdk_enabled", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_6418307947223878571
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_acquirer_details_from_network( &self, network: common_enums::CardNetwork, ) -> Option<AcquirerConfig> { // iterate over acquirer_config_map and find the acquirer config for the given network self.acquirer_config_map .as_ref() .and_then(|acquirer_config_map| { acquirer_config_map .0 .iter() .find(|&(_, acquirer_config)| acquirer_config.network == network) }) .map(|(_, acquirer_config)| acquirer_config.clone()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_acquirer_details_from_network", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-5017844202444551223
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_payment_routing_algorithm( &self, ) -> CustomResult< Option<api_models::routing::RoutingAlgorithmRef>, api_error_response::ApiErrorResponse, > { self.routing_algorithm .clone() .map(|val| { val.parse_value::<api_models::routing::RoutingAlgorithmRef>("RoutingAlgorithmRef") }) .transpose() .change_context(api_error_response::ApiErrorResponse::InternalServerError) .attach_printable("unable to deserialize routing algorithm ref from merchant account") }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_payment_routing_algorithm", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_4127372816205577401
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_payout_routing_algorithm( &self, ) -> CustomResult< Option<api_models::routing::RoutingAlgorithmRef>, api_error_response::ApiErrorResponse, > { self.payout_routing_algorithm .clone() .map(|val| { val.parse_value::<api_models::routing::RoutingAlgorithmRef>("RoutingAlgorithmRef") }) .transpose() .change_context(api_error_response::ApiErrorResponse::InternalServerError) .attach_printable( "unable to deserialize payout routing algorithm ref from merchant account", ) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_payout_routing_algorithm", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-6606686251958600316
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_frm_routing_algorithm( &self, ) -> CustomResult< Option<api_models::routing::RoutingAlgorithmRef>, api_error_response::ApiErrorResponse, > { self.frm_routing_algorithm .clone() .map(|val| { val.parse_value::<api_models::routing::RoutingAlgorithmRef>("RoutingAlgorithmRef") }) .transpose() .change_context(api_error_response::ApiErrorResponse::InternalServerError) .attach_printable( "unable to deserialize frm routing algorithm ref from merchant account", ) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_frm_routing_algorithm", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-7417382439965526307
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_payment_webhook_statuses(&self) -> Cow<'_, [common_enums::IntentStatus]> { self.webhook_details .as_ref() .and_then(|details| details.payment_statuses_enabled.as_ref()) .filter(|statuses_vec| !statuses_vec.is_empty()) .map(|statuses_vec| Cow::Borrowed(statuses_vec.as_slice())) .unwrap_or_else(|| { Cow::Borrowed(common_types::consts::DEFAULT_PAYMENT_WEBHOOK_TRIGGER_STATUSES) }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_payment_webhook_statuses", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_1332599240786454206
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_refund_webhook_statuses(&self) -> Cow<'_, [common_enums::RefundStatus]> { self.webhook_details .as_ref() .and_then(|details| details.refund_statuses_enabled.as_ref()) .filter(|statuses_vec| !statuses_vec.is_empty()) .map(|statuses_vec| Cow::Borrowed(statuses_vec.as_slice())) .unwrap_or_else(|| { Cow::Borrowed(common_types::consts::DEFAULT_REFUND_WEBHOOK_TRIGGER_STATUSES) }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_refund_webhook_statuses", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-4760419969064842301
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_payout_webhook_statuses(&self) -> Cow<'_, [common_enums::PayoutStatus]> { self.webhook_details .as_ref() .and_then(|details| details.payout_statuses_enabled.as_ref()) .filter(|statuses_vec| !statuses_vec.is_empty()) .map(|statuses_vec| Cow::Borrowed(statuses_vec.as_slice())) .unwrap_or_else(|| { Cow::Borrowed(common_types::consts::DEFAULT_PAYOUT_WEBHOOK_TRIGGER_STATUSES) }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_payout_webhook_statuses", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_6006008254693435290
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs pub fn get_billing_processor_id( &self, ) -> CustomResult< common_utils::id_type::MerchantConnectorAccountId, api_error_response::ApiErrorResponse, > { self.billing_processor_id .to_owned() .ok_or(error_stack::report!( api_error_response::ApiErrorResponse::MissingRequiredField { field_name: "billing_processor_id" } )) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_billing_processor_id", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-2872818442148850528
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs async fn convert(self) -> CustomResult<Self::DstType, ValidationError> { Ok(diesel_models::invoice::InvoiceUpdate { status: self.status, payment_method_id: self.payment_method_id, connector_invoice_id: self.connector_invoice_id, modified_at: self.modified_at, payment_intent_id: self.payment_intent_id, amount: self.amount, currency: self.currency, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "convert", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_588378802840694130
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs async fn convert_back( _state: &KeyManagerState, item: Self::DstType, _key: &Secret<Vec<u8>>, _key_manager_identifier: Identifier, ) -> CustomResult<Self, ValidationError> where Self: Sized, { Ok(Self { status: item.status, payment_method_id: item.payment_method_id, connector_invoice_id: item.connector_invoice_id, modified_at: item.modified_at, payment_intent_id: item.payment_intent_id, amount: item.amount, currency: item.currency, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "convert_back", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_4815290173662759272
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> { Ok(diesel_models::invoice::InvoiceUpdate { status: self.status, payment_method_id: self.payment_method_id, connector_invoice_id: self.connector_invoice_id, modified_at: self.modified_at, payment_intent_id: self.payment_intent_id, amount: self.amount, currency: self.currency, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "construct_new", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_7667731800811138328
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs pub fn to_invoice( subscription_id: common_utils::id_type::SubscriptionId, merchant_id: common_utils::id_type::MerchantId, profile_id: common_utils::id_type::ProfileId, merchant_connector_id: common_utils::id_type::MerchantConnectorAccountId, payment_intent_id: Option<common_utils::id_type::PaymentId>, payment_method_id: Option<String>, customer_id: common_utils::id_type::CustomerId, amount: MinorUnit, currency: String, status: common_enums::connector_enums::InvoiceStatus, provider_name: common_enums::connector_enums::Connector, metadata: Option<SecretSerdeValue>, connector_invoice_id: Option<common_utils::id_type::InvoiceId>, ) -> Self { Self { id: common_utils::id_type::InvoiceId::generate(), subscription_id, merchant_id, profile_id, merchant_connector_id, payment_intent_id, payment_method_id, customer_id, amount, currency: currency.to_string(), status, provider_name, metadata, connector_invoice_id, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "to_invoice", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-2008087551035833536
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs pub fn update_amount_and_currency(amount: MinorUnit, currency: String) -> Self { Self::Amount(AmountAndCurrencyUpdate { amount, currency }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "update_amount_and_currency", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_2671994429108318762
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs pub fn update_connector_and_status( connector_invoice_id: common_utils::id_type::InvoiceId, status: common_enums::connector_enums::InvoiceStatus, ) -> Self { Self::Connector(ConnectorAndStatusUpdate { connector_invoice_id, status, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "update_connector_and_status", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_2848362304362464975
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs pub fn update_payment_and_status( payment_method_id: Option<Secret<String>>, payment_intent_id: Option<common_utils::id_type::PaymentId>, status: common_enums::connector_enums::InvoiceStatus, connector_invoice_id: Option<common_utils::id_type::InvoiceId>, ) -> Self { Self::PaymentStatus(PaymentAndStatusUpdate { payment_method_id, payment_intent_id, status, connector_invoice_id, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "update_payment_and_status", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-1639994851913372194
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs fn from(request: InvoiceUpdateRequest) -> Self { let now = common_utils::date_time::now(); match request { InvoiceUpdateRequest::Amount(update) => Self { status: None, payment_method_id: None, connector_invoice_id: None, modified_at: now, payment_intent_id: None, amount: Some(update.amount), currency: Some(update.currency), }, InvoiceUpdateRequest::Connector(update) => Self { status: Some(update.status), payment_method_id: None, connector_invoice_id: Some(update.connector_invoice_id), modified_at: now, payment_intent_id: None, amount: None, currency: None, }, InvoiceUpdateRequest::PaymentStatus(update) => Self { status: Some(update.status), payment_method_id: update .payment_method_id .as_ref() .map(|id| id.peek()) .cloned(), connector_invoice_id: update.connector_invoice_id, modified_at: now, payment_intent_id: update.payment_intent_id, amount: None, currency: None, }, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_4433153641033740911
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs pub fn new( payment_method_id: Option<String>, status: Option<common_enums::connector_enums::InvoiceStatus>, connector_invoice_id: Option<common_utils::id_type::InvoiceId>, payment_intent_id: Option<common_utils::id_type::PaymentId>, amount: Option<MinorUnit>, currency: Option<String>, ) -> Self { Self { status, payment_method_id, connector_invoice_id, modified_at: common_utils::date_time::now(), payment_intent_id, amount, currency, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "new", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-2104250263715933947
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/customer.rs pub fn get_id(&self) -> &id_type::GlobalCustomerId { &self.id }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_id", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-4776010985902535860
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/customer.rs pub fn get_connector_customer_map( &self, ) -> FxHashMap<id_type::MerchantConnectorAccountId, String> { use masking::PeekInterface; if let Some(connector_customer_value) = &self.connector_customer { connector_customer_value .peek() .clone() .parse_value("ConnectorCustomerMap") .unwrap_or_default() } else { FxHashMap::default() } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_connector_customer_map", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-5570277406578504560
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/customer.rs pub fn get_connector_customer_id( &self, merchant_connector_account: &MerchantConnectorAccountTypeDetails, ) -> Option<&str> { match merchant_connector_account { MerchantConnectorAccountTypeDetails::MerchantConnectorAccount(account) => { let connector_account_id = account.get_id(); self.connector_customer .as_ref()? .get(&connector_account_id) .map(|connector_customer_id| connector_customer_id.as_str()) } MerchantConnectorAccountTypeDetails::MerchantConnectorDetails(_) => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_connector_customer_id", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_4257115635174303381
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/customer.rs async fn convert(self) -> CustomResult<Self::DstType, ValidationError> { Ok(diesel_models::customers::Customer { id: self.id, merchant_reference_id: self.merchant_reference_id, merchant_id: self.merchant_id, name: self.name.map(Encryption::from), email: self.email.map(Encryption::from), phone: self.phone.map(Encryption::from), phone_country_code: self.phone_country_code, description: self.description, created_at: self.created_at, metadata: self.metadata, modified_at: self.modified_at, connector_customer: self.connector_customer, default_payment_method_id: self.default_payment_method_id, updated_by: self.updated_by, default_billing_address: self.default_billing_address, default_shipping_address: self.default_shipping_address, version: self.version, status: self.status, tax_registration_id: self.tax_registration_id.map(Encryption::from), }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "convert", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-7603390898773551622
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/customer.rs async fn convert_back( state: &KeyManagerState, item: Self::DstType, key: &Secret<Vec<u8>>, _key_store_ref_id: keymanager::Identifier, ) -> CustomResult<Self, ValidationError> where Self: Sized, { let decrypted = types::crypto_operation( state, common_utils::type_name!(Self::DstType), types::CryptoOperation::BatchDecrypt(EncryptedCustomer::to_encryptable( EncryptedCustomer { name: item.name.clone(), phone: item.phone.clone(), email: item.email.clone(), tax_registration_id: item.tax_registration_id.clone(), }, )), keymanager::Identifier::Merchant(item.merchant_id.clone()), key.peek(), ) .await .and_then(|val| val.try_into_batchoperation()) .change_context(ValidationError::InvalidValue { message: "Failed while decrypting customer data".to_string(), })?; let encryptable_customer = EncryptedCustomer::from_encryptable(decrypted).change_context( ValidationError::InvalidValue { message: "Failed while decrypting customer data".to_string(), }, )?; Ok(Self { id: item.id, merchant_reference_id: item.merchant_reference_id, merchant_id: item.merchant_id, name: encryptable_customer.name, email: encryptable_customer.email.map(|email| { let encryptable: Encryptable<Secret<String, pii::EmailStrategy>> = Encryptable::new( email.clone().into_inner().switch_strategy(), email.into_encrypted(), ); encryptable }), phone: encryptable_customer.phone, phone_country_code: item.phone_country_code, description: item.description, created_at: item.created_at, metadata: item.metadata, modified_at: item.modified_at, connector_customer: item.connector_customer, default_payment_method_id: item.default_payment_method_id, updated_by: item.updated_by, default_billing_address: item.default_billing_address, default_shipping_address: item.default_shipping_address, version: item.version, status: item.status, tax_registration_id: encryptable_customer.tax_registration_id, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "convert_back", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_5442316398349805084
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/customer.rs async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> { let now = date_time::now(); Ok(diesel_models::customers::CustomerNew { id: self.id, merchant_reference_id: self.merchant_reference_id, merchant_id: self.merchant_id, name: self.name.map(Encryption::from), email: self.email.map(Encryption::from), phone: self.phone.map(Encryption::from), description: self.description, phone_country_code: self.phone_country_code, metadata: self.metadata, default_payment_method_id: None, created_at: now, modified_at: now, connector_customer: self.connector_customer, updated_by: self.updated_by, default_billing_address: self.default_billing_address, default_shipping_address: self.default_shipping_address, version: common_types::consts::API_VERSION, status: self.status, tax_registration_id: self.tax_registration_id.map(Encryption::from), }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "construct_new", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_6109689474478391433
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/customer.rs fn from(value: CustomerListConstraints) -> Self { Self { limit: i64::from(value.limit), offset: value.offset.map(i64::from), customer_id: value.customer_id, time_range: value.time_range, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-3958193483291527907
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/customer.rs pub async fn update_connector_customer_in_customers( merchant_connector_account: &MerchantConnectorAccountTypeDetails, customer: Option<&Customer>, connector_customer_id: Option<String>, ) -> Option<CustomerUpdate> { match merchant_connector_account { MerchantConnectorAccountTypeDetails::MerchantConnectorAccount(account) => { connector_customer_id.map(|new_conn_cust_id| { let connector_account_id = account.get_id().clone(); let mut connector_customer_map = customer .and_then(|customer| customer.connector_customer.clone()) .unwrap_or_default(); connector_customer_map.insert(connector_account_id, new_conn_cust_id); CustomerUpdate::ConnectorCustomer { connector_customer: Some(connector_customer_map), } }) } // TODO: Construct connector_customer for MerchantConnectorDetails if required by connector. MerchantConnectorAccountTypeDetails::MerchantConnectorDetails(_) => { todo!("Handle connector_customer construction for MerchantConnectorDetails"); } } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "update_connector_customer_in_customers", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_4997512733441884769
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs pub fn new_with_customer_id(connector_customer_id: String) -> Self { Self::new(connector_customer_id, None, None, None) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "new_with_customer_id", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-993556213236907791
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs pub fn new( connector_customer_id: String, name: Option<String>, email: Option<String>, billing_address: Option<AddressDetails>, ) -> Self { Self { connector_customer_id, name, email, billing_address, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "new", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-1049718655556126969
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs pub fn get_amount_captured(&self) -> Option<MinorUnit> { match self { Self::Success { amount, .. } | Self::Error { amount, .. } => *amount, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_amount_captured", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-8971010586030058145
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs pub fn get_connector_response_reference_id(&self) -> Option<String> { match self { Self::Success { connector_response_reference_id, .. } => connector_response_reference_id.clone(), Self::Error { .. } => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_connector_response_reference_id", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_8651400937409102936
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs pub fn get_connector_metadata(&self) -> Option<masking::Secret<serde_json::Value>> { match self { Self::TransactionResponse { connector_metadata, .. } | Self::PreProcessingResponse { connector_metadata, .. } => connector_metadata.clone().map(masking::Secret::new), _ => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_connector_metadata", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-3772375561690589757
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs pub fn get_network_transaction_id(&self) -> Option<String> { match self { Self::TransactionResponse { network_txn_id, .. } => network_txn_id.clone(), _ => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_network_transaction_id", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-4880361099450936415
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs pub fn get_connector_transaction_id( &self, ) -> Result<String, error_stack::Report<ApiErrorResponse>> { match self { Self::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(txn_id), .. } => Ok(txn_id.to_string()), _ => Err(ApiErrorResponse::MissingRequiredField { field_name: "ConnectorTransactionId", } .into()), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_connector_transaction_id", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-187791943713015511
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs pub fn merge_transaction_responses( auth_response: &Self, capture_response: &Self, ) -> Result<Self, error_stack::Report<ApiErrorResponse>> { match (auth_response, capture_response) { ( Self::TransactionResponse { resource_id: _, redirection_data: auth_redirection_data, mandate_reference: auth_mandate_reference, connector_metadata: auth_connector_metadata, network_txn_id: auth_network_txn_id, connector_response_reference_id: auth_connector_response_reference_id, incremental_authorization_allowed: auth_incremental_auth_allowed, charges: auth_charges, }, Self::TransactionResponse { resource_id: capture_resource_id, redirection_data: capture_redirection_data, mandate_reference: capture_mandate_reference, connector_metadata: capture_connector_metadata, network_txn_id: capture_network_txn_id, connector_response_reference_id: capture_connector_response_reference_id, incremental_authorization_allowed: capture_incremental_auth_allowed, charges: capture_charges, }, ) => Ok(Self::TransactionResponse { resource_id: capture_resource_id.clone(), redirection_data: Box::new( capture_redirection_data .clone() .or_else(|| *auth_redirection_data.clone()), ), mandate_reference: Box::new( auth_mandate_reference .clone() .or_else(|| *capture_mandate_reference.clone()), ), connector_metadata: capture_connector_metadata .clone() .or(auth_connector_metadata.clone()), network_txn_id: capture_network_txn_id .clone() .or(auth_network_txn_id.clone()), connector_response_reference_id: capture_connector_response_reference_id .clone() .or(auth_connector_response_reference_id.clone()), incremental_authorization_allowed: (*capture_incremental_auth_allowed) .or(*auth_incremental_auth_allowed), charges: auth_charges.clone().or(capture_charges.clone()), }), _ => Err(ApiErrorResponse::NotSupported { message: "Invalid Flow ".to_owned(), } .into()), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "merge_transaction_responses", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_546450374534579924
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs pub fn get_updated_connector_token_details( &self, original_connector_mandate_request_reference_id: Option<String>, ) -> Option<diesel_models::ConnectorTokenDetails> { if let Self::TransactionResponse { mandate_reference, .. } = self { mandate_reference.clone().map(|mandate_ref| { let connector_mandate_id = mandate_ref.connector_mandate_id; let connector_mandate_request_reference_id = mandate_ref .connector_mandate_request_reference_id .or(original_connector_mandate_request_reference_id); diesel_models::ConnectorTokenDetails { connector_mandate_id, connector_token_request_reference_id: connector_mandate_request_reference_id, } }) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_updated_connector_token_details", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_3210743170841394953
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs fn from(redirect_form: diesel_models::payment_attempt::RedirectForm) -> Self { match redirect_form { diesel_models::payment_attempt::RedirectForm::Form { endpoint, method, form_fields, } => Self::Form { endpoint, method, form_fields, }, diesel_models::payment_attempt::RedirectForm::Html { html_data } => { Self::Html { html_data } } diesel_models::payment_attempt::RedirectForm::BarclaycardAuthSetup { access_token, ddc_url, reference_id, } => Self::BarclaycardAuthSetup { access_token, ddc_url, reference_id, }, diesel_models::payment_attempt::RedirectForm::BarclaycardConsumerAuth { access_token, step_up_url, } => Self::BarclaycardConsumerAuth { access_token, step_up_url, }, diesel_models::payment_attempt::RedirectForm::BlueSnap { payment_fields_token, } => Self::BlueSnap { payment_fields_token, }, diesel_models::payment_attempt::RedirectForm::CybersourceAuthSetup { access_token, ddc_url, reference_id, } => Self::CybersourceAuthSetup { access_token, ddc_url, reference_id, }, diesel_models::payment_attempt::RedirectForm::CybersourceConsumerAuth { access_token, step_up_url, } => Self::CybersourceConsumerAuth { access_token, step_up_url, }, diesel_models::RedirectForm::DeutschebankThreeDSChallengeFlow { acs_url, creq } => { Self::DeutschebankThreeDSChallengeFlow { acs_url, creq } } diesel_models::payment_attempt::RedirectForm::Payme => Self::Payme, diesel_models::payment_attempt::RedirectForm::Braintree { client_token, card_token, bin, acs_url, } => Self::Braintree { client_token, card_token, bin, acs_url, }, diesel_models::payment_attempt::RedirectForm::Nmi { amount, currency, public_key, customer_vault_id, order_id, } => Self::Nmi { amount, currency, public_key, customer_vault_id, order_id, }, diesel_models::payment_attempt::RedirectForm::Mifinity { initialization_token, } => Self::Mifinity { initialization_token, }, diesel_models::payment_attempt::RedirectForm::WorldpayDDCForm { endpoint, method, form_fields, collection_id, } => Self::WorldpayDDCForm { endpoint: endpoint.into_inner(), method, form_fields, collection_id, }, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-7581943600276830968
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs fn add( &mut self, payment_method: common_enums::PaymentMethod, payment_method_type: common_enums::PaymentMethodType, payment_method_details: PaymentMethodDetails, ) { if let Some(payment_method_data) = self.get_mut(&payment_method) { payment_method_data.insert(payment_method_type, payment_method_details); } else { let mut payment_method_type_metadata = PaymentMethodTypeMetadata::new(); payment_method_type_metadata.insert(payment_method_type, payment_method_details); self.insert(payment_method, payment_method_type_metadata); } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "add", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_3827819014260272499
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs fn default() -> Self { Self::ExternalVaultInsertResponse { connector_vault_id: String::new(), fingerprint_id: String::new(), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "default", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_4122586129771840946
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/gsm.rs fn try_from(item: diesel_models::gsm::GatewayStatusMap) -> Result<Self, Self::Error> { let decision = StringExt::<common_enums::GsmDecision>::parse_enum(item.decision, "GsmDecision") .map_err(|_| ValidationError::InvalidValue { message: "Failed to parse GsmDecision".to_string(), })?; let db_feature_data = item.feature_data; // The only case where `FeatureData` can be null is for legacy records // (i.e., records created before `FeatureData` and related features were introduced). // At that time, the only supported feature was `Retry`, so it's safe to default to it. let feature_data = match db_feature_data { Some(common_types::domain::GsmFeatureData::Retry(data)) => { common_types::domain::GsmFeatureData::Retry(data) } None => common_types::domain::GsmFeatureData::Retry( common_types::domain::RetryFeatureData { step_up_possible: item.step_up_possible, clear_pan_possible: item.clear_pan_possible, alternate_network_possible: false, decision, }, ), }; let feature = item.feature.unwrap_or(common_enums::GsmFeature::Retry); Ok(Self { connector: item.connector, flow: item.flow, sub_flow: item.sub_flow, code: item.code, message: item.message, status: item.status, router_error: item.router_error, unified_code: item.unified_code, unified_message: item.unified_message, error_category: item.error_category, feature_data, feature, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "try_from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-2964686581917838368
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/revenue_recovery.rs pub fn get_attempt_triggered_by(&self) -> Option<common_enums::TriggeredBy> { self.feature_metadata.as_ref().and_then(|metadata| { metadata .revenue_recovery .as_ref() .map(|recovery| recovery.attempt_triggered_by) }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_attempt_triggered_by", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-6362291052995996826
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/revenue_recovery.rs fn from(payment_attempt: &payments::payment_attempt::PaymentAttempt) -> Self { Self { attempt_id: payment_attempt.id.clone(), attempt_status: payment_attempt.status, feature_metadata: payment_attempt .feature_metadata .clone() .map( |feature_metadata| api_payments::PaymentAttemptFeatureMetadata { revenue_recovery: feature_metadata.revenue_recovery.map(|recovery| { api_payments::PaymentAttemptRevenueRecoveryData { attempt_triggered_by: recovery.attempt_triggered_by, charge_id: recovery.charge_id, } }), }, ), amount: payment_attempt.amount_details.get_net_amount(), network_advice_code: payment_attempt .error .clone() .and_then(|error| error.network_advice_code), network_decline_code: payment_attempt .error .clone() .and_then(|error| error.network_decline_code), error_code: payment_attempt .error .as_ref() .map(|error| error.code.clone()), created_at: payment_attempt.created_at, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-6140224769689060479
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_payment_method(&self) -> Option<common_enums::PaymentMethod> { match self { Self::Card(_) | Self::NetworkToken(_) | Self::CardDetailsForNetworkTransactionId(_) => { Some(common_enums::PaymentMethod::Card) } Self::CardRedirect(_) => Some(common_enums::PaymentMethod::CardRedirect), Self::Wallet(_) => Some(common_enums::PaymentMethod::Wallet), Self::PayLater(_) => Some(common_enums::PaymentMethod::PayLater), Self::BankRedirect(_) => Some(common_enums::PaymentMethod::BankRedirect), Self::BankDebit(_) => Some(common_enums::PaymentMethod::BankDebit), Self::BankTransfer(_) => Some(common_enums::PaymentMethod::BankTransfer), Self::Crypto(_) => Some(common_enums::PaymentMethod::Crypto), Self::Reward => Some(common_enums::PaymentMethod::Reward), Self::RealTimePayment(_) => Some(common_enums::PaymentMethod::RealTimePayment), Self::Upi(_) => Some(common_enums::PaymentMethod::Upi), Self::Voucher(_) => Some(common_enums::PaymentMethod::Voucher), Self::GiftCard(_) => Some(common_enums::PaymentMethod::GiftCard), Self::OpenBanking(_) => Some(common_enums::PaymentMethod::OpenBanking), Self::MobilePayment(_) => Some(common_enums::PaymentMethod::MobilePayment), Self::CardToken(_) | Self::MandatePayment => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_payment_method", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-4963867427025555687
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_wallet_data(&self) -> Option<&WalletData> { if let Self::Wallet(wallet_data) = self { Some(wallet_data) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_wallet_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_8445520909290193804
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn is_network_token_payment_method_data(&self) -> bool { matches!(self, Self::NetworkToken(_)) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "is_network_token_payment_method_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-5908224171668240892
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_co_badged_card_data(&self) -> Option<payment_methods::CoBadgedCardData> { todo!() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_co_badged_card_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-7382141021180673726
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_card_data(&self) -> Option<&Card> { if let Self::Card(card) = self { Some(card) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_card_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_1022023813153756328
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn extract_debit_routing_saving_percentage( &self, network: &common_enums::CardNetwork, ) -> Option<f64> { self.get_co_badged_card_data()? .co_badged_card_networks_info .0 .iter() .find(|info| &info.network == network) .map(|info| info.saving_percentage) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "extract_debit_routing_saving_percentage", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_4328935850288828421
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_nti_and_card_details_for_mit_flow( recurring_details: mandates::RecurringDetails, ) -> Option<(api_models::payments::MandateReferenceId, Self)> { let network_transaction_id_and_card_details = match recurring_details { mandates::RecurringDetails::NetworkTransactionIdAndCardDetails( network_transaction_id_and_card_details, ) => Some(network_transaction_id_and_card_details), mandates::RecurringDetails::MandateId(_) | mandates::RecurringDetails::PaymentMethodId(_) | mandates::RecurringDetails::ProcessorPaymentToken(_) => None, }?; let mandate_reference_id = api_models::payments::MandateReferenceId::NetworkMandateId( network_transaction_id_and_card_details .network_transaction_id .peek() .to_string(), ); Some(( mandate_reference_id, network_transaction_id_and_card_details.clone().into(), )) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_nti_and_card_details_for_mit_flow", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_8731927569792881646
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs fn from( value: ( payment_methods::CardDetail, Option<&CardToken>, Option<payment_methods::CoBadgedCardData>, ), ) -> Self { let ( payment_methods::CardDetail { card_number, card_exp_month, card_exp_year, card_holder_name, nick_name, card_network, card_issuer, card_issuing_country, card_type, }, card_token_data, co_badged_card_data, ) = value; // The card_holder_name from locker retrieved card is considered if it is a non-empty string or else card_holder_name is picked let name_on_card = if let Some(name) = card_holder_name.clone() { if name.clone().expose().is_empty() { card_token_data .and_then(|token_data| token_data.card_holder_name.clone()) .or(Some(name)) } else { card_holder_name } } else { card_token_data.and_then(|token_data| token_data.card_holder_name.clone()) }; Self { card_number, card_exp_month, card_exp_year, card_holder_name: name_on_card, card_cvc: card_token_data .cloned() .unwrap_or_default() .card_cvc .unwrap_or_default(), card_issuer, card_network, card_type, card_issuing_country, bank_code: None, nick_name, co_badged_card_data, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_5814526868122173617
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_paze_wallet_data(&self) -> Option<&PazeWalletData> { if let Self::Paze(paze_wallet_data) = self { Some(paze_wallet_data) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_paze_wallet_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-6220088732952203864
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_apple_pay_wallet_data(&self) -> Option<&ApplePayWalletData> { if let Self::ApplePay(apple_pay_wallet_data) = self { Some(apple_pay_wallet_data) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_apple_pay_wallet_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-2975345223358942854
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_google_pay_wallet_data(&self) -> Option<&GooglePayWalletData> { if let Self::GooglePay(google_pay_wallet_data) = self { Some(google_pay_wallet_data) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_google_pay_wallet_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-6527143489856357179
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs fn get_payment_method_type(&self) -> api_enums::PaymentMethodType { match self { Self::DirectCarrierBilling { .. } => api_enums::PaymentMethodType::DirectCarrierBilling, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_payment_method_type", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-4325122681908456619
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs fn try_from( value: ( cards::CardNumber, Option<&CardToken>, Option<payment_methods::CoBadgedCardData>, CardDetailsPaymentMethod, ), ) -> Result<Self, Self::Error> { let (card_number, card_token_data, co_badged_card_data, card_details) = value; // The card_holder_name from locker retrieved card is considered if it is a non-empty string or else card_holder_name is picked let name_on_card = if let Some(name) = card_details.card_holder_name.clone() { if name.clone().expose().is_empty() { card_token_data .and_then(|token_data| token_data.card_holder_name.clone()) .or(Some(name)) } else { Some(name) } } else { card_token_data.and_then(|token_data| token_data.card_holder_name.clone()) }; Ok(Self { card_number, card_exp_month: card_details .expiry_month .get_required_value("expiry_month")? .clone(), card_exp_year: card_details .expiry_year .get_required_value("expiry_year")? .clone(), card_holder_name: name_on_card, card_cvc: card_token_data .cloned() .unwrap_or_default() .card_cvc .unwrap_or_default(), card_issuer: card_details.card_issuer, card_network: card_details.card_network, card_type: card_details.card_type, card_issuing_country: card_details.issuer_country, bank_code: None, nick_name: card_details.nick_name, co_badged_card_data, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "try_from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_5604359172426930287
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_additional_payout_method_data( &self, ) -> Option<payout_method_utils::AdditionalPayoutMethodData> { match self { Self::Card(card_details) => { router_env::logger::info!("Populating AdditionalPayoutMethodData from Card payment method data for recurring payout"); Some(payout_method_utils::AdditionalPayoutMethodData::Card( Box::new(payout_method_utils::CardAdditionalData { card_issuer: card_details.card_issuer.clone(), card_network: card_details.card_network.clone(), bank_code: None, card_type: card_details.card_type.clone(), card_issuing_country: card_details.issuer_country.clone(), last4: card_details.last4_digits.clone(), card_isin: card_details.card_isin.clone(), card_extended_bin: None, card_exp_month: card_details.expiry_month.clone(), card_exp_year: card_details.expiry_year.clone(), card_holder_name: card_details.card_holder_name.clone(), }), )) } Self::BankDetails(_) | Self::WalletDetails(_) | Self::NetworkToken(_) => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_additional_payout_method_data", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-8593990913465618039
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_card_details(&self) -> Option<CardDetailsPaymentMethod> { if let Self::Card(card) = self { Some(card.clone()) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_card_details", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_1025868671281861787
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs fn saved_in_locker_default() -> bool { true }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "saved_in_locker_default", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_7987683504621417479
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn to_card_details_from_locker(self) -> payment_methods::CardDetailFromLocker { payment_methods::CardDetailFromLocker { card_number: None, card_holder_name: self.card_holder_name.clone(), card_issuer: self.card_issuer.clone(), card_network: self.card_network.clone(), card_type: self.card_type.clone(), issuer_country: self.clone().get_issuer_country_alpha2(), last4_digits: self.last4_digits, expiry_month: self.expiry_month, expiry_year: self.expiry_year, card_fingerprint: None, nick_name: self.nick_name, card_isin: self.card_isin, saved_to_locker: self.saved_to_locker, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "to_card_details_from_locker", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_3610373852618493834
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_issuer_country_alpha2(self) -> Option<common_enums::CountryAlpha2> { self.issuer_country .as_ref() .map(|c| api_enums::CountryAlpha2::from_str(c)) .transpose() .ok() .flatten() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_issuer_country_alpha2", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-6378233710811126073
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_single_use_token_from_payment_method_token( token: Secret<String>, mca_id: id_type::MerchantConnectorAccountId, ) -> Self { Self { token, merchant_connector_id: mca_id, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_single_use_token_from_payment_method_token", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_8622750028816002239
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn store_key(payment_method_id: &id_type::GlobalPaymentMethodId) -> Self { let new_token = format!("single_use_token_{}", payment_method_id.get_string_repr()); Self(new_token) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "store_key", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_8142708290669490075
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs pub fn get_store_key(&self) -> &str { &self.0 }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_store_key", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-5217269495291366104
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/merchant_key_store.rs async fn convert(self) -> CustomResult<Self::DstType, ValidationError> { Ok(diesel_models::merchant_key_store::MerchantKeyStore { key: self.key.into(), merchant_id: self.merchant_id, created_at: self.created_at, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "convert", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_7952096896235913539
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/merchant_key_store.rs async fn convert_back( state: &KeyManagerState, item: Self::DstType, key: &Secret<Vec<u8>>, _key_manager_identifier: keymanager::Identifier, ) -> CustomResult<Self, ValidationError> where Self: Sized, { let identifier = keymanager::Identifier::Merchant(item.merchant_id.clone()); Ok(Self { key: crypto_operation( state, type_name!(Self::DstType), CryptoOperation::Decrypt(item.key), identifier, key.peek(), ) .await .and_then(|val| val.try_into_operation()) .change_context(ValidationError::InvalidValue { message: "Failed while decrypting customer data".to_string(), })?, merchant_id: item.merchant_id, created_at: item.created_at, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "convert_back", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-7371297177615141459
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/merchant_key_store.rs async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> { Ok(diesel_models::merchant_key_store::MerchantKeyStoreNew { merchant_id: self.merchant_id, key: self.key.into(), created_at: date_time::now(), }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "construct_new", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_-5661109608128229716
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/routing.rs fn from(value: PaymentRoutingInfo) -> Self { Self::WithDetails(Box::new(PaymentRoutingInfoInner { algorithm: value.algorithm, pre_routing_results: value.pre_routing_results, })) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_6611731807564572718
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs fn from(value: PaymentsMandateReferenceRecord) -> Self { Self { connector_mandate_id: value.connector_mandate_id, payment_method_type: value.payment_method_type, original_payment_authorized_amount: value.original_payment_authorized_amount, original_payment_authorized_currency: value.original_payment_authorized_currency, mandate_metadata: value.mandate_metadata, connector_mandate_status: value.connector_mandate_status, connector_mandate_request_reference_id: value.connector_mandate_request_reference_id, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "from", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_310237097183725151
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs pub fn get_end_date( &self, format: date_time::DateFormat, ) -> error_stack::Result<Option<String>, ParsingError> { self.end_date .map(|date| { date_time::format_date(date, format) .change_context(ParsingError::DateTimeParsingError) }) .transpose() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_end_date", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_2384593178313988742
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs pub fn get_metadata(&self) -> Option<pii::SecretSerdeValue> { self.metadata.clone() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "get_metadata", "is_async": false, "is_pub": true, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_fn_hyperswitch_domain_models_7459769378795935345
clm
function
// hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs fn deref(&self) -> &Self::Target { &self.0 }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": null, "function_name": "deref", "is_async": false, "is_pub": false, "lines": null, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }