id
stringlengths
20
153
type
stringclasses
1 value
granularity
stringclasses
14 values
content
stringlengths
16
84.3k
metadata
dict
connector-service_snippet_-2910212303359634675_900_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs impl TryFrom<&RouterDataV2<PSync, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>> for SyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( router_data: &RouterDataV2<PSync, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>, ) -> Result<Self, Self::Error> { let request_data = &router_data.request; let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; let connector_txn_id = match &request_data.connector_transaction_id { DomainResponseId::ConnectorTransactionId(id) => id.clone(), _ => { return Err(report!( errors::ConnectorError::MissingConnectorTransactionID )) .attach_printable("Missing connector_transaction_id for Elavon PSync") } }; Ok(Self { ssl_transaction_type: TransactionType::TxnQuery, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id, ssl_pin: auth_type.ssl_pin, ssl_txn_id: connector_txn_id, }) } } #[skip_serializing_none] #[derive(Debug, Serialize)] pub struct ElavonCaptureRequest { pub ssl_transaction_type: TransactionType, pub ssl_account_id: Secret<String>, pub ssl_user_id: Secret<String>, pub ssl_pin: Secret<String>, pub ssl_amount: StringMajorUnit, pub ssl_txn_id: String, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_925_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs ssl_pin: auth_type.ssl_pin, ssl_txn_id: connector_txn_id, }) } } #[skip_serializing_none] #[derive(Debug, Serialize)] pub struct ElavonCaptureRequest { pub ssl_transaction_type: TransactionType, pub ssl_account_id: Secret<String>, pub ssl_user_id: Secret<String>, pub ssl_pin: Secret<String>, pub ssl_amount: StringMajorUnit, pub ssl_txn_id: String,
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_925_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs ssl_pin: auth_type.ssl_pin, ssl_txn_id: connector_txn_id, }) } } #[skip_serializing_none] #[derive(Debug, Serialize)] pub struct ElavonCaptureRequest { pub ssl_transaction_type: TransactionType, pub ssl_account_id: Secret<String>, pub ssl_user_id: Secret<String>, pub ssl_pin: Secret<String>, pub ssl_amount: StringMajorUnit, pub ssl_txn_id: String, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >,
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_925_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs ssl_pin: auth_type.ssl_pin, ssl_txn_id: connector_txn_id, }) } } #[skip_serializing_none] #[derive(Debug, Serialize)] pub struct ElavonCaptureRequest { pub ssl_transaction_type: TransactionType, pub ssl_account_id: Secret<String>, pub ssl_user_id: Secret<String>, pub ssl_pin: Secret<String>, pub ssl_amount: StringMajorUnit, pub ssl_txn_id: String, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for ElavonCaptureRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { let router_data = item.router_data; let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; let previous_connector_txn_id = match &router_data.request.connector_transaction_id { DomainResponseId::ConnectorTransactionId(id) => id.clone(), _ => { return Err(report!( errors::ConnectorError::MissingConnectorTransactionID )) }
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_950_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs TryFrom< ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for ElavonCaptureRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> {
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_950_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs TryFrom< ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for ElavonCaptureRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { let router_data = item.router_data; let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; let previous_connector_txn_id = match &router_data.request.connector_transaction_id { DomainResponseId::ConnectorTransactionId(id) => id.clone(), _ => { return Err(report!( errors::ConnectorError::MissingConnectorTransactionID )) } }; // Convert amount for capture let amount_converter = StringMajorUnitForConnector; let amount = amount_converter
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_950_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs TryFrom< ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for ElavonCaptureRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { let router_data = item.router_data; let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; let previous_connector_txn_id = match &router_data.request.connector_transaction_id { DomainResponseId::ConnectorTransactionId(id) => id.clone(), _ => { return Err(report!( errors::ConnectorError::MissingConnectorTransactionID )) } }; // Convert amount for capture let amount_converter = StringMajorUnitForConnector; let amount = amount_converter .convert( router_data.request.minor_amount_to_capture, router_data.request.currency, ) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { ssl_transaction_type: TransactionType::CcComplete, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id, ssl_pin: auth_type.ssl_pin, ssl_amount: amount, ssl_txn_id: previous_connector_txn_id, }) } } // Implementation for XMLCaptureRequest impl< T: PaymentMethodDataTypes
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_975_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs }; // Convert amount for capture let amount_converter = StringMajorUnitForConnector; let amount = amount_converter .convert( router_data.request.minor_amount_to_capture, router_data.request.currency, ) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { ssl_transaction_type: TransactionType::CcComplete, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id,
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_975_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs }; // Convert amount for capture let amount_converter = StringMajorUnitForConnector; let amount = amount_converter .convert( router_data.request.minor_amount_to_capture, router_data.request.currency, ) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { ssl_transaction_type: TransactionType::CcComplete, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id, ssl_pin: auth_type.ssl_pin, ssl_amount: amount, ssl_txn_id: previous_connector_txn_id, }) } } // Implementation for XMLCaptureRequest impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize,
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_975_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs }; // Convert amount for capture let amount_converter = StringMajorUnitForConnector; let amount = amount_converter .convert( router_data.request.minor_amount_to_capture, router_data.request.currency, ) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { ssl_transaction_type: TransactionType::CcComplete, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id, ssl_pin: auth_type.ssl_pin, ssl_amount: amount, ssl_txn_id: previous_connector_txn_id, }) } } // Implementation for XMLCaptureRequest impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for XMLCaptureRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( data: ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the ElavonCaptureRequest let request = ElavonCaptureRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create ElavonCaptureRequest")?;
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_1000_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for XMLCaptureRequest { type Error = error_stack::Report<errors::ConnectorError>;
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_1000_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for XMLCaptureRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( data: ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the ElavonCaptureRequest let request = ElavonCaptureRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create ElavonCaptureRequest")?; // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?;
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_1000_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for XMLCaptureRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( data: ElavonRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the ElavonCaptureRequest let request = ElavonCaptureRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create ElavonCaptureRequest")?; // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLCaptureRequest(result)) } } // Response handling for Capture flow impl<F> TryFrom<ResponseRouterData<ElavonCaptureResponse, Self>> for RouterDataV2<F, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( value: ResponseRouterData<ElavonCaptureResponse, Self>, ) -> Result<Self, Self::Error> {
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_1025_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLCaptureRequest(result)) } }
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_1025_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLCaptureRequest(result)) } } // Response handling for Capture flow impl<F> TryFrom<ResponseRouterData<ElavonCaptureResponse, Self>> for RouterDataV2<F, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( value: ResponseRouterData<ElavonCaptureResponse, Self>, ) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code, } = value;
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_1025_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLCaptureRequest(result)) } } // Response handling for Capture flow impl<F> TryFrom<ResponseRouterData<ElavonCaptureResponse, Self>> for RouterDataV2<F, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( value: ResponseRouterData<ElavonCaptureResponse, Self>, ) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code, } = value; let (attempt_status, error_response) = get_elavon_attempt_status(&response.result, http_code); // Determine final status based on the transaction type let final_status = match &response.result { ElavonResult::Success(success_payload) => { match success_payload.ssl_transaction_type.as_deref() { Some("cccomplete") | Some("ccsale") => match success_payload.ssl_result { SslResult::Approved => HyperswitchAttemptStatus::Charged, _ => HyperswitchAttemptStatus::Failure, }, _ => attempt_status, } } _ => attempt_status, }; // Build the response data let response_data = match (&response.result, error_response) {
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_1050_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs let ResponseRouterData { response, router_data, http_code, } = value; let (attempt_status, error_response) = get_elavon_attempt_status(&response.result, http_code); // Determine final status based on the transaction type let final_status = match &response.result { ElavonResult::Success(success_payload) => { match success_payload.ssl_transaction_type.as_deref() { Some("cccomplete") | Some("ccsale") => match success_payload.ssl_result { SslResult::Approved => HyperswitchAttemptStatus::Charged,
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_1050_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs let ResponseRouterData { response, router_data, http_code, } = value; let (attempt_status, error_response) = get_elavon_attempt_status(&response.result, http_code); // Determine final status based on the transaction type let final_status = match &response.result { ElavonResult::Success(success_payload) => { match success_payload.ssl_transaction_type.as_deref() { Some("cccomplete") | Some("ccsale") => match success_payload.ssl_result { SslResult::Approved => HyperswitchAttemptStatus::Charged, _ => HyperswitchAttemptStatus::Failure, }, _ => attempt_status, } } _ => attempt_status, }; // Build the response data let response_data = match (&response.result, error_response) { (ElavonResult::Success(payment_resp_struct), None) => { Ok(PaymentsResponseData::TransactionResponse { resource_id: DomainResponseId::ConnectorTransactionId( payment_resp_struct.ssl_txn_id.clone(), ),
{ "chunk": null, "crate": "connector-integration", "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_-2910212303359634675_1050_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs let ResponseRouterData { response, router_data, http_code, } = value; let (attempt_status, error_response) = get_elavon_attempt_status(&response.result, http_code); // Determine final status based on the transaction type let final_status = match &response.result { ElavonResult::Success(success_payload) => { match success_payload.ssl_transaction_type.as_deref() { Some("cccomplete") | Some("ccsale") => match success_payload.ssl_result { SslResult::Approved => HyperswitchAttemptStatus::Charged, _ => HyperswitchAttemptStatus::Failure, }, _ => attempt_status, } } _ => attempt_status, }; // Build the response data let response_data = match (&response.result, error_response) { (ElavonResult::Success(payment_resp_struct), None) => { Ok(PaymentsResponseData::TransactionResponse { resource_id: DomainResponseId::ConnectorTransactionId( payment_resp_struct.ssl_txn_id.clone(), ), redirection_data: None, connector_metadata: Some( serde_json::to_value(payment_resp_struct.clone()) .unwrap_or(serde_json::Value::Null), ), network_txn_id: None, connector_response_reference_id: payment_resp_struct.ssl_approval_code.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: http_code, }) } (_, Some(err_resp)) => Err(err_resp), (ElavonResult::Error(error_payload), None) => Err(ErrorResponse { status_code: http_code, code: error_payload .error_code .clone() .unwrap_or_else(|| NO_ERROR_CODE.to_string()), message: error_payload.error_message.clone(),
{ "chunk": null, "crate": "connector-integration", "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": 1050, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1075_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs (ElavonResult::Success(payment_resp_struct), None) => { Ok(PaymentsResponseData::TransactionResponse { resource_id: DomainResponseId::ConnectorTransactionId( payment_resp_struct.ssl_txn_id.clone(), ), redirection_data: None, connector_metadata: Some( serde_json::to_value(payment_resp_struct.clone()) .unwrap_or(serde_json::Value::Null), ), network_txn_id: None, connector_response_reference_id: payment_resp_struct.ssl_approval_code.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: http_code,
{ "chunk": null, "crate": "connector-integration", "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": 1075, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1075_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs (ElavonResult::Success(payment_resp_struct), None) => { Ok(PaymentsResponseData::TransactionResponse { resource_id: DomainResponseId::ConnectorTransactionId( payment_resp_struct.ssl_txn_id.clone(), ), redirection_data: None, connector_metadata: Some( serde_json::to_value(payment_resp_struct.clone()) .unwrap_or(serde_json::Value::Null), ), network_txn_id: None, connector_response_reference_id: payment_resp_struct.ssl_approval_code.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: http_code, }) } (_, Some(err_resp)) => Err(err_resp), (ElavonResult::Error(error_payload), None) => Err(ErrorResponse { status_code: http_code, code: error_payload .error_code .clone() .unwrap_or_else(|| NO_ERROR_CODE.to_string()), message: error_payload.error_message.clone(), reason: error_payload.error_name.clone(), attempt_status: Some(HyperswitchAttemptStatus::Failure), connector_transaction_id: error_payload.ssl_txn_id.clone(), network_decline_code: None, network_advice_code: None,
{ "chunk": null, "crate": "connector-integration", "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": 1075, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1075_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs (ElavonResult::Success(payment_resp_struct), None) => { Ok(PaymentsResponseData::TransactionResponse { resource_id: DomainResponseId::ConnectorTransactionId( payment_resp_struct.ssl_txn_id.clone(), ), redirection_data: None, connector_metadata: Some( serde_json::to_value(payment_resp_struct.clone()) .unwrap_or(serde_json::Value::Null), ), network_txn_id: None, connector_response_reference_id: payment_resp_struct.ssl_approval_code.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: http_code, }) } (_, Some(err_resp)) => Err(err_resp), (ElavonResult::Error(error_payload), None) => Err(ErrorResponse { status_code: http_code, code: error_payload .error_code .clone() .unwrap_or_else(|| NO_ERROR_CODE.to_string()), message: error_payload.error_message.clone(), reason: error_payload.error_name.clone(), attempt_status: Some(HyperswitchAttemptStatus::Failure), connector_transaction_id: error_payload.ssl_txn_id.clone(), network_decline_code: None, network_advice_code: None, network_error_message: None, }), }; Ok(Self { response: response_data, resource_common_data: PaymentFlowData { status: final_status, ..router_data.resource_common_data }, ..router_data }) } } // Implementation for Refund #[skip_serializing_none] #[derive(Debug, Serialize)] pub struct ElavonRefundRequest { pub ssl_transaction_type: TransactionType,
{ "chunk": null, "crate": "connector-integration", "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": 1075, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1100_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs reason: error_payload.error_name.clone(), attempt_status: Some(HyperswitchAttemptStatus::Failure), connector_transaction_id: error_payload.ssl_txn_id.clone(), network_decline_code: None, network_advice_code: None, network_error_message: None, }), }; Ok(Self { response: response_data, resource_common_data: PaymentFlowData { status: final_status, ..router_data.resource_common_data },
{ "chunk": null, "crate": "connector-integration", "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": 1100, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1100_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs reason: error_payload.error_name.clone(), attempt_status: Some(HyperswitchAttemptStatus::Failure), connector_transaction_id: error_payload.ssl_txn_id.clone(), network_decline_code: None, network_advice_code: None, network_error_message: None, }), }; Ok(Self { response: response_data, resource_common_data: PaymentFlowData { status: final_status, ..router_data.resource_common_data }, ..router_data }) } } // Implementation for Refund #[skip_serializing_none] #[derive(Debug, Serialize)] pub struct ElavonRefundRequest { pub ssl_transaction_type: TransactionType, pub ssl_account_id: Secret<String>, pub ssl_user_id: Secret<String>, pub ssl_pin: Secret<String>, pub ssl_amount: StringMajorUnit, pub ssl_txn_id: String,
{ "chunk": null, "crate": "connector-integration", "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": 1100, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1100_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs reason: error_payload.error_name.clone(), attempt_status: Some(HyperswitchAttemptStatus::Failure), connector_transaction_id: error_payload.ssl_txn_id.clone(), network_decline_code: None, network_advice_code: None, network_error_message: None, }), }; Ok(Self { response: response_data, resource_common_data: PaymentFlowData { status: final_status, ..router_data.resource_common_data }, ..router_data }) } } // Implementation for Refund #[skip_serializing_none] #[derive(Debug, Serialize)] pub struct ElavonRefundRequest { pub ssl_transaction_type: TransactionType, pub ssl_account_id: Secret<String>, pub ssl_user_id: Secret<String>, pub ssl_pin: Secret<String>, pub ssl_amount: StringMajorUnit, pub ssl_txn_id: String, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for ElavonRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: ElavonRouterData< RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T,
{ "chunk": null, "crate": "connector-integration", "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": 1100, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1125_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs pub ssl_account_id: Secret<String>, pub ssl_user_id: Secret<String>, pub ssl_pin: Secret<String>, pub ssl_amount: StringMajorUnit, pub ssl_txn_id: String, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >
{ "chunk": null, "crate": "connector-integration", "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": 1125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1125_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs pub ssl_account_id: Secret<String>, pub ssl_user_id: Secret<String>, pub ssl_pin: Secret<String>, pub ssl_amount: StringMajorUnit, pub ssl_txn_id: String, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for ElavonRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: ElavonRouterData< RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { let router_data = item.router_data; let request_data = &router_data.request; let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?;
{ "chunk": null, "crate": "connector-integration", "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": 1125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1125_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs pub ssl_account_id: Secret<String>, pub ssl_user_id: Secret<String>, pub ssl_pin: Secret<String>, pub ssl_amount: StringMajorUnit, pub ssl_txn_id: String, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for ElavonRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: ElavonRouterData< RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { let router_data = item.router_data; let request_data = &router_data.request; let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; // Convert amount for refund let amount_converter = StringMajorUnitForConnector; let amount = amount_converter .convert(request_data.minor_refund_amount, request_data.currency) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { ssl_transaction_type: TransactionType::CcReturn, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id, ssl_pin: auth_type.ssl_pin, ssl_amount: amount, ssl_txn_id: request_data.connector_transaction_id.clone(), }) } } // Implementation for XMLRefundRequest impl<
{ "chunk": null, "crate": "connector-integration", "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": 1125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1150_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs >, ) -> Result<Self, Self::Error> { let router_data = item.router_data; let request_data = &router_data.request; let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; // Convert amount for refund let amount_converter = StringMajorUnitForConnector; let amount = amount_converter .convert(request_data.minor_refund_amount, request_data.currency) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { ssl_transaction_type: TransactionType::CcReturn, ssl_account_id: auth_type.ssl_merchant_id,
{ "chunk": null, "crate": "connector-integration", "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": 1150, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1150_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs >, ) -> Result<Self, Self::Error> { let router_data = item.router_data; let request_data = &router_data.request; let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; // Convert amount for refund let amount_converter = StringMajorUnitForConnector; let amount = amount_converter .convert(request_data.minor_refund_amount, request_data.currency) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { ssl_transaction_type: TransactionType::CcReturn, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id, ssl_pin: auth_type.ssl_pin, ssl_amount: amount, ssl_txn_id: request_data.connector_transaction_id.clone(), }) } } // Implementation for XMLRefundRequest impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static
{ "chunk": null, "crate": "connector-integration", "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": 1150, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1150_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs >, ) -> Result<Self, Self::Error> { let router_data = item.router_data; let request_data = &router_data.request; let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; // Convert amount for refund let amount_converter = StringMajorUnitForConnector; let amount = amount_converter .convert(request_data.minor_refund_amount, request_data.currency) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { ssl_transaction_type: TransactionType::CcReturn, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id, ssl_pin: auth_type.ssl_pin, ssl_amount: amount, ssl_txn_id: request_data.connector_transaction_id.clone(), }) } } // Implementation for XMLRefundRequest impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for XMLRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( data: ElavonRouterData< RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the ElavonRefundRequest let request = ElavonRefundRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create ElavonRefundRequest")?; // Generate XML content
{ "chunk": null, "crate": "connector-integration", "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": 1150, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1175_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for XMLRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( data: ElavonRouterData<
{ "chunk": null, "crate": "connector-integration", "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": 1175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1175_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for XMLRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( data: ElavonRouterData< RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the ElavonRefundRequest let request = ElavonRefundRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create ElavonRefundRequest")?; // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new();
{ "chunk": null, "crate": "connector-integration", "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": 1175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1175_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for XMLRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( data: ElavonRouterData< RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the ElavonRefundRequest let request = ElavonRefundRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create ElavonRefundRequest")?; // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLRefundRequest(result)) } } // Response handling for Refund flow impl<F> TryFrom<ResponseRouterData<ElavonRefundResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( value: ResponseRouterData<ElavonRefundResponse, Self>, ) -> Result<Self, Self::Error> { let ResponseRouterData { response,
{ "chunk": null, "crate": "connector-integration", "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": 1175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1200_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLRefundRequest(result)) } } // Response handling for Refund flow
{ "chunk": null, "crate": "connector-integration", "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": 1200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1200_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLRefundRequest(result)) } } // Response handling for Refund flow impl<F> TryFrom<ResponseRouterData<ElavonRefundResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( value: ResponseRouterData<ElavonRefundResponse, Self>, ) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code, } = value; let (attempt_status, error_response) =
{ "chunk": null, "crate": "connector-integration", "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": 1200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1200_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLRefundRequest(result)) } } // Response handling for Refund flow impl<F> TryFrom<ResponseRouterData<ElavonRefundResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( value: ResponseRouterData<ElavonRefundResponse, Self>, ) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code, } = value; let (attempt_status, error_response) = get_elavon_attempt_status(&response.result, http_code); // Determine refund status let refund_status = match &response.result { ElavonResult::Success(success_payload) => { match success_payload.ssl_transaction_type.as_deref() { Some("RETURN") => match success_payload.ssl_result { SslResult::Approved => common_enums::RefundStatus::Success, SslResult::Declined => common_enums::RefundStatus::Failure, SslResult::Other(_) => common_enums::RefundStatus::Pending, }, _ => common_enums::RefundStatus::Pending, } } _ => common_enums::RefundStatus::Failure, }; // Build the response data let response_data = match (&response.result, error_response) { (ElavonResult::Success(payment_resp_struct), None) => Ok(RefundsResponseData {
{ "chunk": null, "crate": "connector-integration", "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": 1200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1225_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs router_data, http_code, } = value; let (attempt_status, error_response) = get_elavon_attempt_status(&response.result, http_code); // Determine refund status let refund_status = match &response.result { ElavonResult::Success(success_payload) => { match success_payload.ssl_transaction_type.as_deref() { Some("RETURN") => match success_payload.ssl_result { SslResult::Approved => common_enums::RefundStatus::Success, SslResult::Declined => common_enums::RefundStatus::Failure, SslResult::Other(_) => common_enums::RefundStatus::Pending,
{ "chunk": null, "crate": "connector-integration", "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": 1225, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1225_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs router_data, http_code, } = value; let (attempt_status, error_response) = get_elavon_attempt_status(&response.result, http_code); // Determine refund status let refund_status = match &response.result { ElavonResult::Success(success_payload) => { match success_payload.ssl_transaction_type.as_deref() { Some("RETURN") => match success_payload.ssl_result { SslResult::Approved => common_enums::RefundStatus::Success, SslResult::Declined => common_enums::RefundStatus::Failure, SslResult::Other(_) => common_enums::RefundStatus::Pending, }, _ => common_enums::RefundStatus::Pending, } } _ => common_enums::RefundStatus::Failure, }; // Build the response data let response_data = match (&response.result, error_response) { (ElavonResult::Success(payment_resp_struct), None) => Ok(RefundsResponseData { connector_refund_id: payment_resp_struct.ssl_txn_id.clone(), refund_status, status_code: http_code, }), (_, Some(err_resp)) => Err(err_resp),
{ "chunk": null, "crate": "connector-integration", "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": 1225, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1225_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs router_data, http_code, } = value; let (attempt_status, error_response) = get_elavon_attempt_status(&response.result, http_code); // Determine refund status let refund_status = match &response.result { ElavonResult::Success(success_payload) => { match success_payload.ssl_transaction_type.as_deref() { Some("RETURN") => match success_payload.ssl_result { SslResult::Approved => common_enums::RefundStatus::Success, SslResult::Declined => common_enums::RefundStatus::Failure, SslResult::Other(_) => common_enums::RefundStatus::Pending, }, _ => common_enums::RefundStatus::Pending, } } _ => common_enums::RefundStatus::Failure, }; // Build the response data let response_data = match (&response.result, error_response) { (ElavonResult::Success(payment_resp_struct), None) => Ok(RefundsResponseData { connector_refund_id: payment_resp_struct.ssl_txn_id.clone(), refund_status, status_code: http_code, }), (_, Some(err_resp)) => Err(err_resp), (ElavonResult::Error(error_payload), None) => Err(ErrorResponse { status_code: http_code, code: error_payload .error_code .clone() .unwrap_or_else(|| NO_ERROR_CODE.to_string()), message: error_payload.error_message.clone(), reason: error_payload.error_name.clone(), attempt_status: Some(attempt_status), connector_transaction_id: error_payload.ssl_txn_id.clone(), network_decline_code: None, network_advice_code: None, network_error_message: None, }), }; Ok(Self { response: response_data, resource_common_data: RefundFlowData { status: refund_status,
{ "chunk": null, "crate": "connector-integration", "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": 1225, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1250_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs connector_refund_id: payment_resp_struct.ssl_txn_id.clone(), refund_status, status_code: http_code, }), (_, Some(err_resp)) => Err(err_resp), (ElavonResult::Error(error_payload), None) => Err(ErrorResponse { status_code: http_code, code: error_payload .error_code .clone() .unwrap_or_else(|| NO_ERROR_CODE.to_string()), message: error_payload.error_message.clone(), reason: error_payload.error_name.clone(), attempt_status: Some(attempt_status), connector_transaction_id: error_payload.ssl_txn_id.clone(),
{ "chunk": null, "crate": "connector-integration", "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": 1250, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1250_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs connector_refund_id: payment_resp_struct.ssl_txn_id.clone(), refund_status, status_code: http_code, }), (_, Some(err_resp)) => Err(err_resp), (ElavonResult::Error(error_payload), None) => Err(ErrorResponse { status_code: http_code, code: error_payload .error_code .clone() .unwrap_or_else(|| NO_ERROR_CODE.to_string()), message: error_payload.error_message.clone(), reason: error_payload.error_name.clone(), attempt_status: Some(attempt_status), connector_transaction_id: error_payload.ssl_txn_id.clone(), network_decline_code: None, network_advice_code: None, network_error_message: None, }), }; Ok(Self { response: response_data, resource_common_data: RefundFlowData { status: refund_status, ..router_data.resource_common_data }, ..router_data }) }
{ "chunk": null, "crate": "connector-integration", "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": 1250, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1250_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs connector_refund_id: payment_resp_struct.ssl_txn_id.clone(), refund_status, status_code: http_code, }), (_, Some(err_resp)) => Err(err_resp), (ElavonResult::Error(error_payload), None) => Err(ErrorResponse { status_code: http_code, code: error_payload .error_code .clone() .unwrap_or_else(|| NO_ERROR_CODE.to_string()), message: error_payload.error_message.clone(), reason: error_payload.error_name.clone(), attempt_status: Some(attempt_status), connector_transaction_id: error_payload.ssl_txn_id.clone(), network_decline_code: None, network_advice_code: None, network_error_message: None, }), }; Ok(Self { response: response_data, resource_common_data: RefundFlowData { status: refund_status, ..router_data.resource_common_data }, ..router_data }) } } // Implementation for Refund Sync impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, > for SyncRequest { type Error = error_stack::Report<errors::ConnectorError>;
{ "chunk": null, "crate": "connector-integration", "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": 1250, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1275_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs ..router_data.resource_common_data }, ..router_data }) } } // Implementation for Refund Sync impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize,
{ "chunk": null, "crate": "connector-integration", "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": 1275, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1275_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs ..router_data.resource_common_data }, ..router_data }) } } // Implementation for Refund Sync impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, > for SyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >,
{ "chunk": null, "crate": "connector-integration", "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": 1275, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1275_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs ..router_data.resource_common_data }, ..router_data }) } } // Implementation for Refund Sync impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, > for SyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { Self::try_from(&item.router_data) } } impl TryFrom<&RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>> for SyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( router_data: &RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, ) -> Result<Self, Self::Error> { let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; let connector_refund_id = router_data.request.connector_refund_id.clone(); Ok(Self { ssl_transaction_type: TransactionType::TxnQuery, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id,
{ "chunk": null, "crate": "connector-integration", "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": 1275, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1300_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs fn try_from( item: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { Self::try_from(&item.router_data) } } impl TryFrom<&RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>> for SyncRequest { type Error = error_stack::Report<errors::ConnectorError>;
{ "chunk": null, "crate": "connector-integration", "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": 1300, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1300_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs fn try_from( item: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { Self::try_from(&item.router_data) } } impl TryFrom<&RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>> for SyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( router_data: &RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, ) -> Result<Self, Self::Error> { let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; let connector_refund_id = router_data.request.connector_refund_id.clone(); Ok(Self { ssl_transaction_type: TransactionType::TxnQuery, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id, ssl_pin: auth_type.ssl_pin, ssl_txn_id: connector_refund_id, }) } }
{ "chunk": null, "crate": "connector-integration", "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": 1300, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1300_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs fn try_from( item: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { Self::try_from(&item.router_data) } } impl TryFrom<&RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>> for SyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( router_data: &RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, ) -> Result<Self, Self::Error> { let auth_type = ElavonAuthType::try_from(&router_data.connector_auth_type)?; let connector_refund_id = router_data.request.connector_refund_id.clone(); Ok(Self { ssl_transaction_type: TransactionType::TxnQuery, ssl_account_id: auth_type.ssl_merchant_id, ssl_user_id: auth_type.ssl_user_id, ssl_pin: auth_type.ssl_pin, ssl_txn_id: connector_refund_id, }) } } // Implementation for XMLRSyncRequest impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, > for XMLRSyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(
{ "chunk": null, "crate": "connector-integration", "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": 1300, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1325_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs ssl_pin: auth_type.ssl_pin, ssl_txn_id: connector_refund_id, }) } } // Implementation for XMLRSyncRequest impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >
{ "chunk": null, "crate": "connector-integration", "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": 1325, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1325_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs ssl_pin: auth_type.ssl_pin, ssl_txn_id: connector_refund_id, }) } } // Implementation for XMLRSyncRequest impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, > for XMLRSyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( data: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> {
{ "chunk": null, "crate": "connector-integration", "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": 1325, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1325_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs ssl_pin: auth_type.ssl_pin, ssl_txn_id: connector_refund_id, }) } } // Implementation for XMLRSyncRequest impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, > for XMLRSyncRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( data: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the SyncRequest let request = SyncRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create SyncRequest for RSync")?; // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLRSyncRequest(result)) } }
{ "chunk": null, "crate": "connector-integration", "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": 1325, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1350_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs data: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the SyncRequest let request = SyncRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create SyncRequest for RSync")?; // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap
{ "chunk": null, "crate": "connector-integration", "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": 1350, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1350_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs data: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the SyncRequest let request = SyncRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create SyncRequest for RSync")?; // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLRSyncRequest(result)) } } // Define RSync response type #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ElavonRSyncResponse { pub ssl_trans_status: TransactionSyncStatus, pub ssl_transaction_type: SyncTransactionType,
{ "chunk": null, "crate": "connector-integration", "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": 1350, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1350_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs data: ElavonRouterData< RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { // Create the SyncRequest let request = SyncRequest::try_from(data) .change_context(errors::ConnectorError::RequestEncodingFailed) .attach_printable("Failed to create SyncRequest for RSync")?; // Generate XML content let xml_content = quick_xml::se::to_string_with_root("txn", &request) .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?; // Create the form data HashMap let mut result = HashMap::new(); result.insert( "xmldata".to_string(), Secret::<_, WithoutType>::new(xml_content), ); Ok(XMLRSyncRequest(result)) } } // Define RSync response type #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ElavonRSyncResponse { pub ssl_trans_status: TransactionSyncStatus, pub ssl_transaction_type: SyncTransactionType, pub ssl_txn_id: String, } // Function to determine refund status from RSync response pub fn get_refund_status_from_elavon_sync_response( elavon_response: &ElavonRSyncResponse, ) -> common_enums::RefundStatus { match elavon_response.ssl_transaction_type { SyncTransactionType::Return => match elavon_response.ssl_trans_status { TransactionSyncStatus::STL => common_enums::RefundStatus::Success, TransactionSyncStatus::PEN => common_enums::RefundStatus::Pending, TransactionSyncStatus::OPN => common_enums::RefundStatus::Pending, TransactionSyncStatus::REV => common_enums::RefundStatus::ManualReview, TransactionSyncStatus::PST | TransactionSyncStatus::FPR | TransactionSyncStatus::PRE => common_enums::RefundStatus::Failure, }, _ => common_enums::RefundStatus::Pending, } }
{ "chunk": null, "crate": "connector-integration", "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": 1350, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1375_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs // Define RSync response type #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ElavonRSyncResponse { pub ssl_trans_status: TransactionSyncStatus, pub ssl_transaction_type: SyncTransactionType, pub ssl_txn_id: String, } // Function to determine refund status from RSync response pub fn get_refund_status_from_elavon_sync_response( elavon_response: &ElavonRSyncResponse, ) -> common_enums::RefundStatus { match elavon_response.ssl_transaction_type { SyncTransactionType::Return => match elavon_response.ssl_trans_status { TransactionSyncStatus::STL => common_enums::RefundStatus::Success,
{ "chunk": null, "crate": "connector-integration", "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": 1375, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1375_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs // Define RSync response type #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ElavonRSyncResponse { pub ssl_trans_status: TransactionSyncStatus, pub ssl_transaction_type: SyncTransactionType, pub ssl_txn_id: String, } // Function to determine refund status from RSync response pub fn get_refund_status_from_elavon_sync_response( elavon_response: &ElavonRSyncResponse, ) -> common_enums::RefundStatus { match elavon_response.ssl_transaction_type { SyncTransactionType::Return => match elavon_response.ssl_trans_status { TransactionSyncStatus::STL => common_enums::RefundStatus::Success, TransactionSyncStatus::PEN => common_enums::RefundStatus::Pending, TransactionSyncStatus::OPN => common_enums::RefundStatus::Pending, TransactionSyncStatus::REV => common_enums::RefundStatus::ManualReview, TransactionSyncStatus::PST | TransactionSyncStatus::FPR | TransactionSyncStatus::PRE => common_enums::RefundStatus::Failure, }, _ => common_enums::RefundStatus::Pending, } } // Response handling for RSync flow impl<F> TryFrom<ResponseRouterData<ElavonRSyncResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundSyncData, RefundsResponseData> {
{ "chunk": null, "crate": "connector-integration", "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": 1375, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1375_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs // Define RSync response type #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ElavonRSyncResponse { pub ssl_trans_status: TransactionSyncStatus, pub ssl_transaction_type: SyncTransactionType, pub ssl_txn_id: String, } // Function to determine refund status from RSync response pub fn get_refund_status_from_elavon_sync_response( elavon_response: &ElavonRSyncResponse, ) -> common_enums::RefundStatus { match elavon_response.ssl_transaction_type { SyncTransactionType::Return => match elavon_response.ssl_trans_status { TransactionSyncStatus::STL => common_enums::RefundStatus::Success, TransactionSyncStatus::PEN => common_enums::RefundStatus::Pending, TransactionSyncStatus::OPN => common_enums::RefundStatus::Pending, TransactionSyncStatus::REV => common_enums::RefundStatus::ManualReview, TransactionSyncStatus::PST | TransactionSyncStatus::FPR | TransactionSyncStatus::PRE => common_enums::RefundStatus::Failure, }, _ => common_enums::RefundStatus::Pending, } } // Response handling for RSync flow impl<F> TryFrom<ResponseRouterData<ElavonRSyncResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundSyncData, RefundsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(value: ResponseRouterData<ElavonRSyncResponse, Self>) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code: _, } = value; let refund_status = get_refund_status_from_elavon_sync_response(&response); let response_data = RefundsResponseData { connector_refund_id: response.ssl_txn_id.clone(), refund_status, status_code: value.http_code, }; Ok(Self { response: Ok(response_data), resource_common_data: RefundFlowData {
{ "chunk": null, "crate": "connector-integration", "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": 1375, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1400_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs // Response handling for RSync flow impl<F> TryFrom<ResponseRouterData<ElavonRSyncResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundSyncData, RefundsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(value: ResponseRouterData<ElavonRSyncResponse, Self>) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code: _, } = value; let refund_status = get_refund_status_from_elavon_sync_response(&response);
{ "chunk": null, "crate": "connector-integration", "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": 1400, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1400_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs // Response handling for RSync flow impl<F> TryFrom<ResponseRouterData<ElavonRSyncResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundSyncData, RefundsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(value: ResponseRouterData<ElavonRSyncResponse, Self>) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code: _, } = value; let refund_status = get_refund_status_from_elavon_sync_response(&response); let response_data = RefundsResponseData { connector_refund_id: response.ssl_txn_id.clone(), refund_status, status_code: value.http_code, }; Ok(Self { response: Ok(response_data), resource_common_data: RefundFlowData { status: refund_status, ..router_data.resource_common_data }, ..router_data })
{ "chunk": null, "crate": "connector-integration", "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": 1400, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1400_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs // Response handling for RSync flow impl<F> TryFrom<ResponseRouterData<ElavonRSyncResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundSyncData, RefundsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(value: ResponseRouterData<ElavonRSyncResponse, Self>) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code: _, } = value; let refund_status = get_refund_status_from_elavon_sync_response(&response); let response_data = RefundsResponseData { connector_refund_id: response.ssl_txn_id.clone(), refund_status, status_code: value.http_code, }; Ok(Self { response: Ok(response_data), resource_common_data: RefundFlowData { status: refund_status, ..router_data.resource_common_data }, ..router_data }) } } #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ElavonPSyncResponse { pub ssl_trans_status: TransactionSyncStatus, pub ssl_transaction_type: SyncTransactionType, pub ssl_txn_id: String, } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] pub enum TransactionSyncStatus { PEN, OPN, REV, STL, PST, FPR, PRE, }
{ "chunk": null, "crate": "connector-integration", "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": 1400, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1425_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs status: refund_status, ..router_data.resource_common_data }, ..router_data }) } } #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ElavonPSyncResponse { pub ssl_trans_status: TransactionSyncStatus, pub ssl_transaction_type: SyncTransactionType, pub ssl_txn_id: String, }
{ "chunk": null, "crate": "connector-integration", "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": 1425, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1425_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs status: refund_status, ..router_data.resource_common_data }, ..router_data }) } } #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ElavonPSyncResponse { pub ssl_trans_status: TransactionSyncStatus, pub ssl_transaction_type: SyncTransactionType, pub ssl_txn_id: String, } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] pub enum TransactionSyncStatus { PEN, OPN, REV, STL, PST, FPR, PRE, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] #[serde(rename_all = "UPPERCASE")] pub enum SyncTransactionType { Sale,
{ "chunk": null, "crate": "connector-integration", "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": 1425, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1425_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs status: refund_status, ..router_data.resource_common_data }, ..router_data }) } } #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ElavonPSyncResponse { pub ssl_trans_status: TransactionSyncStatus, pub ssl_transaction_type: SyncTransactionType, pub ssl_txn_id: String, } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] pub enum TransactionSyncStatus { PEN, OPN, REV, STL, PST, FPR, PRE, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] #[serde(rename_all = "UPPERCASE")] pub enum SyncTransactionType { Sale, AuthOnly, Return, } impl<F> TryFrom<ResponseRouterData<ElavonPSyncResponse, Self>> for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(value: ResponseRouterData<ElavonPSyncResponse, Self>) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code: _, } = value; let final_status = match response.ssl_trans_status { TransactionSyncStatus::STL => match response.ssl_transaction_type { SyncTransactionType::Sale => HyperswitchAttemptStatus::Charged, SyncTransactionType::AuthOnly => HyperswitchAttemptStatus::Charged, SyncTransactionType::Return => HyperswitchAttemptStatus::Pending,
{ "chunk": null, "crate": "connector-integration", "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": 1425, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1450_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] #[serde(rename_all = "UPPERCASE")] pub enum SyncTransactionType { Sale, AuthOnly, Return, } impl<F> TryFrom<ResponseRouterData<ElavonPSyncResponse, Self>> for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(value: ResponseRouterData<ElavonPSyncResponse, Self>) -> Result<Self, Self::Error> { let ResponseRouterData {
{ "chunk": null, "crate": "connector-integration", "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": 1450, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1450_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] #[serde(rename_all = "UPPERCASE")] pub enum SyncTransactionType { Sale, AuthOnly, Return, } impl<F> TryFrom<ResponseRouterData<ElavonPSyncResponse, Self>> for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(value: ResponseRouterData<ElavonPSyncResponse, Self>) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code: _, } = value; let final_status = match response.ssl_trans_status { TransactionSyncStatus::STL => match response.ssl_transaction_type { SyncTransactionType::Sale => HyperswitchAttemptStatus::Charged, SyncTransactionType::AuthOnly => HyperswitchAttemptStatus::Charged, SyncTransactionType::Return => HyperswitchAttemptStatus::Pending, }, TransactionSyncStatus::OPN => match response.ssl_transaction_type { SyncTransactionType::AuthOnly => HyperswitchAttemptStatus::Authorized, SyncTransactionType::Sale => HyperswitchAttemptStatus::Pending, SyncTransactionType::Return => HyperswitchAttemptStatus::Pending,
{ "chunk": null, "crate": "connector-integration", "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": 1450, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1450_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] #[serde(rename_all = "UPPERCASE")] pub enum SyncTransactionType { Sale, AuthOnly, Return, } impl<F> TryFrom<ResponseRouterData<ElavonPSyncResponse, Self>> for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(value: ResponseRouterData<ElavonPSyncResponse, Self>) -> Result<Self, Self::Error> { let ResponseRouterData { response, router_data, http_code: _, } = value; let final_status = match response.ssl_trans_status { TransactionSyncStatus::STL => match response.ssl_transaction_type { SyncTransactionType::Sale => HyperswitchAttemptStatus::Charged, SyncTransactionType::AuthOnly => HyperswitchAttemptStatus::Charged, SyncTransactionType::Return => HyperswitchAttemptStatus::Pending, }, TransactionSyncStatus::OPN => match response.ssl_transaction_type { SyncTransactionType::AuthOnly => HyperswitchAttemptStatus::Authorized, SyncTransactionType::Sale => HyperswitchAttemptStatus::Pending, SyncTransactionType::Return => HyperswitchAttemptStatus::Pending, }, TransactionSyncStatus::PEN | TransactionSyncStatus::REV => { HyperswitchAttemptStatus::Pending } TransactionSyncStatus::PST | TransactionSyncStatus::FPR | TransactionSyncStatus::PRE => { if response.ssl_transaction_type == SyncTransactionType::AuthOnly && response.ssl_trans_status == TransactionSyncStatus::PRE { HyperswitchAttemptStatus::AuthenticationFailed } else { HyperswitchAttemptStatus::Failure } } }; let payments_response_data = PaymentsResponseData::TransactionResponse { resource_id: DomainResponseId::ConnectorTransactionId(response.ssl_txn_id.clone()), redirection_data: None,
{ "chunk": null, "crate": "connector-integration", "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": 1450, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1475_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs }, TransactionSyncStatus::OPN => match response.ssl_transaction_type { SyncTransactionType::AuthOnly => HyperswitchAttemptStatus::Authorized, SyncTransactionType::Sale => HyperswitchAttemptStatus::Pending, SyncTransactionType::Return => HyperswitchAttemptStatus::Pending, }, TransactionSyncStatus::PEN | TransactionSyncStatus::REV => { HyperswitchAttemptStatus::Pending } TransactionSyncStatus::PST | TransactionSyncStatus::FPR | TransactionSyncStatus::PRE => { if response.ssl_transaction_type == SyncTransactionType::AuthOnly && response.ssl_trans_status == TransactionSyncStatus::PRE {
{ "chunk": null, "crate": "connector-integration", "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": 1475, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1475_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs }, TransactionSyncStatus::OPN => match response.ssl_transaction_type { SyncTransactionType::AuthOnly => HyperswitchAttemptStatus::Authorized, SyncTransactionType::Sale => HyperswitchAttemptStatus::Pending, SyncTransactionType::Return => HyperswitchAttemptStatus::Pending, }, TransactionSyncStatus::PEN | TransactionSyncStatus::REV => { HyperswitchAttemptStatus::Pending } TransactionSyncStatus::PST | TransactionSyncStatus::FPR | TransactionSyncStatus::PRE => { if response.ssl_transaction_type == SyncTransactionType::AuthOnly && response.ssl_trans_status == TransactionSyncStatus::PRE { HyperswitchAttemptStatus::AuthenticationFailed } else { HyperswitchAttemptStatus::Failure } } }; let payments_response_data = PaymentsResponseData::TransactionResponse { resource_id: DomainResponseId::ConnectorTransactionId(response.ssl_txn_id.clone()), redirection_data: None, connector_metadata: Some(serde_json::json!(response)), network_txn_id: None, connector_response_reference_id: None, incremental_authorization_allowed: None, mandate_reference: None,
{ "chunk": null, "crate": "connector-integration", "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": 1475, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1475_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs }, TransactionSyncStatus::OPN => match response.ssl_transaction_type { SyncTransactionType::AuthOnly => HyperswitchAttemptStatus::Authorized, SyncTransactionType::Sale => HyperswitchAttemptStatus::Pending, SyncTransactionType::Return => HyperswitchAttemptStatus::Pending, }, TransactionSyncStatus::PEN | TransactionSyncStatus::REV => { HyperswitchAttemptStatus::Pending } TransactionSyncStatus::PST | TransactionSyncStatus::FPR | TransactionSyncStatus::PRE => { if response.ssl_transaction_type == SyncTransactionType::AuthOnly && response.ssl_trans_status == TransactionSyncStatus::PRE { HyperswitchAttemptStatus::AuthenticationFailed } else { HyperswitchAttemptStatus::Failure } } }; let payments_response_data = PaymentsResponseData::TransactionResponse { resource_id: DomainResponseId::ConnectorTransactionId(response.ssl_txn_id.clone()), redirection_data: None, connector_metadata: Some(serde_json::json!(response)), network_txn_id: None, connector_response_reference_id: None, incremental_authorization_allowed: None, mandate_reference: None, status_code: value.http_code, }; Ok(RouterDataV2 { response: Ok(payments_response_data), resource_common_data: PaymentFlowData { status: final_status, ..router_data.resource_common_data }, ..router_data }) } }
{ "chunk": null, "crate": "connector-integration", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 43, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1475, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1500_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs connector_metadata: Some(serde_json::json!(response)), network_txn_id: None, connector_response_reference_id: None, incremental_authorization_allowed: None, mandate_reference: None, status_code: value.http_code, }; Ok(RouterDataV2 { response: Ok(payments_response_data), resource_common_data: PaymentFlowData { status: final_status, ..router_data.resource_common_data }, ..router_data
{ "chunk": null, "crate": "connector-integration", "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": 1500, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1500_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs connector_metadata: Some(serde_json::json!(response)), network_txn_id: None, connector_response_reference_id: None, incremental_authorization_allowed: None, mandate_reference: None, status_code: value.http_code, }; Ok(RouterDataV2 { response: Ok(payments_response_data), resource_common_data: PaymentFlowData { status: final_status, ..router_data.resource_common_data }, ..router_data }) } }
{ "chunk": null, "crate": "connector-integration", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 18, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1500, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-2910212303359634675_1500_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/elavon/transformers.rs connector_metadata: Some(serde_json::json!(response)), network_txn_id: None, connector_response_reference_id: None, incremental_authorization_allowed: None, mandate_reference: None, status_code: value.http_code, }; Ok(RouterDataV2 { response: Ok(payments_response_data), resource_common_data: PaymentFlowData { status: final_status, ..router_data.resource_common_data }, ..router_data }) } }
{ "chunk": null, "crate": "connector-integration", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 18, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1500, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-7118378565780451163_0_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/constants.rs //! Constants for PhonePe connector // ===== API ENDPOINTS ===== pub const API_PAY_ENDPOINT: &str = "pg/v1/pay"; pub const API_STATUS_ENDPOINT: &str = "pg/v1/status"; // ===== UPI INSTRUMENT TYPES ===== pub const UPI_INTENT: &str = "UPI_INTENT"; pub const UPI_COLLECT: &str = "UPI_COLLECT"; pub const UPI_QR: &str = "UPI_QR"; // ===== DEFAULT VALUES ===== pub const DEFAULT_KEY_INDEX: &str = "1"; pub const DEFAULT_DEVICE_OS: &str = "Android"; pub const DEFAULT_IP: &str = "127.0.0.1";
{ "chunk": null, "crate": "connector-integration", "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_-7118378565780451163_0_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/constants.rs //! Constants for PhonePe connector // ===== API ENDPOINTS ===== pub const API_PAY_ENDPOINT: &str = "pg/v1/pay"; pub const API_STATUS_ENDPOINT: &str = "pg/v1/status"; // ===== UPI INSTRUMENT TYPES ===== pub const UPI_INTENT: &str = "UPI_INTENT"; pub const UPI_COLLECT: &str = "UPI_COLLECT"; pub const UPI_QR: &str = "UPI_QR"; // ===== DEFAULT VALUES ===== pub const DEFAULT_KEY_INDEX: &str = "1"; pub const DEFAULT_DEVICE_OS: &str = "Android"; pub const DEFAULT_IP: &str = "127.0.0.1"; pub const DEFAULT_USER_AGENT: &str = "Mozilla/5.0"; // ===== CHECKSUM ===== pub const CHECKSUM_SEPARATOR: &str = "###"; // ===== CONTENT TYPES ===== pub const APPLICATION_JSON: &str = "application/json";
{ "chunk": null, "crate": "connector-integration", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 22, "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_-7118378565780451163_0_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/constants.rs //! Constants for PhonePe connector // ===== API ENDPOINTS ===== pub const API_PAY_ENDPOINT: &str = "pg/v1/pay"; pub const API_STATUS_ENDPOINT: &str = "pg/v1/status"; // ===== UPI INSTRUMENT TYPES ===== pub const UPI_INTENT: &str = "UPI_INTENT"; pub const UPI_COLLECT: &str = "UPI_COLLECT"; pub const UPI_QR: &str = "UPI_QR"; // ===== DEFAULT VALUES ===== pub const DEFAULT_KEY_INDEX: &str = "1"; pub const DEFAULT_DEVICE_OS: &str = "Android"; pub const DEFAULT_IP: &str = "127.0.0.1"; pub const DEFAULT_USER_AGENT: &str = "Mozilla/5.0"; // ===== CHECKSUM ===== pub const CHECKSUM_SEPARATOR: &str = "###"; // ===== CONTENT TYPES ===== pub const APPLICATION_JSON: &str = "application/json";
{ "chunk": null, "crate": "connector-integration", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 22, "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_3522933810268649801_0_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs use base64::Engine; use common_enums; use common_utils::{ crypto::{self, GenerateDigest}, ext_traits::Encode, types::MinorUnit, }; use domain_types::{ connector_flow::{Authorize, PSync}, connector_types::{ PaymentFlowData, PaymentsAuthorizeData, PaymentsResponseData, PaymentsSyncData, ResponseId, }, errors, payment_method_data::{PaymentMethodData, PaymentMethodDataTypes, UpiData}, router_data::ConnectorAuthType,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_0_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs use base64::Engine; use common_enums; use common_utils::{ crypto::{self, GenerateDigest}, ext_traits::Encode, types::MinorUnit, }; use domain_types::{ connector_flow::{Authorize, PSync}, connector_types::{ PaymentFlowData, PaymentsAuthorizeData, PaymentsResponseData, PaymentsSyncData, ResponseId, }, errors, payment_method_data::{PaymentMethodData, PaymentMethodDataTypes, UpiData}, router_data::ConnectorAuthType, router_data_v2::RouterDataV2, router_response_types::RedirectForm, }; use error_stack::ResultExt; use hyperswitch_masking::{PeekInterface, Secret}; use serde::{Deserialize, Serialize}; use super::constants; use crate::{connectors::phonepe::PhonepeRouterData, types::ResponseRouterData}; type Error = error_stack::Report<errors::ConnectorError>; // ===== AMOUNT CONVERSION ===== // Using macro-generated PhonepeRouterData from crate::connectors::phonepe
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_0_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs use base64::Engine; use common_enums; use common_utils::{ crypto::{self, GenerateDigest}, ext_traits::Encode, types::MinorUnit, }; use domain_types::{ connector_flow::{Authorize, PSync}, connector_types::{ PaymentFlowData, PaymentsAuthorizeData, PaymentsResponseData, PaymentsSyncData, ResponseId, }, errors, payment_method_data::{PaymentMethodData, PaymentMethodDataTypes, UpiData}, router_data::ConnectorAuthType, router_data_v2::RouterDataV2, router_response_types::RedirectForm, }; use error_stack::ResultExt; use hyperswitch_masking::{PeekInterface, Secret}; use serde::{Deserialize, Serialize}; use super::constants; use crate::{connectors::phonepe::PhonepeRouterData, types::ResponseRouterData}; type Error = error_stack::Report<errors::ConnectorError>; // ===== AMOUNT CONVERSION ===== // Using macro-generated PhonepeRouterData from crate::connectors::phonepe // ===== REQUEST STRUCTURES ===== #[derive(Debug, Serialize)] pub struct PhonepePaymentsRequest { request: Secret<String>, #[serde(skip)] pub checksum: String, } #[derive(Debug, Serialize)] struct PhonepePaymentRequestPayload { #[serde(rename = "merchantId")] merchant_id: Secret<String>, #[serde(rename = "merchantTransactionId")] merchant_transaction_id: String, #[serde(rename = "merchantUserId", skip_serializing_if = "Option::is_none")] merchant_user_id: Option<Secret<String>>, amount: MinorUnit, #[serde(rename = "callbackUrl")] callback_url: String,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_25_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs type Error = error_stack::Report<errors::ConnectorError>; // ===== AMOUNT CONVERSION ===== // Using macro-generated PhonepeRouterData from crate::connectors::phonepe // ===== REQUEST STRUCTURES ===== #[derive(Debug, Serialize)] pub struct PhonepePaymentsRequest { request: Secret<String>, #[serde(skip)] pub checksum: String, } #[derive(Debug, Serialize)]
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_25_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs type Error = error_stack::Report<errors::ConnectorError>; // ===== AMOUNT CONVERSION ===== // Using macro-generated PhonepeRouterData from crate::connectors::phonepe // ===== REQUEST STRUCTURES ===== #[derive(Debug, Serialize)] pub struct PhonepePaymentsRequest { request: Secret<String>, #[serde(skip)] pub checksum: String, } #[derive(Debug, Serialize)] struct PhonepePaymentRequestPayload { #[serde(rename = "merchantId")] merchant_id: Secret<String>, #[serde(rename = "merchantTransactionId")] merchant_transaction_id: String, #[serde(rename = "merchantUserId", skip_serializing_if = "Option::is_none")] merchant_user_id: Option<Secret<String>>, amount: MinorUnit, #[serde(rename = "callbackUrl")] callback_url: String, #[serde(rename = "mobileNumber", skip_serializing_if = "Option::is_none")] mobile_number: Option<Secret<String>>, #[serde(rename = "paymentInstrument")] payment_instrument: PhonepePaymentInstrument, #[serde(rename = "deviceContext", skip_serializing_if = "Option::is_none")]
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_25_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs type Error = error_stack::Report<errors::ConnectorError>; // ===== AMOUNT CONVERSION ===== // Using macro-generated PhonepeRouterData from crate::connectors::phonepe // ===== REQUEST STRUCTURES ===== #[derive(Debug, Serialize)] pub struct PhonepePaymentsRequest { request: Secret<String>, #[serde(skip)] pub checksum: String, } #[derive(Debug, Serialize)] struct PhonepePaymentRequestPayload { #[serde(rename = "merchantId")] merchant_id: Secret<String>, #[serde(rename = "merchantTransactionId")] merchant_transaction_id: String, #[serde(rename = "merchantUserId", skip_serializing_if = "Option::is_none")] merchant_user_id: Option<Secret<String>>, amount: MinorUnit, #[serde(rename = "callbackUrl")] callback_url: String, #[serde(rename = "mobileNumber", skip_serializing_if = "Option::is_none")] mobile_number: Option<Secret<String>>, #[serde(rename = "paymentInstrument")] payment_instrument: PhonepePaymentInstrument, #[serde(rename = "deviceContext", skip_serializing_if = "Option::is_none")] device_context: Option<PhonepeDeviceContext>, } #[derive(Debug, Serialize)] struct PhonepeDeviceContext { #[serde(rename = "deviceOS", skip_serializing_if = "Option::is_none")] device_os: Option<String>, } #[derive(Debug, Serialize)] struct PhonepePaymentInstrument { #[serde(rename = "type")] instrument_type: String, #[serde(rename = "targetApp", skip_serializing_if = "Option::is_none")] target_app: Option<String>, #[serde(skip_serializing_if = "Option::is_none")] vpa: Option<Secret<String>>, } // ===== SYNC REQUEST STRUCTURES =====
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_50_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs #[serde(rename = "mobileNumber", skip_serializing_if = "Option::is_none")] mobile_number: Option<Secret<String>>, #[serde(rename = "paymentInstrument")] payment_instrument: PhonepePaymentInstrument, #[serde(rename = "deviceContext", skip_serializing_if = "Option::is_none")] device_context: Option<PhonepeDeviceContext>, } #[derive(Debug, Serialize)] struct PhonepeDeviceContext { #[serde(rename = "deviceOS", skip_serializing_if = "Option::is_none")] device_os: Option<String>, } #[derive(Debug, Serialize)]
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_50_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs #[serde(rename = "mobileNumber", skip_serializing_if = "Option::is_none")] mobile_number: Option<Secret<String>>, #[serde(rename = "paymentInstrument")] payment_instrument: PhonepePaymentInstrument, #[serde(rename = "deviceContext", skip_serializing_if = "Option::is_none")] device_context: Option<PhonepeDeviceContext>, } #[derive(Debug, Serialize)] struct PhonepeDeviceContext { #[serde(rename = "deviceOS", skip_serializing_if = "Option::is_none")] device_os: Option<String>, } #[derive(Debug, Serialize)] struct PhonepePaymentInstrument { #[serde(rename = "type")] instrument_type: String, #[serde(rename = "targetApp", skip_serializing_if = "Option::is_none")] target_app: Option<String>, #[serde(skip_serializing_if = "Option::is_none")] vpa: Option<Secret<String>>, } // ===== SYNC REQUEST STRUCTURES ===== #[derive(Debug, Serialize)] pub struct PhonepeSyncRequest { #[serde(skip)] pub merchant_transaction_id: String,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_50_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs #[serde(rename = "mobileNumber", skip_serializing_if = "Option::is_none")] mobile_number: Option<Secret<String>>, #[serde(rename = "paymentInstrument")] payment_instrument: PhonepePaymentInstrument, #[serde(rename = "deviceContext", skip_serializing_if = "Option::is_none")] device_context: Option<PhonepeDeviceContext>, } #[derive(Debug, Serialize)] struct PhonepeDeviceContext { #[serde(rename = "deviceOS", skip_serializing_if = "Option::is_none")] device_os: Option<String>, } #[derive(Debug, Serialize)] struct PhonepePaymentInstrument { #[serde(rename = "type")] instrument_type: String, #[serde(rename = "targetApp", skip_serializing_if = "Option::is_none")] target_app: Option<String>, #[serde(skip_serializing_if = "Option::is_none")] vpa: Option<Secret<String>>, } // ===== SYNC REQUEST STRUCTURES ===== #[derive(Debug, Serialize)] pub struct PhonepeSyncRequest { #[serde(skip)] pub merchant_transaction_id: String, #[serde(skip)] pub checksum: String, } // ===== RESPONSE STRUCTURES ===== #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeErrorResponse { pub success: bool, pub code: String, #[serde(default = "default_error_message")] pub message: String, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepePaymentsResponse { pub success: bool, pub code: String, pub message: String, pub data: Option<PhonepeResponseData>,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_75_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs #[derive(Debug, Serialize)] pub struct PhonepeSyncRequest { #[serde(skip)] pub merchant_transaction_id: String, #[serde(skip)] pub checksum: String, } // ===== RESPONSE STRUCTURES ===== #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeErrorResponse { pub success: bool, pub code: String,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_75_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs #[derive(Debug, Serialize)] pub struct PhonepeSyncRequest { #[serde(skip)] pub merchant_transaction_id: String, #[serde(skip)] pub checksum: String, } // ===== RESPONSE STRUCTURES ===== #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeErrorResponse { pub success: bool, pub code: String, #[serde(default = "default_error_message")] pub message: String, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepePaymentsResponse { pub success: bool, pub code: String, pub message: String, pub data: Option<PhonepeResponseData>, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeSyncResponse { pub success: bool,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_75_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs #[derive(Debug, Serialize)] pub struct PhonepeSyncRequest { #[serde(skip)] pub merchant_transaction_id: String, #[serde(skip)] pub checksum: String, } // ===== RESPONSE STRUCTURES ===== #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeErrorResponse { pub success: bool, pub code: String, #[serde(default = "default_error_message")] pub message: String, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepePaymentsResponse { pub success: bool, pub code: String, pub message: String, pub data: Option<PhonepeResponseData>, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeSyncResponse { pub success: bool, pub code: String, #[serde(default = "default_sync_error_message")] pub message: String, #[serde(default)] pub data: Option<PhonepeSyncResponseData>, } fn default_error_message() -> String { "Payment processing failed".to_string() } fn default_sync_error_message() -> String { "Payment sync failed".to_string() } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeResponseData { #[serde(rename = "merchantId")] merchant_id: String, #[serde(rename = "merchantTransactionId")]
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_100_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeSyncResponse { pub success: bool, pub code: String, #[serde(default = "default_sync_error_message")] pub message: String, #[serde(default)] pub data: Option<PhonepeSyncResponseData>, } fn default_error_message() -> String { "Payment processing failed".to_string() }
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_100_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeSyncResponse { pub success: bool, pub code: String, #[serde(default = "default_sync_error_message")] pub message: String, #[serde(default)] pub data: Option<PhonepeSyncResponseData>, } fn default_error_message() -> String { "Payment processing failed".to_string() } fn default_sync_error_message() -> String { "Payment sync failed".to_string() } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeResponseData { #[serde(rename = "merchantId")] merchant_id: String, #[serde(rename = "merchantTransactionId")] merchant_transaction_id: String, #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] transaction_id: Option<String>, #[serde(rename = "instrumentResponse", skip_serializing_if = "Option::is_none")] instrument_response: Option<PhonepeInstrumentResponse>,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_100_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeSyncResponse { pub success: bool, pub code: String, #[serde(default = "default_sync_error_message")] pub message: String, #[serde(default)] pub data: Option<PhonepeSyncResponseData>, } fn default_error_message() -> String { "Payment processing failed".to_string() } fn default_sync_error_message() -> String { "Payment sync failed".to_string() } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeResponseData { #[serde(rename = "merchantId")] merchant_id: String, #[serde(rename = "merchantTransactionId")] merchant_transaction_id: String, #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] transaction_id: Option<String>, #[serde(rename = "instrumentResponse", skip_serializing_if = "Option::is_none")] instrument_response: Option<PhonepeInstrumentResponse>, #[serde(rename = "responseCode", skip_serializing_if = "Option::is_none")] response_code: Option<String>, #[serde( rename = "responseCodeDescription", skip_serializing_if = "Option::is_none" )] response_code_description: Option<String>, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeInstrumentResponse { #[serde(rename = "type")] instrument_type: String, #[serde(rename = "intentUrl", skip_serializing_if = "Option::is_none")] intent_url: Option<String>, #[serde(rename = "qrData", skip_serializing_if = "Option::is_none")] qr_data: Option<String>, } #[derive(Debug, Deserialize, Serialize)]
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_125_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs merchant_transaction_id: String, #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] transaction_id: Option<String>, #[serde(rename = "instrumentResponse", skip_serializing_if = "Option::is_none")] instrument_response: Option<PhonepeInstrumentResponse>, #[serde(rename = "responseCode", skip_serializing_if = "Option::is_none")] response_code: Option<String>, #[serde( rename = "responseCodeDescription", skip_serializing_if = "Option::is_none" )] response_code_description: Option<String>, } #[derive(Debug, Deserialize, Serialize)]
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_125_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs merchant_transaction_id: String, #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] transaction_id: Option<String>, #[serde(rename = "instrumentResponse", skip_serializing_if = "Option::is_none")] instrument_response: Option<PhonepeInstrumentResponse>, #[serde(rename = "responseCode", skip_serializing_if = "Option::is_none")] response_code: Option<String>, #[serde( rename = "responseCodeDescription", skip_serializing_if = "Option::is_none" )] response_code_description: Option<String>, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeInstrumentResponse { #[serde(rename = "type")] instrument_type: String, #[serde(rename = "intentUrl", skip_serializing_if = "Option::is_none")] intent_url: Option<String>, #[serde(rename = "qrData", skip_serializing_if = "Option::is_none")] qr_data: Option<String>, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeSyncResponseData { #[serde(rename = "merchantId", skip_serializing_if = "Option::is_none")] merchant_id: Option<String>, #[serde( rename = "merchantTransactionId",
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_125_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs merchant_transaction_id: String, #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] transaction_id: Option<String>, #[serde(rename = "instrumentResponse", skip_serializing_if = "Option::is_none")] instrument_response: Option<PhonepeInstrumentResponse>, #[serde(rename = "responseCode", skip_serializing_if = "Option::is_none")] response_code: Option<String>, #[serde( rename = "responseCodeDescription", skip_serializing_if = "Option::is_none" )] response_code_description: Option<String>, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeInstrumentResponse { #[serde(rename = "type")] instrument_type: String, #[serde(rename = "intentUrl", skip_serializing_if = "Option::is_none")] intent_url: Option<String>, #[serde(rename = "qrData", skip_serializing_if = "Option::is_none")] qr_data: Option<String>, } #[derive(Debug, Deserialize, Serialize)] pub struct PhonepeSyncResponseData { #[serde(rename = "merchantId", skip_serializing_if = "Option::is_none")] merchant_id: Option<String>, #[serde( rename = "merchantTransactionId", skip_serializing_if = "Option::is_none" )] merchant_transaction_id: Option<String>, #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] transaction_id: Option<String>, #[serde(skip_serializing_if = "Option::is_none")] amount: Option<MinorUnit>, #[serde(skip_serializing_if = "Option::is_none")] state: Option<String>, #[serde(rename = "responseCode", skip_serializing_if = "Option::is_none")] response_code: Option<String>, #[serde(rename = "paymentInstrument", skip_serializing_if = "Option::is_none")] payment_instrument: Option<serde_json::Value>, } // ===== REQUEST BUILDING ===== // TryFrom implementation for macro-generated PhonepeRouterData wrapper (owned) impl< T: PaymentMethodDataTypes
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_150_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs pub struct PhonepeSyncResponseData { #[serde(rename = "merchantId", skip_serializing_if = "Option::is_none")] merchant_id: Option<String>, #[serde( rename = "merchantTransactionId", skip_serializing_if = "Option::is_none" )] merchant_transaction_id: Option<String>, #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] transaction_id: Option<String>, #[serde(skip_serializing_if = "Option::is_none")] amount: Option<MinorUnit>, #[serde(skip_serializing_if = "Option::is_none")] state: Option<String>, #[serde(rename = "responseCode", skip_serializing_if = "Option::is_none")]
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_150_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs pub struct PhonepeSyncResponseData { #[serde(rename = "merchantId", skip_serializing_if = "Option::is_none")] merchant_id: Option<String>, #[serde( rename = "merchantTransactionId", skip_serializing_if = "Option::is_none" )] merchant_transaction_id: Option<String>, #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] transaction_id: Option<String>, #[serde(skip_serializing_if = "Option::is_none")] amount: Option<MinorUnit>, #[serde(skip_serializing_if = "Option::is_none")] state: Option<String>, #[serde(rename = "responseCode", skip_serializing_if = "Option::is_none")] response_code: Option<String>, #[serde(rename = "paymentInstrument", skip_serializing_if = "Option::is_none")] payment_instrument: Option<serde_json::Value>, } // ===== REQUEST BUILDING ===== // TryFrom implementation for macro-generated PhonepeRouterData wrapper (owned) impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_150_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs pub struct PhonepeSyncResponseData { #[serde(rename = "merchantId", skip_serializing_if = "Option::is_none")] merchant_id: Option<String>, #[serde( rename = "merchantTransactionId", skip_serializing_if = "Option::is_none" )] merchant_transaction_id: Option<String>, #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] transaction_id: Option<String>, #[serde(skip_serializing_if = "Option::is_none")] amount: Option<MinorUnit>, #[serde(skip_serializing_if = "Option::is_none")] state: Option<String>, #[serde(rename = "responseCode", skip_serializing_if = "Option::is_none")] response_code: Option<String>, #[serde(rename = "paymentInstrument", skip_serializing_if = "Option::is_none")] payment_instrument: Option<serde_json::Value>, } // ===== REQUEST BUILDING ===== // TryFrom implementation for macro-generated PhonepeRouterData wrapper (owned) impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< PhonepeRouterData< RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, T, >, > for PhonepePaymentsRequest { type Error = Error; fn try_from( wrapper: PhonepeRouterData< RouterDataV2< Authorize, PaymentFlowData,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_175_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< PhonepeRouterData< RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, T,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_175_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< PhonepeRouterData< RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, T, >, > for PhonepePaymentsRequest { type Error = Error; fn try_from( wrapper: PhonepeRouterData< RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, T, >,
{ "chunk": null, "crate": "connector-integration", "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_3522933810268649801_175_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/phonepe/transformers.rs + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< PhonepeRouterData< RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, T, >, > for PhonepePaymentsRequest { type Error = Error; fn try_from( wrapper: PhonepeRouterData< RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, T, >, ) -> Result<Self, Self::Error> { let router_data = &wrapper.router_data; let auth = PhonepeAuthType::try_from(&router_data.connector_auth_type)?; // Use amount converter to get proper amount in minor units let amount_in_minor_units = wrapper .connector .amount_converter .convert( router_data.request.minor_amount, router_data.request.currency, ) .change_context(errors::ConnectorError::RequestEncodingFailed)?; // Get customer mobile number from billing address let mobile_number = router_data .resource_common_data .get_optional_billing_phone_number() .map(|phone| Secret::new(phone.peek().to_string()));
{ "chunk": null, "crate": "connector-integration", "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 }