id
stringlengths
20
153
type
stringclasses
1 value
granularity
stringclasses
14 values
content
stringlengths
16
84.3k
metadata
dict
connector-service_snippet_-7416499650036175072_850_15
clm
snippet
// connector-service/backend/external-services/src/service.rs // .change_context(ApiClientError::CertificateDecodeFailed)?; // let decoded_certificate_key = BASE64_ENGINE // .decode(encoded_certificate_key.expose()) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let certificate = String::from_utf8(decoded_certificate) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let certificate_key = String::from_utf8(decoded_certificate_key) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let key_chain = format!("{}{}", certificate_key, certificate); // reqwest::Identity::from_pem(key_chain.as_bytes()) // .change_context(ApiClientError::CertificateDecodeFailed)
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 850, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_850_30
clm
snippet
// connector-service/backend/external-services/src/service.rs // .change_context(ApiClientError::CertificateDecodeFailed)?; // let decoded_certificate_key = BASE64_ENGINE // .decode(encoded_certificate_key.expose()) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let certificate = String::from_utf8(decoded_certificate) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let certificate_key = String::from_utf8(decoded_certificate_key) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let key_chain = format!("{}{}", certificate_key, certificate); // reqwest::Identity::from_pem(key_chain.as_bytes()) // .change_context(ApiClientError::CertificateDecodeFailed) // } // pub fn create_certificate( // encoded_certificate: hyperswitch_masking::Secret<String>, // ) -> Result<Vec<reqwest::Certificate>, error_stack::Report<ApiClientError>> { // let decoded_certificate = BASE64_ENGINE // .decode(encoded_certificate.expose()) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let certificate = String::from_utf8(decoded_certificate) // .change_context(ApiClientError::CertificateDecodeFailed)?; // reqwest::Certificate::from_pem_bundle(certificate.as_bytes()) // .change_context(ApiClientError::CertificateDecodeFailed) // }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 850, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_850_50
clm
snippet
// connector-service/backend/external-services/src/service.rs // .change_context(ApiClientError::CertificateDecodeFailed)?; // let decoded_certificate_key = BASE64_ENGINE // .decode(encoded_certificate_key.expose()) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let certificate = String::from_utf8(decoded_certificate) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let certificate_key = String::from_utf8(decoded_certificate_key) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let key_chain = format!("{}{}", certificate_key, certificate); // reqwest::Identity::from_pem(key_chain.as_bytes()) // .change_context(ApiClientError::CertificateDecodeFailed) // } // pub fn create_certificate( // encoded_certificate: hyperswitch_masking::Secret<String>, // ) -> Result<Vec<reqwest::Certificate>, error_stack::Report<ApiClientError>> { // let decoded_certificate = BASE64_ENGINE // .decode(encoded_certificate.expose()) // .change_context(ApiClientError::CertificateDecodeFailed)?; // let certificate = String::from_utf8(decoded_certificate) // .change_context(ApiClientError::CertificateDecodeFailed)?; // reqwest::Certificate::from_pem_bundle(certificate.as_bytes()) // .change_context(ApiClientError::CertificateDecodeFailed) // } async fn handle_response( response: CustomResult<reqwest::Response, ApiClientError>, ) -> CustomResult<Result<Response, Response>, ApiClientError> { response .async_map(|resp| async { let status_code = resp.status().as_u16(); let headers = Some(resp.headers().to_owned()); match status_code { 200..=202 | 302 | 204 => { let response = resp .bytes() .await .change_context(ApiClientError::ResponseDecodingFailed)?; Ok(Ok(Response { headers, response, status_code, })) } 500..=599 => {
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 850, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_875_15
clm
snippet
// connector-service/backend/external-services/src/service.rs // .change_context(ApiClientError::CertificateDecodeFailed)?; // reqwest::Certificate::from_pem_bundle(certificate.as_bytes()) // .change_context(ApiClientError::CertificateDecodeFailed) // } async fn handle_response( response: CustomResult<reqwest::Response, ApiClientError>, ) -> CustomResult<Result<Response, Response>, ApiClientError> { response .async_map(|resp| async { let status_code = resp.status().as_u16(); let headers = Some(resp.headers().to_owned()); match status_code { 200..=202 | 302 | 204 => { let response = resp
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 875, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_875_30
clm
snippet
// connector-service/backend/external-services/src/service.rs // .change_context(ApiClientError::CertificateDecodeFailed)?; // reqwest::Certificate::from_pem_bundle(certificate.as_bytes()) // .change_context(ApiClientError::CertificateDecodeFailed) // } async fn handle_response( response: CustomResult<reqwest::Response, ApiClientError>, ) -> CustomResult<Result<Response, Response>, ApiClientError> { response .async_map(|resp| async { let status_code = resp.status().as_u16(); let headers = Some(resp.headers().to_owned()); match status_code { 200..=202 | 302 | 204 => { let response = resp .bytes() .await .change_context(ApiClientError::ResponseDecodingFailed)?; Ok(Ok(Response { headers, response, status_code, })) } 500..=599 => { let bytes = resp.bytes().await.map_err(|error| { report!(error).change_context(ApiClientError::ResponseDecodingFailed) })?; Ok(Err(Response {
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 875, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_875_50
clm
snippet
// connector-service/backend/external-services/src/service.rs // .change_context(ApiClientError::CertificateDecodeFailed)?; // reqwest::Certificate::from_pem_bundle(certificate.as_bytes()) // .change_context(ApiClientError::CertificateDecodeFailed) // } async fn handle_response( response: CustomResult<reqwest::Response, ApiClientError>, ) -> CustomResult<Result<Response, Response>, ApiClientError> { response .async_map(|resp| async { let status_code = resp.status().as_u16(); let headers = Some(resp.headers().to_owned()); match status_code { 200..=202 | 302 | 204 => { let response = resp .bytes() .await .change_context(ApiClientError::ResponseDecodingFailed)?; Ok(Ok(Response { headers, response, status_code, })) } 500..=599 => { let bytes = resp.bytes().await.map_err(|error| { report!(error).change_context(ApiClientError::ResponseDecodingFailed) })?; Ok(Err(Response { headers, response: bytes, status_code, })) } 400..=499 => { let bytes = resp.bytes().await.map_err(|error| { report!(error).change_context(ApiClientError::ResponseDecodingFailed) })?; Ok(Err(Response { headers, response: bytes, status_code, })) } _ => { info_log( "UNEXPECTED_RESPONSE",
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 875, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_900_15
clm
snippet
// connector-service/backend/external-services/src/service.rs let bytes = resp.bytes().await.map_err(|error| { report!(error).change_context(ApiClientError::ResponseDecodingFailed) })?; Ok(Err(Response { headers, response: bytes, status_code, })) } 400..=499 => { let bytes = resp.bytes().await.map_err(|error| { report!(error).change_context(ApiClientError::ResponseDecodingFailed) })?;
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 900, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_900_30
clm
snippet
// connector-service/backend/external-services/src/service.rs let bytes = resp.bytes().await.map_err(|error| { report!(error).change_context(ApiClientError::ResponseDecodingFailed) })?; Ok(Err(Response { headers, response: bytes, status_code, })) } 400..=499 => { let bytes = resp.bytes().await.map_err(|error| { report!(error).change_context(ApiClientError::ResponseDecodingFailed) })?; Ok(Err(Response { headers, response: bytes, status_code, })) } _ => { info_log( "UNEXPECTED_RESPONSE", &json!("Unexpected response from server."), ); Err(report!(ApiClientError::UnexpectedServerResponse)) } }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 900, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_900_50
clm
snippet
// connector-service/backend/external-services/src/service.rs let bytes = resp.bytes().await.map_err(|error| { report!(error).change_context(ApiClientError::ResponseDecodingFailed) })?; Ok(Err(Response { headers, response: bytes, status_code, })) } 400..=499 => { let bytes = resp.bytes().await.map_err(|error| { report!(error).change_context(ApiClientError::ResponseDecodingFailed) })?; Ok(Err(Response { headers, response: bytes, status_code, })) } _ => { info_log( "UNEXPECTED_RESPONSE", &json!("Unexpected response from server."), ); Err(report!(ApiClientError::UnexpectedServerResponse)) } } }) .await? } /// Helper function to remove BOM from response bytes and convert to string fn strip_bom_and_convert_to_string(response_bytes: &[u8]) -> Option<String> { String::from_utf8(response_bytes.to_vec()).ok().map(|s| { // Remove BOM if present (UTF-8 BOM is 0xEF, 0xBB, 0xBF) if s.starts_with('\u{FEFF}') { s.trim_start_matches('\u{FEFF}').to_string() } else { s } }) } fn extract_raw_connector_request(connector_request: &Request) -> String { // Extract actual body content let body_content = match connector_request.body.as_ref() { Some(request) => {
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 900, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_925_15
clm
snippet
// connector-service/backend/external-services/src/service.rs &json!("Unexpected response from server."), ); Err(report!(ApiClientError::UnexpectedServerResponse)) } } }) .await? } /// Helper function to remove BOM from response bytes and convert to string fn strip_bom_and_convert_to_string(response_bytes: &[u8]) -> Option<String> { String::from_utf8(response_bytes.to_vec()).ok().map(|s| { // Remove BOM if present (UTF-8 BOM is 0xEF, 0xBB, 0xBF) if s.starts_with('\u{FEFF}') { s.trim_start_matches('\u{FEFF}').to_string()
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 925, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_925_30
clm
snippet
// connector-service/backend/external-services/src/service.rs &json!("Unexpected response from server."), ); Err(report!(ApiClientError::UnexpectedServerResponse)) } } }) .await? } /// Helper function to remove BOM from response bytes and convert to string fn strip_bom_and_convert_to_string(response_bytes: &[u8]) -> Option<String> { String::from_utf8(response_bytes.to_vec()).ok().map(|s| { // Remove BOM if present (UTF-8 BOM is 0xEF, 0xBB, 0xBF) if s.starts_with('\u{FEFF}') { s.trim_start_matches('\u{FEFF}').to_string() } else { s } }) } fn extract_raw_connector_request(connector_request: &Request) -> String { // Extract actual body content let body_content = match connector_request.body.as_ref() { Some(request) => { let inner_value = request.get_inner_value(); serde_json::from_str(&inner_value.expose()).unwrap_or_else(|_| { tracing::warn!("failed to parse JSON body in extract_raw_connector_request"); json!({ "error": "failed to parse JSON body" }) })
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 925, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_925_50
clm
snippet
// connector-service/backend/external-services/src/service.rs &json!("Unexpected response from server."), ); Err(report!(ApiClientError::UnexpectedServerResponse)) } } }) .await? } /// Helper function to remove BOM from response bytes and convert to string fn strip_bom_and_convert_to_string(response_bytes: &[u8]) -> Option<String> { String::from_utf8(response_bytes.to_vec()).ok().map(|s| { // Remove BOM if present (UTF-8 BOM is 0xEF, 0xBB, 0xBF) if s.starts_with('\u{FEFF}') { s.trim_start_matches('\u{FEFF}').to_string() } else { s } }) } fn extract_raw_connector_request(connector_request: &Request) -> String { // Extract actual body content let body_content = match connector_request.body.as_ref() { Some(request) => { let inner_value = request.get_inner_value(); serde_json::from_str(&inner_value.expose()).unwrap_or_else(|_| { tracing::warn!("failed to parse JSON body in extract_raw_connector_request"); json!({ "error": "failed to parse JSON body" }) }) } None => serde_json::Value::Null, }; // Extract unmasked headers let headers_content = connector_request .headers .iter() .map(|(k, v)| { let value = match v { Maskable::Normal(val) => val.clone(), Maskable::Masked(val) => val.clone().expose().to_string(), }; (k.clone(), value) }) .collect::<HashMap<_, _>>(); // Create complete request with actual content json!({ "url": connector_request.url, "method": connector_request.method.to_string(),
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 925, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_950_15
clm
snippet
// connector-service/backend/external-services/src/service.rs let inner_value = request.get_inner_value(); serde_json::from_str(&inner_value.expose()).unwrap_or_else(|_| { tracing::warn!("failed to parse JSON body in extract_raw_connector_request"); json!({ "error": "failed to parse JSON body" }) }) } None => serde_json::Value::Null, }; // Extract unmasked headers let headers_content = connector_request .headers .iter() .map(|(k, v)| { let value = match v { Maskable::Normal(val) => val.clone(),
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 950, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_950_30
clm
snippet
// connector-service/backend/external-services/src/service.rs let inner_value = request.get_inner_value(); serde_json::from_str(&inner_value.expose()).unwrap_or_else(|_| { tracing::warn!("failed to parse JSON body in extract_raw_connector_request"); json!({ "error": "failed to parse JSON body" }) }) } None => serde_json::Value::Null, }; // Extract unmasked headers let headers_content = connector_request .headers .iter() .map(|(k, v)| { let value = match v { Maskable::Normal(val) => val.clone(), Maskable::Masked(val) => val.clone().expose().to_string(), }; (k.clone(), value) }) .collect::<HashMap<_, _>>(); // Create complete request with actual content json!({ "url": connector_request.url, "method": connector_request.method.to_string(), "headers": headers_content, "body": body_content }) .to_string() }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 950, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_950_50
clm
snippet
// connector-service/backend/external-services/src/service.rs let inner_value = request.get_inner_value(); serde_json::from_str(&inner_value.expose()).unwrap_or_else(|_| { tracing::warn!("failed to parse JSON body in extract_raw_connector_request"); json!({ "error": "failed to parse JSON body" }) }) } None => serde_json::Value::Null, }; // Extract unmasked headers let headers_content = connector_request .headers .iter() .map(|(k, v)| { let value = match v { Maskable::Normal(val) => val.clone(), Maskable::Masked(val) => val.clone().expose().to_string(), }; (k.clone(), value) }) .collect::<HashMap<_, _>>(); // Create complete request with actual content json!({ "url": connector_request.url, "method": connector_request.method.to_string(), "headers": headers_content, "body": body_content }) .to_string() } /// Helper function to parse JSON from response bytes with BOM handling fn parse_json_with_bom_handling( response_bytes: &[u8], ) -> Result<serde_json::Value, serde_json::Error> { // Try direct parsing first (most common case) match serde_json::from_slice::<serde_json::Value>(response_bytes) { Ok(value) => Ok(value), Err(_) => { // If direct parsing fails, try after removing BOM let cleaned_response = if response_bytes.starts_with(&[0xEF, 0xBB, 0xBF]) { // UTF-8 BOM detected, remove it #[allow(clippy::indexing_slicing)] &response_bytes[3..] } else { response_bytes }; serde_json::from_slice::<serde_json::Value>(cleaned_response) } }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 950, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_975_15
clm
snippet
// connector-service/backend/external-services/src/service.rs "headers": headers_content, "body": body_content }) .to_string() } /// Helper function to parse JSON from response bytes with BOM handling fn parse_json_with_bom_handling( response_bytes: &[u8], ) -> Result<serde_json::Value, serde_json::Error> { // Try direct parsing first (most common case) match serde_json::from_slice::<serde_json::Value>(response_bytes) { Ok(value) => Ok(value), Err(_) => { // If direct parsing fails, try after removing BOM
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 975, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_975_30
clm
snippet
// connector-service/backend/external-services/src/service.rs "headers": headers_content, "body": body_content }) .to_string() } /// Helper function to parse JSON from response bytes with BOM handling fn parse_json_with_bom_handling( response_bytes: &[u8], ) -> Result<serde_json::Value, serde_json::Error> { // Try direct parsing first (most common case) match serde_json::from_slice::<serde_json::Value>(response_bytes) { Ok(value) => Ok(value), Err(_) => { // If direct parsing fails, try after removing BOM let cleaned_response = if response_bytes.starts_with(&[0xEF, 0xBB, 0xBF]) { // UTF-8 BOM detected, remove it #[allow(clippy::indexing_slicing)] &response_bytes[3..] } else { response_bytes }; serde_json::from_slice::<serde_json::Value>(cleaned_response) } } } pub(super) trait HeaderExt { fn construct_header_map(self) -> CustomResult<reqwest::header::HeaderMap, ApiClientError>; }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 975, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_975_50
clm
snippet
// connector-service/backend/external-services/src/service.rs "headers": headers_content, "body": body_content }) .to_string() } /// Helper function to parse JSON from response bytes with BOM handling fn parse_json_with_bom_handling( response_bytes: &[u8], ) -> Result<serde_json::Value, serde_json::Error> { // Try direct parsing first (most common case) match serde_json::from_slice::<serde_json::Value>(response_bytes) { Ok(value) => Ok(value), Err(_) => { // If direct parsing fails, try after removing BOM let cleaned_response = if response_bytes.starts_with(&[0xEF, 0xBB, 0xBF]) { // UTF-8 BOM detected, remove it #[allow(clippy::indexing_slicing)] &response_bytes[3..] } else { response_bytes }; serde_json::from_slice::<serde_json::Value>(cleaned_response) } } } pub(super) trait HeaderExt { fn construct_header_map(self) -> CustomResult<reqwest::header::HeaderMap, ApiClientError>; } impl HeaderExt for Headers { fn construct_header_map(self) -> CustomResult<reqwest::header::HeaderMap, ApiClientError> { use reqwest::header::{HeaderMap, HeaderName, HeaderValue}; self.into_iter().try_fold( HeaderMap::new(), |mut header_map, (header_name, header_value)| { let header_name = HeaderName::from_str(&header_name) .change_context(ApiClientError::HeaderMapConstructionFailed)?; let header_value = header_value.into_inner(); let header_value = HeaderValue::from_str(&header_value) .change_context(ApiClientError::HeaderMapConstructionFailed)?; header_map.append(header_name, header_value); Ok(header_map) }, ) } }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 975, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_1000_15
clm
snippet
// connector-service/backend/external-services/src/service.rs } pub(super) trait HeaderExt { fn construct_header_map(self) -> CustomResult<reqwest::header::HeaderMap, ApiClientError>; } impl HeaderExt for Headers { fn construct_header_map(self) -> CustomResult<reqwest::header::HeaderMap, ApiClientError> { use reqwest::header::{HeaderMap, HeaderName, HeaderValue}; self.into_iter().try_fold( HeaderMap::new(), |mut header_map, (header_name, header_value)| { let header_name = HeaderName::from_str(&header_name) .change_context(ApiClientError::HeaderMapConstructionFailed)?;
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1000, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_1000_30
clm
snippet
// connector-service/backend/external-services/src/service.rs } pub(super) trait HeaderExt { fn construct_header_map(self) -> CustomResult<reqwest::header::HeaderMap, ApiClientError>; } impl HeaderExt for Headers { fn construct_header_map(self) -> CustomResult<reqwest::header::HeaderMap, ApiClientError> { use reqwest::header::{HeaderMap, HeaderName, HeaderValue}; self.into_iter().try_fold( HeaderMap::new(), |mut header_map, (header_name, header_value)| { let header_name = HeaderName::from_str(&header_name) .change_context(ApiClientError::HeaderMapConstructionFailed)?; let header_value = header_value.into_inner(); let header_value = HeaderValue::from_str(&header_value) .change_context(ApiClientError::HeaderMapConstructionFailed)?; header_map.append(header_name, header_value); Ok(header_map) }, ) } } pub(super) trait RequestBuilderExt { fn add_headers(self, headers: reqwest::header::HeaderMap) -> Self; } impl RequestBuilderExt for reqwest::RequestBuilder {
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1000, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_1000_50
clm
snippet
// connector-service/backend/external-services/src/service.rs } pub(super) trait HeaderExt { fn construct_header_map(self) -> CustomResult<reqwest::header::HeaderMap, ApiClientError>; } impl HeaderExt for Headers { fn construct_header_map(self) -> CustomResult<reqwest::header::HeaderMap, ApiClientError> { use reqwest::header::{HeaderMap, HeaderName, HeaderValue}; self.into_iter().try_fold( HeaderMap::new(), |mut header_map, (header_name, header_value)| { let header_name = HeaderName::from_str(&header_name) .change_context(ApiClientError::HeaderMapConstructionFailed)?; let header_value = header_value.into_inner(); let header_value = HeaderValue::from_str(&header_value) .change_context(ApiClientError::HeaderMapConstructionFailed)?; header_map.append(header_name, header_value); Ok(header_map) }, ) } } pub(super) trait RequestBuilderExt { fn add_headers(self, headers: reqwest::header::HeaderMap) -> Self; } impl RequestBuilderExt for reqwest::RequestBuilder { fn add_headers(mut self, headers: reqwest::header::HeaderMap) -> Self { self = self.headers(headers); self } } #[derive(Debug, Default, serde::Deserialize, Clone, strum::EnumString)] pub enum Tag { /// General. #[default] General, /// Redis: get. RedisGet, /// Redis: set. RedisSet, /// API: incoming web request. ApiIncomingRequest, /// API: outgoing web request body. ApiOutgoingRequestBody, /// API: outgoingh headers
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1000, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_1025_15
clm
snippet
// connector-service/backend/external-services/src/service.rs pub(super) trait RequestBuilderExt { fn add_headers(self, headers: reqwest::header::HeaderMap) -> Self; } impl RequestBuilderExt for reqwest::RequestBuilder { fn add_headers(mut self, headers: reqwest::header::HeaderMap) -> Self { self = self.headers(headers); self } } #[derive(Debug, Default, serde::Deserialize, Clone, strum::EnumString)] pub enum Tag { /// General. #[default]
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1025, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_1025_30
clm
snippet
// connector-service/backend/external-services/src/service.rs pub(super) trait RequestBuilderExt { fn add_headers(self, headers: reqwest::header::HeaderMap) -> Self; } impl RequestBuilderExt for reqwest::RequestBuilder { fn add_headers(mut self, headers: reqwest::header::HeaderMap) -> Self { self = self.headers(headers); self } } #[derive(Debug, Default, serde::Deserialize, Clone, strum::EnumString)] pub enum Tag { /// General. #[default] General, /// Redis: get. RedisGet, /// Redis: set. RedisSet, /// API: incoming web request. ApiIncomingRequest, /// API: outgoing web request body. ApiOutgoingRequestBody, /// API: outgoingh headers ApiOutgoingRequestHeaders, /// End Request EndRequest, /// Call initiated to connector. InitiatedToConnector,
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1025, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_1025_50
clm
snippet
// connector-service/backend/external-services/src/service.rs pub(super) trait RequestBuilderExt { fn add_headers(self, headers: reqwest::header::HeaderMap) -> Self; } impl RequestBuilderExt for reqwest::RequestBuilder { fn add_headers(mut self, headers: reqwest::header::HeaderMap) -> Self { self = self.headers(headers); self } } #[derive(Debug, Default, serde::Deserialize, Clone, strum::EnumString)] pub enum Tag { /// General. #[default] General, /// Redis: get. RedisGet, /// Redis: set. RedisSet, /// API: incoming web request. ApiIncomingRequest, /// API: outgoing web request body. ApiOutgoingRequestBody, /// API: outgoingh headers ApiOutgoingRequestHeaders, /// End Request EndRequest, /// Call initiated to connector. InitiatedToConnector, /// Incoming response IncomingApi, /// Api Outgoing Request OutgoingApi, } #[inline] pub fn debug_log(action: &str, message: &serde_json::Value) { tracing::debug!(tags = %action, json_value= %message); } #[inline] pub fn info_log(action: &str, message: &serde_json::Value) { tracing::info!(tags = %action, json_value= %message); } #[inline] pub fn error_log(action: &str, message: &serde_json::Value) { tracing::error!(tags = %action, json_value= %message); }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1025, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_1050_15
clm
snippet
// connector-service/backend/external-services/src/service.rs ApiOutgoingRequestHeaders, /// End Request EndRequest, /// Call initiated to connector. InitiatedToConnector, /// Incoming response IncomingApi, /// Api Outgoing Request OutgoingApi, } #[inline] pub fn debug_log(action: &str, message: &serde_json::Value) { tracing::debug!(tags = %action, json_value= %message); }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1050, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_1050_30
clm
snippet
// connector-service/backend/external-services/src/service.rs ApiOutgoingRequestHeaders, /// End Request EndRequest, /// Call initiated to connector. InitiatedToConnector, /// Incoming response IncomingApi, /// Api Outgoing Request OutgoingApi, } #[inline] pub fn debug_log(action: &str, message: &serde_json::Value) { tracing::debug!(tags = %action, json_value= %message); } #[inline] pub fn info_log(action: &str, message: &serde_json::Value) { tracing::info!(tags = %action, json_value= %message); } #[inline] pub fn error_log(action: &str, message: &serde_json::Value) { tracing::error!(tags = %action, json_value= %message); } #[inline] pub fn warn_log(action: &str, message: &serde_json::Value) { tracing::warn!(tags = %action, json_value= %message); }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1050, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7416499650036175072_1050_50
clm
snippet
// connector-service/backend/external-services/src/service.rs ApiOutgoingRequestHeaders, /// End Request EndRequest, /// Call initiated to connector. InitiatedToConnector, /// Incoming response IncomingApi, /// Api Outgoing Request OutgoingApi, } #[inline] pub fn debug_log(action: &str, message: &serde_json::Value) { tracing::debug!(tags = %action, json_value= %message); } #[inline] pub fn info_log(action: &str, message: &serde_json::Value) { tracing::info!(tags = %action, json_value= %message); } #[inline] pub fn error_log(action: &str, message: &serde_json::Value) { tracing::error!(tags = %action, json_value= %message); } #[inline] pub fn warn_log(action: &str, message: &serde_json::Value) { tracing::warn!(tags = %action, json_value= %message); }
{ "chunk": null, "crate": "external-services", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1050, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_0_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs use std::str::FromStr; use common_enums::{self, CaptureMethod, Currency}; use common_utils::{ pii::{self, IpAddress}, types::SemanticVersion, Email, MinorUnit, }; use error_stack::ResultExt; use hyperswitch_masking::Secret; use serde::Serialize; use crate::utils::ForeignFrom; use grpc_api_types::payments;
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 0, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_0_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs use std::str::FromStr; use common_enums::{self, CaptureMethod, Currency}; use common_utils::{ pii::{self, IpAddress}, types::SemanticVersion, Email, MinorUnit, }; use error_stack::ResultExt; use hyperswitch_masking::Secret; use serde::Serialize; use crate::utils::ForeignFrom; use grpc_api_types::payments; use crate::{ errors, payment_method_data::{PaymentMethodData, PaymentMethodDataTypes}, utils, }; pub type Error = error_stack::Report<crate::errors::ConnectorError>; #[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct BrowserInformation { pub color_depth: Option<u8>, pub java_enabled: Option<bool>, pub java_script_enabled: Option<bool>, pub language: Option<String>, pub screen_height: Option<u32>,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 0, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_0_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs use std::str::FromStr; use common_enums::{self, CaptureMethod, Currency}; use common_utils::{ pii::{self, IpAddress}, types::SemanticVersion, Email, MinorUnit, }; use error_stack::ResultExt; use hyperswitch_masking::Secret; use serde::Serialize; use crate::utils::ForeignFrom; use grpc_api_types::payments; use crate::{ errors, payment_method_data::{PaymentMethodData, PaymentMethodDataTypes}, utils, }; pub type Error = error_stack::Report<crate::errors::ConnectorError>; #[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct BrowserInformation { pub color_depth: Option<u8>, pub java_enabled: Option<bool>, pub java_script_enabled: Option<bool>, pub language: Option<String>, pub screen_height: Option<u32>, pub screen_width: Option<u32>, pub time_zone: Option<i32>, pub ip_address: Option<std::net::IpAddr>, pub accept_header: Option<String>, pub user_agent: Option<String>, pub os_type: Option<String>, pub os_version: Option<String>, pub device_model: Option<String>, pub accept_language: Option<String>, pub referer: Option<String>, } impl BrowserInformation { pub fn get_ip_address(&self) -> Result<Secret<String, IpAddress>, Error> { let ip_address = self .ip_address .ok_or_else(utils::missing_field_err("browser_info.ip_address"))?; Ok(Secret::new(ip_address.to_string())) } pub fn get_accept_header(&self) -> Result<String, Error> {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 0, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_25_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub color_depth: Option<u8>, pub java_enabled: Option<bool>, pub java_script_enabled: Option<bool>, pub language: Option<String>, pub screen_height: Option<u32>, pub screen_width: Option<u32>, pub time_zone: Option<i32>, pub ip_address: Option<std::net::IpAddr>, pub accept_header: Option<String>, pub user_agent: Option<String>, pub os_type: Option<String>, pub os_version: Option<String>, pub device_model: Option<String>, pub accept_language: Option<String>, pub referer: Option<String>,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 25, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_25_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub color_depth: Option<u8>, pub java_enabled: Option<bool>, pub java_script_enabled: Option<bool>, pub language: Option<String>, pub screen_height: Option<u32>, pub screen_width: Option<u32>, pub time_zone: Option<i32>, pub ip_address: Option<std::net::IpAddr>, pub accept_header: Option<String>, pub user_agent: Option<String>, pub os_type: Option<String>, pub os_version: Option<String>, pub device_model: Option<String>, pub accept_language: Option<String>, pub referer: Option<String>, } impl BrowserInformation { pub fn get_ip_address(&self) -> Result<Secret<String, IpAddress>, Error> { let ip_address = self .ip_address .ok_or_else(utils::missing_field_err("browser_info.ip_address"))?; Ok(Secret::new(ip_address.to_string())) } pub fn get_accept_header(&self) -> Result<String, Error> { self.accept_header .clone() .ok_or_else(utils::missing_field_err("browser_info.accept_header")) } pub fn get_language(&self) -> Result<String, Error> {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 25, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_25_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub color_depth: Option<u8>, pub java_enabled: Option<bool>, pub java_script_enabled: Option<bool>, pub language: Option<String>, pub screen_height: Option<u32>, pub screen_width: Option<u32>, pub time_zone: Option<i32>, pub ip_address: Option<std::net::IpAddr>, pub accept_header: Option<String>, pub user_agent: Option<String>, pub os_type: Option<String>, pub os_version: Option<String>, pub device_model: Option<String>, pub accept_language: Option<String>, pub referer: Option<String>, } impl BrowserInformation { pub fn get_ip_address(&self) -> Result<Secret<String, IpAddress>, Error> { let ip_address = self .ip_address .ok_or_else(utils::missing_field_err("browser_info.ip_address"))?; Ok(Secret::new(ip_address.to_string())) } pub fn get_accept_header(&self) -> Result<String, Error> { self.accept_header .clone() .ok_or_else(utils::missing_field_err("browser_info.accept_header")) } pub fn get_language(&self) -> Result<String, Error> { self.language .clone() .ok_or_else(utils::missing_field_err("browser_info.language")) } pub fn get_screen_height(&self) -> Result<u32, Error> { self.screen_height .ok_or_else(utils::missing_field_err("browser_info.screen_height")) } pub fn get_screen_width(&self) -> Result<u32, Error> { self.screen_width .ok_or_else(utils::missing_field_err("browser_info.screen_width")) } pub fn get_color_depth(&self) -> Result<u8, Error> { self.color_depth .ok_or_else(utils::missing_field_err("browser_info.color_depth")) } pub fn get_user_agent(&self) -> Result<String, Error> { self.user_agent .clone() .ok_or_else(utils::missing_field_err("browser_info.user_agent"))
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 25, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_50_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs self.accept_header .clone() .ok_or_else(utils::missing_field_err("browser_info.accept_header")) } pub fn get_language(&self) -> Result<String, Error> { self.language .clone() .ok_or_else(utils::missing_field_err("browser_info.language")) } pub fn get_screen_height(&self) -> Result<u32, Error> { self.screen_height .ok_or_else(utils::missing_field_err("browser_info.screen_height")) } pub fn get_screen_width(&self) -> Result<u32, Error> { self.screen_width
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 50, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_50_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs self.accept_header .clone() .ok_or_else(utils::missing_field_err("browser_info.accept_header")) } pub fn get_language(&self) -> Result<String, Error> { self.language .clone() .ok_or_else(utils::missing_field_err("browser_info.language")) } pub fn get_screen_height(&self) -> Result<u32, Error> { self.screen_height .ok_or_else(utils::missing_field_err("browser_info.screen_height")) } pub fn get_screen_width(&self) -> Result<u32, Error> { self.screen_width .ok_or_else(utils::missing_field_err("browser_info.screen_width")) } pub fn get_color_depth(&self) -> Result<u8, Error> { self.color_depth .ok_or_else(utils::missing_field_err("browser_info.color_depth")) } pub fn get_user_agent(&self) -> Result<String, Error> { self.user_agent .clone() .ok_or_else(utils::missing_field_err("browser_info.user_agent")) } pub fn get_time_zone(&self) -> Result<i32, Error> { self.time_zone .ok_or_else(utils::missing_field_err("browser_info.time_zone")) }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 50, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_50_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs self.accept_header .clone() .ok_or_else(utils::missing_field_err("browser_info.accept_header")) } pub fn get_language(&self) -> Result<String, Error> { self.language .clone() .ok_or_else(utils::missing_field_err("browser_info.language")) } pub fn get_screen_height(&self) -> Result<u32, Error> { self.screen_height .ok_or_else(utils::missing_field_err("browser_info.screen_height")) } pub fn get_screen_width(&self) -> Result<u32, Error> { self.screen_width .ok_or_else(utils::missing_field_err("browser_info.screen_width")) } pub fn get_color_depth(&self) -> Result<u8, Error> { self.color_depth .ok_or_else(utils::missing_field_err("browser_info.color_depth")) } pub fn get_user_agent(&self) -> Result<String, Error> { self.user_agent .clone() .ok_or_else(utils::missing_field_err("browser_info.user_agent")) } pub fn get_time_zone(&self) -> Result<i32, Error> { self.time_zone .ok_or_else(utils::missing_field_err("browser_info.time_zone")) } pub fn get_java_enabled(&self) -> Result<bool, Error> { self.java_enabled .ok_or_else(utils::missing_field_err("browser_info.java_enabled")) } pub fn get_java_script_enabled(&self) -> Result<bool, Error> { self.java_script_enabled .ok_or_else(utils::missing_field_err("browser_info.java_script_enabled")) } pub fn get_referer(&self) -> Result<String, Error> { self.referer .clone() .ok_or_else(utils::missing_field_err("browser_info.referer")) } } #[derive(Debug, Default, Clone)] pub enum SyncRequestType { MultipleCaptureSync(Vec<String>), #[default] SinglePaymentSync,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 50, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_75_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs } pub fn get_time_zone(&self) -> Result<i32, Error> { self.time_zone .ok_or_else(utils::missing_field_err("browser_info.time_zone")) } pub fn get_java_enabled(&self) -> Result<bool, Error> { self.java_enabled .ok_or_else(utils::missing_field_err("browser_info.java_enabled")) } pub fn get_java_script_enabled(&self) -> Result<bool, Error> { self.java_script_enabled .ok_or_else(utils::missing_field_err("browser_info.java_script_enabled")) } pub fn get_referer(&self) -> Result<String, Error> { self.referer
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 75, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_75_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs } pub fn get_time_zone(&self) -> Result<i32, Error> { self.time_zone .ok_or_else(utils::missing_field_err("browser_info.time_zone")) } pub fn get_java_enabled(&self) -> Result<bool, Error> { self.java_enabled .ok_or_else(utils::missing_field_err("browser_info.java_enabled")) } pub fn get_java_script_enabled(&self) -> Result<bool, Error> { self.java_script_enabled .ok_or_else(utils::missing_field_err("browser_info.java_script_enabled")) } pub fn get_referer(&self) -> Result<String, Error> { self.referer .clone() .ok_or_else(utils::missing_field_err("browser_info.referer")) } } #[derive(Debug, Default, Clone)] pub enum SyncRequestType { MultipleCaptureSync(Vec<String>), #[default] SinglePaymentSync, } #[derive(Debug, Default, Clone)] pub struct PaymentsCancelData { pub amount: Option<i64>,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 75, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_75_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs } pub fn get_time_zone(&self) -> Result<i32, Error> { self.time_zone .ok_or_else(utils::missing_field_err("browser_info.time_zone")) } pub fn get_java_enabled(&self) -> Result<bool, Error> { self.java_enabled .ok_or_else(utils::missing_field_err("browser_info.java_enabled")) } pub fn get_java_script_enabled(&self) -> Result<bool, Error> { self.java_script_enabled .ok_or_else(utils::missing_field_err("browser_info.java_script_enabled")) } pub fn get_referer(&self) -> Result<String, Error> { self.referer .clone() .ok_or_else(utils::missing_field_err("browser_info.referer")) } } #[derive(Debug, Default, Clone)] pub enum SyncRequestType { MultipleCaptureSync(Vec<String>), #[default] SinglePaymentSync, } #[derive(Debug, Default, Clone)] pub struct PaymentsCancelData { pub amount: Option<i64>, pub currency: Option<Currency>, pub connector_transaction_id: String, pub cancellation_reason: Option<String>, pub connector_meta: Option<serde_json::Value>, pub browser_info: Option<BrowserInformation>, pub metadata: Option<serde_json::Value>, // This metadata is used to store the metadata shared during the payment intent request. // minor amount data for amount framework pub minor_amount: Option<MinorUnit>, pub webhook_url: Option<String>, pub capture_method: Option<CaptureMethod>, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct AuthenticationData { pub trans_status: Option<common_enums::TransactionStatus>, pub eci: Option<String>, pub cavv: Option<Secret<String>>, // This is mastercard specific field
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 75, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_100_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs } #[derive(Debug, Default, Clone)] pub struct PaymentsCancelData { pub amount: Option<i64>, pub currency: Option<Currency>, pub connector_transaction_id: String, pub cancellation_reason: Option<String>, pub connector_meta: Option<serde_json::Value>, pub browser_info: Option<BrowserInformation>, pub metadata: Option<serde_json::Value>, // This metadata is used to store the metadata shared during the payment intent request. // minor amount data for amount framework pub minor_amount: Option<MinorUnit>,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 100, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_100_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs } #[derive(Debug, Default, Clone)] pub struct PaymentsCancelData { pub amount: Option<i64>, pub currency: Option<Currency>, pub connector_transaction_id: String, pub cancellation_reason: Option<String>, pub connector_meta: Option<serde_json::Value>, pub browser_info: Option<BrowserInformation>, pub metadata: Option<serde_json::Value>, // This metadata is used to store the metadata shared during the payment intent request. // minor amount data for amount framework pub minor_amount: Option<MinorUnit>, pub webhook_url: Option<String>, pub capture_method: Option<CaptureMethod>, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct AuthenticationData { pub trans_status: Option<common_enums::TransactionStatus>, pub eci: Option<String>, pub cavv: Option<Secret<String>>, // This is mastercard specific field pub ucaf_collection_indicator: Option<String>, pub threeds_server_transaction_id: Option<String>, pub message_version: Option<SemanticVersion>, pub ds_trans_id: Option<String>, pub acs_transaction_id: Option<String>,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 100, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_100_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs } #[derive(Debug, Default, Clone)] pub struct PaymentsCancelData { pub amount: Option<i64>, pub currency: Option<Currency>, pub connector_transaction_id: String, pub cancellation_reason: Option<String>, pub connector_meta: Option<serde_json::Value>, pub browser_info: Option<BrowserInformation>, pub metadata: Option<serde_json::Value>, // This metadata is used to store the metadata shared during the payment intent request. // minor amount data for amount framework pub minor_amount: Option<MinorUnit>, pub webhook_url: Option<String>, pub capture_method: Option<CaptureMethod>, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct AuthenticationData { pub trans_status: Option<common_enums::TransactionStatus>, pub eci: Option<String>, pub cavv: Option<Secret<String>>, // This is mastercard specific field pub ucaf_collection_indicator: Option<String>, pub threeds_server_transaction_id: Option<String>, pub message_version: Option<SemanticVersion>, pub ds_trans_id: Option<String>, pub acs_transaction_id: Option<String>, pub transaction_id: Option<String>, } impl TryFrom<payments::AuthenticationData> for AuthenticationData { type Error = error_stack::Report<errors::ApplicationErrorResponse>; fn try_from(value: payments::AuthenticationData) -> Result<Self, Self::Error> { let payments::AuthenticationData { eci, cavv, threeds_server_transaction_id, message_version, ds_transaction_id, trans_status, acs_transaction_id, transaction_id, ucaf_collection_indicator, } = value; let threeds_server_transaction_id = utils::extract_optional_connector_request_reference_id(&threeds_server_transaction_id); let message_version = message_version.map(|message_version|{
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 100, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_125_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub ucaf_collection_indicator: Option<String>, pub threeds_server_transaction_id: Option<String>, pub message_version: Option<SemanticVersion>, pub ds_trans_id: Option<String>, pub acs_transaction_id: Option<String>, pub transaction_id: Option<String>, } impl TryFrom<payments::AuthenticationData> for AuthenticationData { type Error = error_stack::Report<errors::ApplicationErrorResponse>; fn try_from(value: payments::AuthenticationData) -> Result<Self, Self::Error> { let payments::AuthenticationData { eci, cavv, threeds_server_transaction_id,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_125_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub ucaf_collection_indicator: Option<String>, pub threeds_server_transaction_id: Option<String>, pub message_version: Option<SemanticVersion>, pub ds_trans_id: Option<String>, pub acs_transaction_id: Option<String>, pub transaction_id: Option<String>, } impl TryFrom<payments::AuthenticationData> for AuthenticationData { type Error = error_stack::Report<errors::ApplicationErrorResponse>; fn try_from(value: payments::AuthenticationData) -> Result<Self, Self::Error> { let payments::AuthenticationData { eci, cavv, threeds_server_transaction_id, message_version, ds_transaction_id, trans_status, acs_transaction_id, transaction_id, ucaf_collection_indicator, } = value; let threeds_server_transaction_id = utils::extract_optional_connector_request_reference_id(&threeds_server_transaction_id); let message_version = message_version.map(|message_version|{ SemanticVersion::from_str(&message_version).change_context(errors::ApplicationErrorResponse::BadRequest(errors::ApiError{ sub_code: "INVALID_SEMANTIC_VERSION_DATA".to_owned(), error_identifier: 400, error_message: "Invalid semantic version format. Expected format: 'major.minor.patch' (e.g., '2.1.0')".to_string(), error_object: Some(serde_json::json!({
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_125_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub ucaf_collection_indicator: Option<String>, pub threeds_server_transaction_id: Option<String>, pub message_version: Option<SemanticVersion>, pub ds_trans_id: Option<String>, pub acs_transaction_id: Option<String>, pub transaction_id: Option<String>, } impl TryFrom<payments::AuthenticationData> for AuthenticationData { type Error = error_stack::Report<errors::ApplicationErrorResponse>; fn try_from(value: payments::AuthenticationData) -> Result<Self, Self::Error> { let payments::AuthenticationData { eci, cavv, threeds_server_transaction_id, message_version, ds_transaction_id, trans_status, acs_transaction_id, transaction_id, ucaf_collection_indicator, } = value; let threeds_server_transaction_id = utils::extract_optional_connector_request_reference_id(&threeds_server_transaction_id); let message_version = message_version.map(|message_version|{ SemanticVersion::from_str(&message_version).change_context(errors::ApplicationErrorResponse::BadRequest(errors::ApiError{ sub_code: "INVALID_SEMANTIC_VERSION_DATA".to_owned(), error_identifier: 400, error_message: "Invalid semantic version format. Expected format: 'major.minor.patch' (e.g., '2.1.0')".to_string(), error_object: Some(serde_json::json!({ "field": "message_version", "provided_value": message_version, "expected_format": "major.minor.patch", "examples": ["1.0.0", "2.1.0", "2.2.0"], "validation_rule": "Must be in format X.Y.Z where X, Y, Z are non-negative integers" })), })) }).transpose()?; let trans_status = trans_status.map(|trans_status|{ grpc_api_types::payments::TransactionStatus::try_from(trans_status).change_context(errors::ApplicationErrorResponse::BadRequest(errors::ApiError{ sub_code: "INVALID_TRANSACTION_STATUS".to_owned(), error_identifier: 400, error_message: "Invalid transaction status format. Expected one of the valid 3DS transaction status values".to_string(), error_object: Some(serde_json::json!({ "field": "transaction_status", "provided_value": trans_status, "expected_values": [ "Y (Success)", "N (Failure)", "U (Verification Not Performed)",
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_150_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs SemanticVersion::from_str(&message_version).change_context(errors::ApplicationErrorResponse::BadRequest(errors::ApiError{ sub_code: "INVALID_SEMANTIC_VERSION_DATA".to_owned(), error_identifier: 400, error_message: "Invalid semantic version format. Expected format: 'major.minor.patch' (e.g., '2.1.0')".to_string(), error_object: Some(serde_json::json!({ "field": "message_version", "provided_value": message_version, "expected_format": "major.minor.patch", "examples": ["1.0.0", "2.1.0", "2.2.0"], "validation_rule": "Must be in format X.Y.Z where X, Y, Z are non-negative integers" })), })) }).transpose()?; let trans_status = trans_status.map(|trans_status|{ grpc_api_types::payments::TransactionStatus::try_from(trans_status).change_context(errors::ApplicationErrorResponse::BadRequest(errors::ApiError{
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 150, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_150_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs SemanticVersion::from_str(&message_version).change_context(errors::ApplicationErrorResponse::BadRequest(errors::ApiError{ sub_code: "INVALID_SEMANTIC_VERSION_DATA".to_owned(), error_identifier: 400, error_message: "Invalid semantic version format. Expected format: 'major.minor.patch' (e.g., '2.1.0')".to_string(), error_object: Some(serde_json::json!({ "field": "message_version", "provided_value": message_version, "expected_format": "major.minor.patch", "examples": ["1.0.0", "2.1.0", "2.2.0"], "validation_rule": "Must be in format X.Y.Z where X, Y, Z are non-negative integers" })), })) }).transpose()?; let trans_status = trans_status.map(|trans_status|{ grpc_api_types::payments::TransactionStatus::try_from(trans_status).change_context(errors::ApplicationErrorResponse::BadRequest(errors::ApiError{ sub_code: "INVALID_TRANSACTION_STATUS".to_owned(), error_identifier: 400, error_message: "Invalid transaction status format. Expected one of the valid 3DS transaction status values".to_string(), error_object: Some(serde_json::json!({ "field": "transaction_status", "provided_value": trans_status, "expected_values": [ "Y (Success)", "N (Failure)", "U (Verification Not Performed)", "A (Not Verified)", "R (Rejected)", "C (Challenge Required)", "D (Challenge Required - Decoupled Authentication)", "I (Information Only)"
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 150, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_150_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs SemanticVersion::from_str(&message_version).change_context(errors::ApplicationErrorResponse::BadRequest(errors::ApiError{ sub_code: "INVALID_SEMANTIC_VERSION_DATA".to_owned(), error_identifier: 400, error_message: "Invalid semantic version format. Expected format: 'major.minor.patch' (e.g., '2.1.0')".to_string(), error_object: Some(serde_json::json!({ "field": "message_version", "provided_value": message_version, "expected_format": "major.minor.patch", "examples": ["1.0.0", "2.1.0", "2.2.0"], "validation_rule": "Must be in format X.Y.Z where X, Y, Z are non-negative integers" })), })) }).transpose()?; let trans_status = trans_status.map(|trans_status|{ grpc_api_types::payments::TransactionStatus::try_from(trans_status).change_context(errors::ApplicationErrorResponse::BadRequest(errors::ApiError{ sub_code: "INVALID_TRANSACTION_STATUS".to_owned(), error_identifier: 400, error_message: "Invalid transaction status format. Expected one of the valid 3DS transaction status values".to_string(), error_object: Some(serde_json::json!({ "field": "transaction_status", "provided_value": trans_status, "expected_values": [ "Y (Success)", "N (Failure)", "U (Verification Not Performed)", "A (Not Verified)", "R (Rejected)", "C (Challenge Required)", "D (Challenge Required - Decoupled Authentication)", "I (Information Only)" ], "validation_rule": "Must be one of the valid 3DS transaction status codes (Y, N, U, A, R, C, D, I)", "description": "Transaction status represents the result of 3D Secure authentication/verification process" })), }))}).transpose()?.map(common_enums::TransactionStatus::foreign_from); Ok(Self { ucaf_collection_indicator, trans_status, eci, cavv: cavv.map(Secret::new), threeds_server_transaction_id, message_version, ds_trans_id: ds_transaction_id, acs_transaction_id, transaction_id, }) } } impl utils::ForeignFrom<AuthenticationData> for payments::AuthenticationData {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 150, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_175_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs "A (Not Verified)", "R (Rejected)", "C (Challenge Required)", "D (Challenge Required - Decoupled Authentication)", "I (Information Only)" ], "validation_rule": "Must be one of the valid 3DS transaction status codes (Y, N, U, A, R, C, D, I)", "description": "Transaction status represents the result of 3D Secure authentication/verification process" })), }))}).transpose()?.map(common_enums::TransactionStatus::foreign_from); Ok(Self { ucaf_collection_indicator, trans_status, eci, cavv: cavv.map(Secret::new),
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_175_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs "A (Not Verified)", "R (Rejected)", "C (Challenge Required)", "D (Challenge Required - Decoupled Authentication)", "I (Information Only)" ], "validation_rule": "Must be one of the valid 3DS transaction status codes (Y, N, U, A, R, C, D, I)", "description": "Transaction status represents the result of 3D Secure authentication/verification process" })), }))}).transpose()?.map(common_enums::TransactionStatus::foreign_from); Ok(Self { ucaf_collection_indicator, trans_status, eci, cavv: cavv.map(Secret::new), threeds_server_transaction_id, message_version, ds_trans_id: ds_transaction_id, acs_transaction_id, transaction_id, }) } } impl utils::ForeignFrom<AuthenticationData> for payments::AuthenticationData { fn foreign_from(value: AuthenticationData) -> Self { use hyperswitch_masking::ExposeInterface; Self { ucaf_collection_indicator: value.ucaf_collection_indicator, eci: value.eci,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_175_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs "A (Not Verified)", "R (Rejected)", "C (Challenge Required)", "D (Challenge Required - Decoupled Authentication)", "I (Information Only)" ], "validation_rule": "Must be one of the valid 3DS transaction status codes (Y, N, U, A, R, C, D, I)", "description": "Transaction status represents the result of 3D Secure authentication/verification process" })), }))}).transpose()?.map(common_enums::TransactionStatus::foreign_from); Ok(Self { ucaf_collection_indicator, trans_status, eci, cavv: cavv.map(Secret::new), threeds_server_transaction_id, message_version, ds_trans_id: ds_transaction_id, acs_transaction_id, transaction_id, }) } } impl utils::ForeignFrom<AuthenticationData> for payments::AuthenticationData { fn foreign_from(value: AuthenticationData) -> Self { use hyperswitch_masking::ExposeInterface; Self { ucaf_collection_indicator: value.ucaf_collection_indicator, eci: value.eci, cavv: value.cavv.map(|cavv| cavv.expose()), threeds_server_transaction_id: value.threeds_server_transaction_id.map(|id| { payments::Identifier { id_type: Some(payments::identifier::IdType::Id(id)), } }), message_version: value.message_version.map(|v| v.to_string()), ds_transaction_id: value.ds_trans_id, trans_status: value .trans_status .map(payments::TransactionStatus::foreign_from) .map(i32::from), acs_transaction_id: value.acs_transaction_id, transaction_id: value.transaction_id, } } } #[derive(Debug, Clone)] pub struct ConnectorCustomerData<T: PaymentMethodDataTypes> {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_200_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs fn foreign_from(value: AuthenticationData) -> Self { use hyperswitch_masking::ExposeInterface; Self { ucaf_collection_indicator: value.ucaf_collection_indicator, eci: value.eci, cavv: value.cavv.map(|cavv| cavv.expose()), threeds_server_transaction_id: value.threeds_server_transaction_id.map(|id| { payments::Identifier { id_type: Some(payments::identifier::IdType::Id(id)), } }), message_version: value.message_version.map(|v| v.to_string()), ds_transaction_id: value.ds_trans_id, trans_status: value .trans_status
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_200_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs fn foreign_from(value: AuthenticationData) -> Self { use hyperswitch_masking::ExposeInterface; Self { ucaf_collection_indicator: value.ucaf_collection_indicator, eci: value.eci, cavv: value.cavv.map(|cavv| cavv.expose()), threeds_server_transaction_id: value.threeds_server_transaction_id.map(|id| { payments::Identifier { id_type: Some(payments::identifier::IdType::Id(id)), } }), message_version: value.message_version.map(|v| v.to_string()), ds_transaction_id: value.ds_trans_id, trans_status: value .trans_status .map(payments::TransactionStatus::foreign_from) .map(i32::from), acs_transaction_id: value.acs_transaction_id, transaction_id: value.transaction_id, } } } #[derive(Debug, Clone)] pub struct ConnectorCustomerData<T: PaymentMethodDataTypes> { pub description: Option<String>, pub email: Option<pii::Email>, pub phone: Option<Secret<String>>, pub name: Option<Secret<String>>, pub preprocessing_id: Option<String>,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_200_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs fn foreign_from(value: AuthenticationData) -> Self { use hyperswitch_masking::ExposeInterface; Self { ucaf_collection_indicator: value.ucaf_collection_indicator, eci: value.eci, cavv: value.cavv.map(|cavv| cavv.expose()), threeds_server_transaction_id: value.threeds_server_transaction_id.map(|id| { payments::Identifier { id_type: Some(payments::identifier::IdType::Id(id)), } }), message_version: value.message_version.map(|v| v.to_string()), ds_transaction_id: value.ds_trans_id, trans_status: value .trans_status .map(payments::TransactionStatus::foreign_from) .map(i32::from), acs_transaction_id: value.acs_transaction_id, transaction_id: value.transaction_id, } } } #[derive(Debug, Clone)] pub struct ConnectorCustomerData<T: PaymentMethodDataTypes> { pub description: Option<String>, pub email: Option<pii::Email>, pub phone: Option<Secret<String>>, pub name: Option<Secret<String>>, pub preprocessing_id: Option<String>, pub payment_method_data: Option<PaymentMethodData<T>>, // pub split_payments: Option<SplitPaymentsRequest>, } impl<T: PaymentMethodDataTypes> ConnectorCustomerData<T> { pub fn get_email(&self) -> Result<Email, Error> { self.email .clone() .ok_or_else(utils::missing_field_err("email")) } } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AuthoriseIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)]
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_225_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub description: Option<String>, pub email: Option<pii::Email>, pub phone: Option<Secret<String>>, pub name: Option<Secret<String>>, pub preprocessing_id: Option<String>, pub payment_method_data: Option<PaymentMethodData<T>>, // pub split_payments: Option<SplitPaymentsRequest>, } impl<T: PaymentMethodDataTypes> ConnectorCustomerData<T> { pub fn get_email(&self) -> Result<Email, Error> { self.email .clone() .ok_or_else(utils::missing_field_err("email")) }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 225, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_225_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub description: Option<String>, pub email: Option<pii::Email>, pub phone: Option<Secret<String>>, pub name: Option<Secret<String>>, pub preprocessing_id: Option<String>, pub payment_method_data: Option<PaymentMethodData<T>>, // pub split_payments: Option<SplitPaymentsRequest>, } impl<T: PaymentMethodDataTypes> ConnectorCustomerData<T> { pub fn get_email(&self) -> Result<Email, Error> { self.email .clone() .ok_or_else(utils::missing_field_err("email")) } } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AuthoriseIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct CreateOrderIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 225, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_225_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub description: Option<String>, pub email: Option<pii::Email>, pub phone: Option<Secret<String>>, pub name: Option<Secret<String>>, pub preprocessing_id: Option<String>, pub payment_method_data: Option<PaymentMethodData<T>>, // pub split_payments: Option<SplitPaymentsRequest>, } impl<T: PaymentMethodDataTypes> ConnectorCustomerData<T> { pub fn get_email(&self) -> Result<Email, Error> { self.email .clone() .ok_or_else(utils::missing_field_err("email")) } } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AuthoriseIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct CreateOrderIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SetupMandateIntegrityObject { /// Authorise amount pub amount: Option<MinorUnit>, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct RepeatPaymentIntegrityObject { /// Payment amount pub amount: i64, /// Payment currency pub currency: Currency, /// Mandate reference pub mandate_reference: String, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 225, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_250_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub struct CreateOrderIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SetupMandateIntegrityObject { /// Authorise amount pub amount: Option<MinorUnit>, /// Authorise currency pub currency: Currency, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 250, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_250_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub struct CreateOrderIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SetupMandateIntegrityObject { /// Authorise amount pub amount: Option<MinorUnit>, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct RepeatPaymentIntegrityObject { /// Payment amount pub amount: i64, /// Payment currency pub currency: Currency, /// Mandate reference pub mandate_reference: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentSynIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 250, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_250_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub struct CreateOrderIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SetupMandateIntegrityObject { /// Authorise amount pub amount: Option<MinorUnit>, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct RepeatPaymentIntegrityObject { /// Payment amount pub amount: i64, /// Payment currency pub currency: Currency, /// Mandate reference pub mandate_reference: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentSynIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentVoidIntegrityObject { pub connector_transaction_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentVoidPostCaptureIntegrityObject { pub connector_transaction_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct RefundIntegrityObject { pub refund_amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)]
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 250, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_275_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentSynIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentVoidIntegrityObject { pub connector_transaction_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentVoidPostCaptureIntegrityObject {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 275, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_275_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentSynIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentVoidIntegrityObject { pub connector_transaction_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentVoidPostCaptureIntegrityObject { pub connector_transaction_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct RefundIntegrityObject { pub refund_amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct CaptureIntegrityObject { pub amount_to_capture: MinorUnit, pub currency: Currency, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 275, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_275_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentSynIntegrityObject { /// Authorise amount pub amount: MinorUnit, /// Authorise currency pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentVoidIntegrityObject { pub connector_transaction_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentVoidPostCaptureIntegrityObject { pub connector_transaction_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct RefundIntegrityObject { pub refund_amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct CaptureIntegrityObject { pub amount_to_capture: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AcceptDisputeIntegrityObject { pub connector_dispute_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct DefendDisputeIntegrityObject { pub connector_dispute_id: String, pub defense_reason_code: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct RefundSyncIntegrityObject { pub connector_transaction_id: String, pub connector_refund_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SubmitEvidenceIntegrityObject { pub connector_dispute_id: String,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 275, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_300_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub struct CaptureIntegrityObject { pub amount_to_capture: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AcceptDisputeIntegrityObject { pub connector_dispute_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct DefendDisputeIntegrityObject { pub connector_dispute_id: String, pub defense_reason_code: String, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 300, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_300_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub struct CaptureIntegrityObject { pub amount_to_capture: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AcceptDisputeIntegrityObject { pub connector_dispute_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct DefendDisputeIntegrityObject { pub connector_dispute_id: String, pub defense_reason_code: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct RefundSyncIntegrityObject { pub connector_transaction_id: String, pub connector_refund_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SubmitEvidenceIntegrityObject { pub connector_dispute_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SessionTokenIntegrityObject { pub amount: MinorUnit,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 300, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_300_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs pub struct CaptureIntegrityObject { pub amount_to_capture: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AcceptDisputeIntegrityObject { pub connector_dispute_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct DefendDisputeIntegrityObject { pub connector_dispute_id: String, pub defense_reason_code: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct RefundSyncIntegrityObject { pub connector_transaction_id: String, pub connector_refund_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SubmitEvidenceIntegrityObject { pub connector_dispute_id: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SessionTokenIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AccessTokenIntegrityObject { pub grant_type: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct CreateConnectorCustomerIntegrityObject { pub customer_id: Option<Secret<String>>, pub email: Option<Secret<String>>, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentMethodTokenIntegrityObject { pub amount: MinorUnit, pub currency: Currency, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 300, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_325_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SessionTokenIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AccessTokenIntegrityObject { pub grant_type: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct CreateConnectorCustomerIntegrityObject {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 325, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_325_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SessionTokenIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AccessTokenIntegrityObject { pub grant_type: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct CreateConnectorCustomerIntegrityObject { pub customer_id: Option<Secret<String>>, pub email: Option<Secret<String>>, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentMethodTokenIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PreAuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 325, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_325_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct SessionTokenIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AccessTokenIntegrityObject { pub grant_type: String, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct CreateConnectorCustomerIntegrityObject { pub customer_id: Option<Secret<String>>, pub email: Option<Secret<String>>, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PaymentMethodTokenIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PreAuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PostAuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 42, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 325, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_350_15
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PreAuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PostAuthenticateIntegrityObject { pub amount: MinorUnit,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 350, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_350_30
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PreAuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PostAuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 17, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 350, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3648700667243119668_350_50
clm
snippet
// connector-service/backend/domain_types/src/router_request_types.rs #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PreAuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct AuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, } #[derive(Debug, Clone, PartialEq, Serialize)] pub struct PostAuthenticateIntegrityObject { pub amount: MinorUnit, pub currency: Currency, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 17, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 350, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_0_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs use core::result::Result; use std::{borrow::Cow, collections::HashMap, fmt::Debug, str::FromStr}; use crate::utils::extract_connector_request_reference_id; use common_enums::{CaptureMethod, CardNetwork, CountryAlpha2, PaymentMethod, PaymentMethodType}; use common_utils::{ consts::{self, NO_ERROR_CODE, X_EXTERNAL_VAULT_METADATA}, id_type::CustomerId, metadata::MaskedMetadata, pii::Email, Method, }; use error_stack::{report, ResultExt}; use grpc_api_types::payments::{ AcceptDisputeResponse, ConnectorState, DisputeDefendRequest, DisputeDefendResponse,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 0, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_0_30
clm
snippet
// connector-service/backend/domain_types/src/types.rs use core::result::Result; use std::{borrow::Cow, collections::HashMap, fmt::Debug, str::FromStr}; use crate::utils::extract_connector_request_reference_id; use common_enums::{CaptureMethod, CardNetwork, CountryAlpha2, PaymentMethod, PaymentMethodType}; use common_utils::{ consts::{self, NO_ERROR_CODE, X_EXTERNAL_VAULT_METADATA}, id_type::CustomerId, metadata::MaskedMetadata, pii::Email, Method, }; use error_stack::{report, ResultExt}; use grpc_api_types::payments::{ AcceptDisputeResponse, ConnectorState, DisputeDefendRequest, DisputeDefendResponse, DisputeResponse, DisputeServiceSubmitEvidenceResponse, PaymentServiceAuthorizeRequest, PaymentServiceAuthorizeResponse, PaymentServiceCaptureResponse, PaymentServiceGetResponse, PaymentServiceRegisterRequest, PaymentServiceRegisterResponse, PaymentServiceVoidPostCaptureResponse, PaymentServiceVoidRequest, PaymentServiceVoidResponse, RefundResponse, }; use hyperswitch_masking::{ExposeInterface, Secret}; use serde::Serialize; use tracing::info; use utoipa::ToSchema; /// Extract vault-related headers from gRPC metadata fn extract_headers_from_metadata( metadata: &MaskedMetadata, ) -> Option<HashMap<String, Secret<String>>> {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 0, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_0_50
clm
snippet
// connector-service/backend/domain_types/src/types.rs use core::result::Result; use std::{borrow::Cow, collections::HashMap, fmt::Debug, str::FromStr}; use crate::utils::extract_connector_request_reference_id; use common_enums::{CaptureMethod, CardNetwork, CountryAlpha2, PaymentMethod, PaymentMethodType}; use common_utils::{ consts::{self, NO_ERROR_CODE, X_EXTERNAL_VAULT_METADATA}, id_type::CustomerId, metadata::MaskedMetadata, pii::Email, Method, }; use error_stack::{report, ResultExt}; use grpc_api_types::payments::{ AcceptDisputeResponse, ConnectorState, DisputeDefendRequest, DisputeDefendResponse, DisputeResponse, DisputeServiceSubmitEvidenceResponse, PaymentServiceAuthorizeRequest, PaymentServiceAuthorizeResponse, PaymentServiceCaptureResponse, PaymentServiceGetResponse, PaymentServiceRegisterRequest, PaymentServiceRegisterResponse, PaymentServiceVoidPostCaptureResponse, PaymentServiceVoidRequest, PaymentServiceVoidResponse, RefundResponse, }; use hyperswitch_masking::{ExposeInterface, Secret}; use serde::Serialize; use tracing::info; use utoipa::ToSchema; /// Extract vault-related headers from gRPC metadata fn extract_headers_from_metadata( metadata: &MaskedMetadata, ) -> Option<HashMap<String, Secret<String>>> { let mut vault_headers = HashMap::new(); if let Some(vault_creds) = metadata.get(X_EXTERNAL_VAULT_METADATA) { vault_headers.insert(X_EXTERNAL_VAULT_METADATA.to_string(), vault_creds); } if vault_headers.is_empty() { None } else { Some(vault_headers) } } // For decoding connector_meta_data and Engine trait - base64 crate no longer needed here use crate::{ connector_flow::{ Accept, Authorize, Capture, CreateOrder, CreateSessionToken, DefendDispute, PSync, PaymentMethodToken, RSync, Refund, RepeatPayment, SetupMandate, SubmitEvidence, Void, VoidPC, },
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 0, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_25_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs /// Extract vault-related headers from gRPC metadata fn extract_headers_from_metadata( metadata: &MaskedMetadata, ) -> Option<HashMap<String, Secret<String>>> { let mut vault_headers = HashMap::new(); if let Some(vault_creds) = metadata.get(X_EXTERNAL_VAULT_METADATA) { vault_headers.insert(X_EXTERNAL_VAULT_METADATA.to_string(), vault_creds); } if vault_headers.is_empty() { None } else { Some(vault_headers)
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 25, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_25_30
clm
snippet
// connector-service/backend/domain_types/src/types.rs /// Extract vault-related headers from gRPC metadata fn extract_headers_from_metadata( metadata: &MaskedMetadata, ) -> Option<HashMap<String, Secret<String>>> { let mut vault_headers = HashMap::new(); if let Some(vault_creds) = metadata.get(X_EXTERNAL_VAULT_METADATA) { vault_headers.insert(X_EXTERNAL_VAULT_METADATA.to_string(), vault_creds); } if vault_headers.is_empty() { None } else { Some(vault_headers) } } // For decoding connector_meta_data and Engine trait - base64 crate no longer needed here use crate::{ connector_flow::{ Accept, Authorize, Capture, CreateOrder, CreateSessionToken, DefendDispute, PSync, PaymentMethodToken, RSync, Refund, RepeatPayment, SetupMandate, SubmitEvidence, Void, VoidPC, }, connector_types::{ AcceptDisputeData, AccessTokenRequestData, ConnectorCustomerData, ConnectorMandateReferenceId, ConnectorResponseHeaders, ContinueRedirectionResponse, DisputeDefendData, DisputeFlowData, DisputeResponseData, DisputeWebhookDetailsResponse, MandateReferenceId, MultipleCaptureRequestData, PaymentCreateOrderData,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 25, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_25_50
clm
snippet
// connector-service/backend/domain_types/src/types.rs /// Extract vault-related headers from gRPC metadata fn extract_headers_from_metadata( metadata: &MaskedMetadata, ) -> Option<HashMap<String, Secret<String>>> { let mut vault_headers = HashMap::new(); if let Some(vault_creds) = metadata.get(X_EXTERNAL_VAULT_METADATA) { vault_headers.insert(X_EXTERNAL_VAULT_METADATA.to_string(), vault_creds); } if vault_headers.is_empty() { None } else { Some(vault_headers) } } // For decoding connector_meta_data and Engine trait - base64 crate no longer needed here use crate::{ connector_flow::{ Accept, Authorize, Capture, CreateOrder, CreateSessionToken, DefendDispute, PSync, PaymentMethodToken, RSync, Refund, RepeatPayment, SetupMandate, SubmitEvidence, Void, VoidPC, }, connector_types::{ AcceptDisputeData, AccessTokenRequestData, ConnectorCustomerData, ConnectorMandateReferenceId, ConnectorResponseHeaders, ContinueRedirectionResponse, DisputeDefendData, DisputeFlowData, DisputeResponseData, DisputeWebhookDetailsResponse, MandateReferenceId, MultipleCaptureRequestData, PaymentCreateOrderData, PaymentCreateOrderResponse, PaymentFlowData, PaymentMethodTokenResponse, PaymentMethodTokenizationData, PaymentVoidData, PaymentsAuthenticateData, PaymentsAuthorizeData, PaymentsCaptureData, PaymentsPostAuthenticateData, PaymentsPreAuthenticateData, PaymentsResponseData, PaymentsSyncData, RawConnectorRequestResponse, RefundFlowData, RefundSyncData, RefundWebhookDetailsResponse, RefundsData, RefundsResponseData, RepeatPaymentData, ResponseId, SessionTokenRequestData, SessionTokenResponseData, SetupMandateRequestData, SubmitEvidenceData, WebhookDetailsResponse, }, errors::{ApiError, ApplicationErrorResponse}, mandates::{self, MandateData}, payment_address, payment_address::{Address, AddressDetails, PaymentAddress, PhoneDetails}, payment_method_data, payment_method_data::{ DefaultPCIHolder, PaymentMethodData, PaymentMethodDataTypes, RawCardNumber, VaultTokenHolder, }, router_data::{ AdditionalPaymentMethodConnectorResponse, ConnectorAuthType, ConnectorResponseData,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 25, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_50_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs connector_types::{ AcceptDisputeData, AccessTokenRequestData, ConnectorCustomerData, ConnectorMandateReferenceId, ConnectorResponseHeaders, ContinueRedirectionResponse, DisputeDefendData, DisputeFlowData, DisputeResponseData, DisputeWebhookDetailsResponse, MandateReferenceId, MultipleCaptureRequestData, PaymentCreateOrderData, PaymentCreateOrderResponse, PaymentFlowData, PaymentMethodTokenResponse, PaymentMethodTokenizationData, PaymentVoidData, PaymentsAuthenticateData, PaymentsAuthorizeData, PaymentsCaptureData, PaymentsPostAuthenticateData, PaymentsPreAuthenticateData, PaymentsResponseData, PaymentsSyncData, RawConnectorRequestResponse, RefundFlowData, RefundSyncData, RefundWebhookDetailsResponse, RefundsData, RefundsResponseData, RepeatPaymentData, ResponseId, SessionTokenRequestData, SessionTokenResponseData, SetupMandateRequestData, SubmitEvidenceData, WebhookDetailsResponse, }, errors::{ApiError, ApplicationErrorResponse},
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 50, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_50_30
clm
snippet
// connector-service/backend/domain_types/src/types.rs connector_types::{ AcceptDisputeData, AccessTokenRequestData, ConnectorCustomerData, ConnectorMandateReferenceId, ConnectorResponseHeaders, ContinueRedirectionResponse, DisputeDefendData, DisputeFlowData, DisputeResponseData, DisputeWebhookDetailsResponse, MandateReferenceId, MultipleCaptureRequestData, PaymentCreateOrderData, PaymentCreateOrderResponse, PaymentFlowData, PaymentMethodTokenResponse, PaymentMethodTokenizationData, PaymentVoidData, PaymentsAuthenticateData, PaymentsAuthorizeData, PaymentsCaptureData, PaymentsPostAuthenticateData, PaymentsPreAuthenticateData, PaymentsResponseData, PaymentsSyncData, RawConnectorRequestResponse, RefundFlowData, RefundSyncData, RefundWebhookDetailsResponse, RefundsData, RefundsResponseData, RepeatPaymentData, ResponseId, SessionTokenRequestData, SessionTokenResponseData, SetupMandateRequestData, SubmitEvidenceData, WebhookDetailsResponse, }, errors::{ApiError, ApplicationErrorResponse}, mandates::{self, MandateData}, payment_address, payment_address::{Address, AddressDetails, PaymentAddress, PhoneDetails}, payment_method_data, payment_method_data::{ DefaultPCIHolder, PaymentMethodData, PaymentMethodDataTypes, RawCardNumber, VaultTokenHolder, }, router_data::{ AdditionalPaymentMethodConnectorResponse, ConnectorAuthType, ConnectorResponseData, RecurringMandatePaymentData, }, router_data_v2::RouterDataV2, router_request_types, router_request_types::BrowserInformation,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 50, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_50_50
clm
snippet
// connector-service/backend/domain_types/src/types.rs connector_types::{ AcceptDisputeData, AccessTokenRequestData, ConnectorCustomerData, ConnectorMandateReferenceId, ConnectorResponseHeaders, ContinueRedirectionResponse, DisputeDefendData, DisputeFlowData, DisputeResponseData, DisputeWebhookDetailsResponse, MandateReferenceId, MultipleCaptureRequestData, PaymentCreateOrderData, PaymentCreateOrderResponse, PaymentFlowData, PaymentMethodTokenResponse, PaymentMethodTokenizationData, PaymentVoidData, PaymentsAuthenticateData, PaymentsAuthorizeData, PaymentsCaptureData, PaymentsPostAuthenticateData, PaymentsPreAuthenticateData, PaymentsResponseData, PaymentsSyncData, RawConnectorRequestResponse, RefundFlowData, RefundSyncData, RefundWebhookDetailsResponse, RefundsData, RefundsResponseData, RepeatPaymentData, ResponseId, SessionTokenRequestData, SessionTokenResponseData, SetupMandateRequestData, SubmitEvidenceData, WebhookDetailsResponse, }, errors::{ApiError, ApplicationErrorResponse}, mandates::{self, MandateData}, payment_address, payment_address::{Address, AddressDetails, PaymentAddress, PhoneDetails}, payment_method_data, payment_method_data::{ DefaultPCIHolder, PaymentMethodData, PaymentMethodDataTypes, RawCardNumber, VaultTokenHolder, }, router_data::{ AdditionalPaymentMethodConnectorResponse, ConnectorAuthType, ConnectorResponseData, RecurringMandatePaymentData, }, router_data_v2::RouterDataV2, router_request_types, router_request_types::BrowserInformation, router_response_types, utils::{extract_merchant_id_from_metadata, ForeignFrom, ForeignTryFrom}, }; #[derive(Clone, serde::Deserialize, Debug, Default)] pub struct Connectors { // Added pub pub adyen: ConnectorParams, pub razorpay: ConnectorParams, pub razorpayv2: ConnectorParams, pub fiserv: ConnectorParams, pub elavon: ConnectorParams, // Add your connector params pub xendit: ConnectorParams, pub checkout: ConnectorParams, pub authorizedotnet: ConnectorParams, // Add your connector params pub mifinity: ConnectorParams, pub phonepe: ConnectorParams, pub cashfree: ConnectorParams, pub paytm: ConnectorParams, pub fiuu: ConnectorParams,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 50, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_75_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs RecurringMandatePaymentData, }, router_data_v2::RouterDataV2, router_request_types, router_request_types::BrowserInformation, router_response_types, utils::{extract_merchant_id_from_metadata, ForeignFrom, ForeignTryFrom}, }; #[derive(Clone, serde::Deserialize, Debug, Default)] pub struct Connectors { // Added pub pub adyen: ConnectorParams, pub razorpay: ConnectorParams, pub razorpayv2: ConnectorParams,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 75, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_75_30
clm
snippet
// connector-service/backend/domain_types/src/types.rs RecurringMandatePaymentData, }, router_data_v2::RouterDataV2, router_request_types, router_request_types::BrowserInformation, router_response_types, utils::{extract_merchant_id_from_metadata, ForeignFrom, ForeignTryFrom}, }; #[derive(Clone, serde::Deserialize, Debug, Default)] pub struct Connectors { // Added pub pub adyen: ConnectorParams, pub razorpay: ConnectorParams, pub razorpayv2: ConnectorParams, pub fiserv: ConnectorParams, pub elavon: ConnectorParams, // Add your connector params pub xendit: ConnectorParams, pub checkout: ConnectorParams, pub authorizedotnet: ConnectorParams, // Add your connector params pub mifinity: ConnectorParams, pub phonepe: ConnectorParams, pub cashfree: ConnectorParams, pub paytm: ConnectorParams, pub fiuu: ConnectorParams, pub payu: ConnectorParams, pub cashtocode: ConnectorParams, pub novalnet: ConnectorParams, pub nexinets: ConnectorParams, pub noon: ConnectorParams,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 75, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_75_50
clm
snippet
// connector-service/backend/domain_types/src/types.rs RecurringMandatePaymentData, }, router_data_v2::RouterDataV2, router_request_types, router_request_types::BrowserInformation, router_response_types, utils::{extract_merchant_id_from_metadata, ForeignFrom, ForeignTryFrom}, }; #[derive(Clone, serde::Deserialize, Debug, Default)] pub struct Connectors { // Added pub pub adyen: ConnectorParams, pub razorpay: ConnectorParams, pub razorpayv2: ConnectorParams, pub fiserv: ConnectorParams, pub elavon: ConnectorParams, // Add your connector params pub xendit: ConnectorParams, pub checkout: ConnectorParams, pub authorizedotnet: ConnectorParams, // Add your connector params pub mifinity: ConnectorParams, pub phonepe: ConnectorParams, pub cashfree: ConnectorParams, pub paytm: ConnectorParams, pub fiuu: ConnectorParams, pub payu: ConnectorParams, pub cashtocode: ConnectorParams, pub novalnet: ConnectorParams, pub nexinets: ConnectorParams, pub noon: ConnectorParams, pub braintree: ConnectorParams, pub volt: ConnectorParams, pub bluecode: ConnectorParams, pub cryptopay: ConnectorParams, pub helcim: ConnectorParams, pub dlocal: ConnectorParams, pub placetopay: ConnectorParams, pub rapyd: ConnectorParams, pub aci: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub stripe: ConnectorParams, pub cybersource: ConnectorParams, pub worldpay: ConnectorParams, pub worldpayvantiv: ConnectorParams, pub payload: ConnectorParams, } #[derive(Clone, serde::Deserialize, Debug, Default)] pub struct ConnectorParams { /// base url
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 75, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_100_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs pub payu: ConnectorParams, pub cashtocode: ConnectorParams, pub novalnet: ConnectorParams, pub nexinets: ConnectorParams, pub noon: ConnectorParams, pub braintree: ConnectorParams, pub volt: ConnectorParams, pub bluecode: ConnectorParams, pub cryptopay: ConnectorParams, pub helcim: ConnectorParams, pub dlocal: ConnectorParams, pub placetopay: ConnectorParams, pub rapyd: ConnectorParams, pub aci: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 100, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_100_30
clm
snippet
// connector-service/backend/domain_types/src/types.rs pub payu: ConnectorParams, pub cashtocode: ConnectorParams, pub novalnet: ConnectorParams, pub nexinets: ConnectorParams, pub noon: ConnectorParams, pub braintree: ConnectorParams, pub volt: ConnectorParams, pub bluecode: ConnectorParams, pub cryptopay: ConnectorParams, pub helcim: ConnectorParams, pub dlocal: ConnectorParams, pub placetopay: ConnectorParams, pub rapyd: ConnectorParams, pub aci: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub stripe: ConnectorParams, pub cybersource: ConnectorParams, pub worldpay: ConnectorParams, pub worldpayvantiv: ConnectorParams, pub payload: ConnectorParams, } #[derive(Clone, serde::Deserialize, Debug, Default)] pub struct ConnectorParams { /// base url #[serde(default)] pub base_url: String, #[serde(default)] pub dispute_base_url: Option<String>, #[serde(default)]
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 100, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_100_50
clm
snippet
// connector-service/backend/domain_types/src/types.rs pub payu: ConnectorParams, pub cashtocode: ConnectorParams, pub novalnet: ConnectorParams, pub nexinets: ConnectorParams, pub noon: ConnectorParams, pub braintree: ConnectorParams, pub volt: ConnectorParams, pub bluecode: ConnectorParams, pub cryptopay: ConnectorParams, pub helcim: ConnectorParams, pub dlocal: ConnectorParams, pub placetopay: ConnectorParams, pub rapyd: ConnectorParams, pub aci: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub stripe: ConnectorParams, pub cybersource: ConnectorParams, pub worldpay: ConnectorParams, pub worldpayvantiv: ConnectorParams, pub payload: ConnectorParams, } #[derive(Clone, serde::Deserialize, Debug, Default)] pub struct ConnectorParams { /// base url #[serde(default)] pub base_url: String, #[serde(default)] pub dispute_base_url: Option<String>, #[serde(default)] pub secondary_base_url: Option<String>, } impl ConnectorParams { pub fn new(base_url: String, dispute_base_url: Option<String>) -> Self { Self { base_url, dispute_base_url, secondary_base_url: None, } } } #[derive(Debug, serde::Deserialize, Clone, Default)] pub struct ConnectorParamsWithMoreUrls { /// base url pub base_url: String, /// base url for bank redirects pub base_url_bank_redirects: String, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 100, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_125_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs #[serde(default)] pub base_url: String, #[serde(default)] pub dispute_base_url: Option<String>, #[serde(default)] pub secondary_base_url: Option<String>, } impl ConnectorParams { pub fn new(base_url: String, dispute_base_url: Option<String>) -> Self { Self { base_url, dispute_base_url, secondary_base_url: None, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_125_30
clm
snippet
// connector-service/backend/domain_types/src/types.rs #[serde(default)] pub base_url: String, #[serde(default)] pub dispute_base_url: Option<String>, #[serde(default)] pub secondary_base_url: Option<String>, } impl ConnectorParams { pub fn new(base_url: String, dispute_base_url: Option<String>) -> Self { Self { base_url, dispute_base_url, secondary_base_url: None, } } } #[derive(Debug, serde::Deserialize, Clone, Default)] pub struct ConnectorParamsWithMoreUrls { /// base url pub base_url: String, /// base url for bank redirects pub base_url_bank_redirects: String, } // Trait to provide access to connectors field pub trait HasConnectors { fn connectors(&self) -> &Connectors; }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_125_50
clm
snippet
// connector-service/backend/domain_types/src/types.rs #[serde(default)] pub base_url: String, #[serde(default)] pub dispute_base_url: Option<String>, #[serde(default)] pub secondary_base_url: Option<String>, } impl ConnectorParams { pub fn new(base_url: String, dispute_base_url: Option<String>) -> Self { Self { base_url, dispute_base_url, secondary_base_url: None, } } } #[derive(Debug, serde::Deserialize, Clone, Default)] pub struct ConnectorParamsWithMoreUrls { /// base url pub base_url: String, /// base url for bank redirects pub base_url_bank_redirects: String, } // Trait to provide access to connectors field pub trait HasConnectors { fn connectors(&self) -> &Connectors; } impl HasConnectors for PaymentFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } impl HasConnectors for RefundFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } impl HasConnectors for DisputeFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } #[derive(Debug, serde::Deserialize, Clone)]
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_150_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs // Trait to provide access to connectors field pub trait HasConnectors { fn connectors(&self) -> &Connectors; } impl HasConnectors for PaymentFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } impl HasConnectors for RefundFlowData { fn connectors(&self) -> &Connectors { &self.connectors
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 150, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_150_30
clm
snippet
// connector-service/backend/domain_types/src/types.rs // Trait to provide access to connectors field pub trait HasConnectors { fn connectors(&self) -> &Connectors; } impl HasConnectors for PaymentFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } impl HasConnectors for RefundFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } impl HasConnectors for DisputeFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } #[derive(Debug, serde::Deserialize, Clone)] pub struct Proxy { pub http_url: Option<String>, pub https_url: Option<String>, pub idle_pool_connection_timeout: Option<u64>, pub bypass_proxy_urls: Vec<String>,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 150, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_150_50
clm
snippet
// connector-service/backend/domain_types/src/types.rs // Trait to provide access to connectors field pub trait HasConnectors { fn connectors(&self) -> &Connectors; } impl HasConnectors for PaymentFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } impl HasConnectors for RefundFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } impl HasConnectors for DisputeFlowData { fn connectors(&self) -> &Connectors { &self.connectors } } #[derive(Debug, serde::Deserialize, Clone)] pub struct Proxy { pub http_url: Option<String>, pub https_url: Option<String>, pub idle_pool_connection_timeout: Option<u64>, pub bypass_proxy_urls: Vec<String>, pub mitm_proxy_enabled: bool, pub mitm_ca_cert: Option<String>, } impl ForeignTryFrom<grpc_api_types::payments::CaptureMethod> for common_enums::CaptureMethod { type Error = ApplicationErrorResponse; fn foreign_try_from( value: grpc_api_types::payments::CaptureMethod, ) -> Result<Self, error_stack::Report<Self::Error>> { match value { grpc_api_types::payments::CaptureMethod::Automatic => Ok(Self::Automatic), grpc_api_types::payments::CaptureMethod::Manual => Ok(Self::Manual), grpc_api_types::payments::CaptureMethod::ManualMultiple => Ok(Self::ManualMultiple), grpc_api_types::payments::CaptureMethod::Scheduled => Ok(Self::Scheduled), _ => Ok(Self::Automatic), } } }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 150, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_175_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs pub struct Proxy { pub http_url: Option<String>, pub https_url: Option<String>, pub idle_pool_connection_timeout: Option<u64>, pub bypass_proxy_urls: Vec<String>, pub mitm_proxy_enabled: bool, pub mitm_ca_cert: Option<String>, } impl ForeignTryFrom<grpc_api_types::payments::CaptureMethod> for common_enums::CaptureMethod { type Error = ApplicationErrorResponse; fn foreign_try_from( value: grpc_api_types::payments::CaptureMethod, ) -> Result<Self, error_stack::Report<Self::Error>> {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_175_30
clm
snippet
// connector-service/backend/domain_types/src/types.rs pub struct Proxy { pub http_url: Option<String>, pub https_url: Option<String>, pub idle_pool_connection_timeout: Option<u64>, pub bypass_proxy_urls: Vec<String>, pub mitm_proxy_enabled: bool, pub mitm_ca_cert: Option<String>, } impl ForeignTryFrom<grpc_api_types::payments::CaptureMethod> for common_enums::CaptureMethod { type Error = ApplicationErrorResponse; fn foreign_try_from( value: grpc_api_types::payments::CaptureMethod, ) -> Result<Self, error_stack::Report<Self::Error>> { match value { grpc_api_types::payments::CaptureMethod::Automatic => Ok(Self::Automatic), grpc_api_types::payments::CaptureMethod::Manual => Ok(Self::Manual), grpc_api_types::payments::CaptureMethod::ManualMultiple => Ok(Self::ManualMultiple), grpc_api_types::payments::CaptureMethod::Scheduled => Ok(Self::Scheduled), _ => Ok(Self::Automatic), } } } impl ForeignTryFrom<grpc_api_types::payments::CardNetwork> for common_enums::CardNetwork { type Error = ApplicationErrorResponse; fn foreign_try_from( network: grpc_api_types::payments::CardNetwork,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_175_50
clm
snippet
// connector-service/backend/domain_types/src/types.rs pub struct Proxy { pub http_url: Option<String>, pub https_url: Option<String>, pub idle_pool_connection_timeout: Option<u64>, pub bypass_proxy_urls: Vec<String>, pub mitm_proxy_enabled: bool, pub mitm_ca_cert: Option<String>, } impl ForeignTryFrom<grpc_api_types::payments::CaptureMethod> for common_enums::CaptureMethod { type Error = ApplicationErrorResponse; fn foreign_try_from( value: grpc_api_types::payments::CaptureMethod, ) -> Result<Self, error_stack::Report<Self::Error>> { match value { grpc_api_types::payments::CaptureMethod::Automatic => Ok(Self::Automatic), grpc_api_types::payments::CaptureMethod::Manual => Ok(Self::Manual), grpc_api_types::payments::CaptureMethod::ManualMultiple => Ok(Self::ManualMultiple), grpc_api_types::payments::CaptureMethod::Scheduled => Ok(Self::Scheduled), _ => Ok(Self::Automatic), } } } impl ForeignTryFrom<grpc_api_types::payments::CardNetwork> for common_enums::CardNetwork { type Error = ApplicationErrorResponse; fn foreign_try_from( network: grpc_api_types::payments::CardNetwork, ) -> Result<Self, error_stack::Report<Self::Error>> { match network { grpc_api_types::payments::CardNetwork::Visa => Ok(Self::Visa), grpc_api_types::payments::CardNetwork::Mastercard => Ok(Self::Mastercard), grpc_api_types::payments::CardNetwork::Amex => Ok(Self::AmericanExpress), grpc_api_types::payments::CardNetwork::Jcb => Ok(Self::JCB), grpc_api_types::payments::CardNetwork::Diners => Ok(Self::DinersClub), grpc_api_types::payments::CardNetwork::Discover => Ok(Self::Discover), grpc_api_types::payments::CardNetwork::CartesBancaires => Ok(Self::CartesBancaires), grpc_api_types::payments::CardNetwork::Unionpay => Ok(Self::UnionPay), grpc_api_types::payments::CardNetwork::Rupay => Ok(Self::RuPay), grpc_api_types::payments::CardNetwork::Maestro => Ok(Self::Maestro), grpc_api_types::payments::CardNetwork::Unspecified => { Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "UNSPECIFIED_CARD_NETWORK".to_owned(), error_identifier: 401, error_message: "Card network must be specified".to_owned(), error_object: None, }) .into())
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_200_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs impl ForeignTryFrom<grpc_api_types::payments::CardNetwork> for common_enums::CardNetwork { type Error = ApplicationErrorResponse; fn foreign_try_from( network: grpc_api_types::payments::CardNetwork, ) -> Result<Self, error_stack::Report<Self::Error>> { match network { grpc_api_types::payments::CardNetwork::Visa => Ok(Self::Visa), grpc_api_types::payments::CardNetwork::Mastercard => Ok(Self::Mastercard), grpc_api_types::payments::CardNetwork::Amex => Ok(Self::AmericanExpress), grpc_api_types::payments::CardNetwork::Jcb => Ok(Self::JCB), grpc_api_types::payments::CardNetwork::Diners => Ok(Self::DinersClub), grpc_api_types::payments::CardNetwork::Discover => Ok(Self::Discover), grpc_api_types::payments::CardNetwork::CartesBancaires => Ok(Self::CartesBancaires), grpc_api_types::payments::CardNetwork::Unionpay => Ok(Self::UnionPay),
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_200_30
clm
snippet
// connector-service/backend/domain_types/src/types.rs impl ForeignTryFrom<grpc_api_types::payments::CardNetwork> for common_enums::CardNetwork { type Error = ApplicationErrorResponse; fn foreign_try_from( network: grpc_api_types::payments::CardNetwork, ) -> Result<Self, error_stack::Report<Self::Error>> { match network { grpc_api_types::payments::CardNetwork::Visa => Ok(Self::Visa), grpc_api_types::payments::CardNetwork::Mastercard => Ok(Self::Mastercard), grpc_api_types::payments::CardNetwork::Amex => Ok(Self::AmericanExpress), grpc_api_types::payments::CardNetwork::Jcb => Ok(Self::JCB), grpc_api_types::payments::CardNetwork::Diners => Ok(Self::DinersClub), grpc_api_types::payments::CardNetwork::Discover => Ok(Self::Discover), grpc_api_types::payments::CardNetwork::CartesBancaires => Ok(Self::CartesBancaires), grpc_api_types::payments::CardNetwork::Unionpay => Ok(Self::UnionPay), grpc_api_types::payments::CardNetwork::Rupay => Ok(Self::RuPay), grpc_api_types::payments::CardNetwork::Maestro => Ok(Self::Maestro), grpc_api_types::payments::CardNetwork::Unspecified => { Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "UNSPECIFIED_CARD_NETWORK".to_owned(), error_identifier: 401, error_message: "Card network must be specified".to_owned(), error_object: None, }) .into()) } } } }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_200_50
clm
snippet
// connector-service/backend/domain_types/src/types.rs impl ForeignTryFrom<grpc_api_types::payments::CardNetwork> for common_enums::CardNetwork { type Error = ApplicationErrorResponse; fn foreign_try_from( network: grpc_api_types::payments::CardNetwork, ) -> Result<Self, error_stack::Report<Self::Error>> { match network { grpc_api_types::payments::CardNetwork::Visa => Ok(Self::Visa), grpc_api_types::payments::CardNetwork::Mastercard => Ok(Self::Mastercard), grpc_api_types::payments::CardNetwork::Amex => Ok(Self::AmericanExpress), grpc_api_types::payments::CardNetwork::Jcb => Ok(Self::JCB), grpc_api_types::payments::CardNetwork::Diners => Ok(Self::DinersClub), grpc_api_types::payments::CardNetwork::Discover => Ok(Self::Discover), grpc_api_types::payments::CardNetwork::CartesBancaires => Ok(Self::CartesBancaires), grpc_api_types::payments::CardNetwork::Unionpay => Ok(Self::UnionPay), grpc_api_types::payments::CardNetwork::Rupay => Ok(Self::RuPay), grpc_api_types::payments::CardNetwork::Maestro => Ok(Self::Maestro), grpc_api_types::payments::CardNetwork::Unspecified => { Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "UNSPECIFIED_CARD_NETWORK".to_owned(), error_identifier: 401, error_message: "Card network must be specified".to_owned(), error_object: None, }) .into()) } } } } impl< T: PaymentMethodDataTypes + Default + Debug + Send + Eq + PartialEq + serde::Serialize + serde::de::DeserializeOwned + Clone + CardConversionHelper<T>, > ForeignTryFrom<grpc_api_types::payments::PaymentMethod> for PaymentMethodData<T> { type Error = ApplicationErrorResponse; fn foreign_try_from( value: grpc_api_types::payments::PaymentMethod, ) -> Result<Self, error_stack::Report<Self::Error>> { tracing::info!("PaymentMethod data received: {:?}", value); match value.payment_method {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7881285798716424113_225_15
clm
snippet
// connector-service/backend/domain_types/src/types.rs } } } } impl< T: PaymentMethodDataTypes + Default + Debug + Send + Eq + PartialEq + serde::Serialize + serde::de::DeserializeOwned + Clone
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 225, "struct_name": null, "total_crates": null, "trait_name": null }