id
stringlengths
20
153
type
stringclasses
1 value
granularity
stringclasses
14 values
content
stringlengths
16
84.3k
metadata
dict
connector-service_snippet_2188691800113068569_1150_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs currency: item.router_data.request.currency.to_string(), payment_type, }) } fn get_instruction_details< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >( item: &AciRouterData< RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>, T, >, ) -> Option<Instruction> { if item.router_data.request.customer_acceptance.is_some() && item.router_data.request.setup_future_usage == Some(common_enums::FutureUsage::OffSession) { return Some(Instruction { mode: InstructionMode::Initial, transaction_type: InstructionType::Unscheduled, source: InstructionSource::CardholderInitiatedTransaction, create_registration: Some(true), }); } else if item.router_data.request.mandate_id.is_some() { return Some(Instruction { mode: InstructionMode::Repeated, transaction_type: InstructionType::Unscheduled, source: InstructionSource::MerchantInitiatedTransaction, create_registration: None, }); } None } fn get_recurring_type< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >( item: &AciRouterData< 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": 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_2188691800113068569_1175_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs source: InstructionSource::CardholderInitiatedTransaction, create_registration: Some(true), }); } else if item.router_data.request.mandate_id.is_some() { return Some(Instruction { mode: InstructionMode::Repeated, transaction_type: InstructionType::Unscheduled, source: InstructionSource::MerchantInitiatedTransaction, create_registration: None, }); } None } fn get_recurring_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": 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_2188691800113068569_1175_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs source: InstructionSource::CardholderInitiatedTransaction, create_registration: Some(true), }); } else if item.router_data.request.mandate_id.is_some() { return Some(Instruction { mode: InstructionMode::Repeated, transaction_type: InstructionType::Unscheduled, source: InstructionSource::MerchantInitiatedTransaction, create_registration: None, }); } None } fn get_recurring_type< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >( item: &AciRouterData< RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>, T, >, ) -> Option<AciRecurringType> { if item.router_data.request.customer_acceptance.is_some() && item.router_data.request.setup_future_usage == Some(common_enums::FutureUsage::OffSession)
{ "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_2188691800113068569_1175_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs source: InstructionSource::CardholderInitiatedTransaction, create_registration: Some(true), }); } else if item.router_data.request.mandate_id.is_some() { return Some(Instruction { mode: InstructionMode::Repeated, transaction_type: InstructionType::Unscheduled, source: InstructionSource::MerchantInitiatedTransaction, create_registration: None, }); } None } fn get_recurring_type< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >( item: &AciRouterData< RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>, T, >, ) -> Option<AciRecurringType> { if item.router_data.request.customer_acceptance.is_some() && item.router_data.request.setup_future_usage == Some(common_enums::FutureUsage::OffSession) { Some(AciRecurringType::Initial) } else { None } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData< RouterDataV2<Void, PaymentFlowData, PaymentVoidData, 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": 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_2188691800113068569_1200_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs >, ) -> Option<AciRecurringType> { if item.router_data.request.customer_acceptance.is_some() && item.router_data.request.setup_future_usage == Some(common_enums::FutureUsage::OffSession) { Some(AciRecurringType::Initial) } else { None } } impl< T: PaymentMethodDataTypes + std::fmt::Debug
{ "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_2188691800113068569_1200_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs >, ) -> Option<AciRecurringType> { if item.router_data.request.customer_acceptance.is_some() && item.router_data.request.setup_future_usage == Some(common_enums::FutureUsage::OffSession) { Some(AciRecurringType::Initial) } else { None } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData< RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>, T, >, > for AciCancelRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData<
{ "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_2188691800113068569_1200_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs >, ) -> Option<AciRecurringType> { if item.router_data.request.customer_acceptance.is_some() && item.router_data.request.setup_future_usage == Some(common_enums::FutureUsage::OffSession) { Some(AciRecurringType::Initial) } else { None } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData< RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>, T, >, > for AciCancelRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let aci_payment_request = Self { entity_id: auth.entity_id, payment_type: AciPaymentType::Reversal, }; Ok(aci_payment_request) } } 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": 1200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1225_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs > for AciCancelRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let aci_payment_request = Self { entity_id: auth.entity_id, payment_type: AciPaymentType::Reversal, }; Ok(aci_payment_request)
{ "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_2188691800113068569_1225_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs > for AciCancelRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let aci_payment_request = Self { entity_id: auth.entity_id, payment_type: AciPaymentType::Reversal, }; Ok(aci_payment_request) } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData< RouterDataV2< SetupMandate,
{ "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_2188691800113068569_1225_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs > for AciCancelRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let aci_payment_request = Self { entity_id: auth.entity_id, payment_type: AciPaymentType::Reversal, }; Ok(aci_payment_request) } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData< RouterDataV2< SetupMandate, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData, >, T, >, > for AciMandateRequest<T> { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2< SetupMandate, PaymentFlowData, SetupMandateRequestData<T>, 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": 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_2188691800113068569_1250_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs > TryFrom< AciRouterData< RouterDataV2< SetupMandate, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData, >, T, >, > for AciMandateRequest<T> { type Error = error_stack::Report<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": 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_2188691800113068569_1250_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs > TryFrom< AciRouterData< RouterDataV2< SetupMandate, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData, >, T, >, > for AciMandateRequest<T> { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2< SetupMandate, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData, >, T, >, ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let (payment_brand, payment_details) = match &item.router_data.request.payment_method_data { PaymentMethodData::Card(card_data) => { let brand = get_aci_payment_brand(card_data.card_network.clone(), false).ok();
{ "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_2188691800113068569_1250_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs > TryFrom< AciRouterData< RouterDataV2< SetupMandate, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData, >, T, >, > for AciMandateRequest<T> { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2< SetupMandate, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData, >, T, >, ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let (payment_brand, payment_details) = match &item.router_data.request.payment_method_data { PaymentMethodData::Card(card_data) => { let brand = get_aci_payment_brand(card_data.card_network.clone(), false).ok(); match brand.as_ref() { Some(PaymentBrand::Visa) | Some(PaymentBrand::Mastercard) | Some(PaymentBrand::AmericanExpress) => (), Some(_) => { return Err(errors::ConnectorError::NotSupported { message: "Payment method not supported for mandate setup".to_string(), connector: "ACI", } .into()); } None => (), }; let details = PaymentDetails::AciCard(Box::new(CardDetails { card_number: card_data.card_number.clone(), card_expiry_month: card_data.card_exp_month.clone(), card_expiry_year: card_data.get_expiry_year_4_digit(), card_cvv: card_data.card_cvc.clone(), card_holder: card_data.card_holder_name.clone().ok_or(
{ "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_2188691800113068569_1275_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let (payment_brand, payment_details) = match &item.router_data.request.payment_method_data { PaymentMethodData::Card(card_data) => { let brand = get_aci_payment_brand(card_data.card_network.clone(), false).ok(); match brand.as_ref() { Some(PaymentBrand::Visa) | Some(PaymentBrand::Mastercard) | Some(PaymentBrand::AmericanExpress) => (), Some(_) => { return Err(errors::ConnectorError::NotSupported { message: "Payment method not supported for mandate setup".to_string(), connector: "ACI", } .into());
{ "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_2188691800113068569_1275_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let (payment_brand, payment_details) = match &item.router_data.request.payment_method_data { PaymentMethodData::Card(card_data) => { let brand = get_aci_payment_brand(card_data.card_network.clone(), false).ok(); match brand.as_ref() { Some(PaymentBrand::Visa) | Some(PaymentBrand::Mastercard) | Some(PaymentBrand::AmericanExpress) => (), Some(_) => { return Err(errors::ConnectorError::NotSupported { message: "Payment method not supported for mandate setup".to_string(), connector: "ACI", } .into()); } None => (), }; let details = PaymentDetails::AciCard(Box::new(CardDetails { card_number: card_data.card_number.clone(), card_expiry_month: card_data.card_exp_month.clone(), card_expiry_year: card_data.get_expiry_year_4_digit(), card_cvv: card_data.card_cvc.clone(), card_holder: card_data.card_holder_name.clone().ok_or( errors::ConnectorError::MissingRequiredField { field_name: "card_holder_name", }, )?, payment_brand: brand.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": 1275, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1275_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let (payment_brand, payment_details) = match &item.router_data.request.payment_method_data { PaymentMethodData::Card(card_data) => { let brand = get_aci_payment_brand(card_data.card_network.clone(), false).ok(); match brand.as_ref() { Some(PaymentBrand::Visa) | Some(PaymentBrand::Mastercard) | Some(PaymentBrand::AmericanExpress) => (), Some(_) => { return Err(errors::ConnectorError::NotSupported { message: "Payment method not supported for mandate setup".to_string(), connector: "ACI", } .into()); } None => (), }; let details = PaymentDetails::AciCard(Box::new(CardDetails { card_number: card_data.card_number.clone(), card_expiry_month: card_data.card_exp_month.clone(), card_expiry_year: card_data.get_expiry_year_4_digit(), card_cvv: card_data.card_cvc.clone(), card_holder: card_data.card_holder_name.clone().ok_or( errors::ConnectorError::MissingRequiredField { field_name: "card_holder_name", }, )?, payment_brand: brand.clone(), })); (brand, details) } _ => { return Err(errors::ConnectorError::NotSupported { message: "Payment method not supported for mandate setup".to_string(), connector: "ACI", } .into()); } }; Ok(Self { entity_id: auth.entity_id, payment_brand, payment_details, }) } }
{ "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_2188691800113068569_1300_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs errors::ConnectorError::MissingRequiredField { field_name: "card_holder_name", }, )?, payment_brand: brand.clone(), })); (brand, details) } _ => { return Err(errors::ConnectorError::NotSupported { message: "Payment method not supported for mandate setup".to_string(), connector: "ACI", } .into());
{ "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_2188691800113068569_1300_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs errors::ConnectorError::MissingRequiredField { field_name: "card_holder_name", }, )?, payment_brand: brand.clone(), })); (brand, details) } _ => { return Err(errors::ConnectorError::NotSupported { message: "Payment method not supported for mandate setup".to_string(), connector: "ACI", } .into()); } }; Ok(Self { entity_id: auth.entity_id, payment_brand, payment_details, }) } } #[derive(Debug, Default, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum AciPaymentStatus { Succeeded,
{ "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_2188691800113068569_1300_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs errors::ConnectorError::MissingRequiredField { field_name: "card_holder_name", }, )?, payment_brand: brand.clone(), })); (brand, details) } _ => { return Err(errors::ConnectorError::NotSupported { message: "Payment method not supported for mandate setup".to_string(), connector: "ACI", } .into()); } }; Ok(Self { entity_id: auth.entity_id, payment_brand, payment_details, }) } } #[derive(Debug, Default, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum AciPaymentStatus { Succeeded, Failed, #[default] Pending, RedirectShopper, } fn map_aci_attempt_status( item: AciPaymentStatus, auto_capture: bool, ) -> common_enums::AttemptStatus { match item { AciPaymentStatus::Succeeded => { if auto_capture { common_enums::AttemptStatus::Charged } else { common_enums::AttemptStatus::Authorized } } AciPaymentStatus::Failed => common_enums::AttemptStatus::Failure, AciPaymentStatus::Pending => common_enums::AttemptStatus::Authorizing,
{ "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_2188691800113068569_1325_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[derive(Debug, Default, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum AciPaymentStatus { Succeeded, Failed, #[default] Pending, RedirectShopper, } fn map_aci_attempt_status( item: AciPaymentStatus, auto_capture: bool, ) -> common_enums::AttemptStatus {
{ "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_2188691800113068569_1325_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[derive(Debug, Default, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum AciPaymentStatus { Succeeded, Failed, #[default] Pending, RedirectShopper, } fn map_aci_attempt_status( item: AciPaymentStatus, auto_capture: bool, ) -> common_enums::AttemptStatus { match item { AciPaymentStatus::Succeeded => { if auto_capture { common_enums::AttemptStatus::Charged } else { common_enums::AttemptStatus::Authorized } } AciPaymentStatus::Failed => common_enums::AttemptStatus::Failure, AciPaymentStatus::Pending => common_enums::AttemptStatus::Authorizing, AciPaymentStatus::RedirectShopper => common_enums::AttemptStatus::AuthenticationPending, } } impl FromStr for AciPaymentStatus {
{ "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_2188691800113068569_1325_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[derive(Debug, Default, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum AciPaymentStatus { Succeeded, Failed, #[default] Pending, RedirectShopper, } fn map_aci_attempt_status( item: AciPaymentStatus, auto_capture: bool, ) -> common_enums::AttemptStatus { match item { AciPaymentStatus::Succeeded => { if auto_capture { common_enums::AttemptStatus::Charged } else { common_enums::AttemptStatus::Authorized } } AciPaymentStatus::Failed => common_enums::AttemptStatus::Failure, AciPaymentStatus::Pending => common_enums::AttemptStatus::Authorizing, AciPaymentStatus::RedirectShopper => common_enums::AttemptStatus::AuthenticationPending, } } impl FromStr for AciPaymentStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciPaymentsResponse { 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": 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_2188691800113068569_1350_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs AciPaymentStatus::RedirectShopper => common_enums::AttemptStatus::AuthenticationPending, } } impl FromStr for AciPaymentStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError(
{ "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_2188691800113068569_1350_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs AciPaymentStatus::RedirectShopper => common_enums::AttemptStatus::AuthenticationPending, } } impl FromStr for AciPaymentStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciPaymentsResponse { id: String, registration_id: Option<Secret<String>>, ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode,
{ "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_2188691800113068569_1350_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs AciPaymentStatus::RedirectShopper => common_enums::AttemptStatus::AuthenticationPending, } } impl FromStr for AciPaymentStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciPaymentsResponse { id: String, registration_id: Option<Secret<String>>, ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, pub(super) redirect: Option<AciRedirectionData>, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciErrorResponse { ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRedirectionData { pub method: Option<Method>, pub parameters: Vec<Parameters>, pub url: Url, pub preconditions: Option<Vec<PreconditionData>>, }
{ "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_2188691800113068569_1375_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs registration_id: Option<Secret<String>>, ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, pub(super) redirect: Option<AciRedirectionData>, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciErrorResponse { ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode,
{ "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_2188691800113068569_1375_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs registration_id: Option<Secret<String>>, ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, pub(super) redirect: Option<AciRedirectionData>, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciErrorResponse { ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRedirectionData { pub method: Option<Method>, pub parameters: Vec<Parameters>, pub url: Url, pub preconditions: Option<Vec<PreconditionData>>, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct PreconditionData { pub method: Option<Method>,
{ "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_2188691800113068569_1375_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs registration_id: Option<Secret<String>>, ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, pub(super) redirect: Option<AciRedirectionData>, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciErrorResponse { ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRedirectionData { pub method: Option<Method>, pub parameters: Vec<Parameters>, pub url: Url, pub preconditions: Option<Vec<PreconditionData>>, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct PreconditionData { pub method: Option<Method>, pub parameters: Vec<Parameters>, pub url: Url, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] pub struct Parameters { pub name: String, pub value: String, } #[derive(Default, Debug, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ResultCode { pub(super) code: String, pub(super) description: String, pub(super) parameter_errors: Option<Vec<ErrorParameters>>, } #[derive(Default, Debug, Clone, Deserialize, PartialEq, Eq, Serialize)] pub struct ErrorParameters {
{ "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_2188691800113068569_1400_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct PreconditionData { pub method: Option<Method>, pub parameters: Vec<Parameters>, pub url: Url, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] pub struct Parameters { pub name: String, pub value: 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": 1400, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1400_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct PreconditionData { pub method: Option<Method>, pub parameters: Vec<Parameters>, pub url: Url, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] pub struct Parameters { pub name: String, pub value: String, } #[derive(Default, Debug, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ResultCode { pub(super) code: String, pub(super) description: String, pub(super) parameter_errors: Option<Vec<ErrorParameters>>, } #[derive(Default, Debug, Clone, Deserialize, PartialEq, Eq, Serialize)] pub struct ErrorParameters { pub(super) name: String, pub(super) value: Option<String>, pub(super) message: 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": 1400, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1400_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct PreconditionData { pub method: Option<Method>, pub parameters: Vec<Parameters>, pub url: Url, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] pub struct Parameters { pub name: String, pub value: String, } #[derive(Default, Debug, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ResultCode { pub(super) code: String, pub(super) description: String, pub(super) parameter_errors: Option<Vec<ErrorParameters>>, } #[derive(Default, Debug, Clone, Deserialize, PartialEq, Eq, Serialize)] pub struct ErrorParameters { pub(super) name: String, pub(super) value: Option<String>, pub(super) message: String, } impl<F, Req> TryFrom<ResponseRouterData<AciPaymentsResponse, Self>> for RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData> where Req: GetCaptureMethod, { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciPaymentsResponse, Self>) -> Result<Self, Self::Error> { let redirection_data = item.response.redirect.map(|data| { let mut form_fields = std::collections::HashMap::<_, _>::from_iter( data.parameters .iter() .map(|parameter| (parameter.name.clone(), parameter.value.clone())), ); if let Some(preconditions) = data.preconditions { if let Some(first_precondition) = preconditions.first() { for param in &first_precondition.parameters { form_fields.insert(param.name.clone(), param.value.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": 1400, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1425_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs pub(super) name: String, pub(super) value: Option<String>, pub(super) message: String, } impl<F, Req> TryFrom<ResponseRouterData<AciPaymentsResponse, Self>> for RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData> where Req: GetCaptureMethod, { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciPaymentsResponse, Self>) -> Result<Self, Self::Error> { let redirection_data = item.response.redirect.map(|data| { let mut form_fields = std::collections::HashMap::<_, _>::from_iter( data.parameters
{ "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_2188691800113068569_1425_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs pub(super) name: String, pub(super) value: Option<String>, pub(super) message: String, } impl<F, Req> TryFrom<ResponseRouterData<AciPaymentsResponse, Self>> for RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData> where Req: GetCaptureMethod, { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciPaymentsResponse, Self>) -> Result<Self, Self::Error> { let redirection_data = item.response.redirect.map(|data| { let mut form_fields = std::collections::HashMap::<_, _>::from_iter( data.parameters .iter() .map(|parameter| (parameter.name.clone(), parameter.value.clone())), ); if let Some(preconditions) = data.preconditions { if let Some(first_precondition) = preconditions.first() { for param in &first_precondition.parameters { form_fields.insert(param.name.clone(), param.value.clone()); } } } // If method is Get, parameters are appended to URL // If method is post, we http Post the method to URL RedirectForm::Form {
{ "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_2188691800113068569_1425_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs pub(super) name: String, pub(super) value: Option<String>, pub(super) message: String, } impl<F, Req> TryFrom<ResponseRouterData<AciPaymentsResponse, Self>> for RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData> where Req: GetCaptureMethod, { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciPaymentsResponse, Self>) -> Result<Self, Self::Error> { let redirection_data = item.response.redirect.map(|data| { let mut form_fields = std::collections::HashMap::<_, _>::from_iter( data.parameters .iter() .map(|parameter| (parameter.name.clone(), parameter.value.clone())), ); if let Some(preconditions) = data.preconditions { if let Some(first_precondition) = preconditions.first() { for param in &first_precondition.parameters { form_fields.insert(param.name.clone(), param.value.clone()); } } } // If method is Get, parameters are appended to URL // If method is post, we http Post the method to URL RedirectForm::Form { endpoint: data.url.to_string(), // Handles method for Bank redirects currently. // 3DS response have method within preconditions. That would require replacing below line with a function. method: data.method.unwrap_or(Method::Post), form_fields, } }); let mandate_reference = item .response .registration_id .clone() .map(|id| MandateReference { connector_mandate_id: Some(id.expose()), payment_method_id: None, }); let auto_capture = matches!( item.router_data.request.get_capture_method(), Some(common_enums::CaptureMethod::Automatic) | 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": 1425, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1450_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs } // If method is Get, parameters are appended to URL // If method is post, we http Post the method to URL RedirectForm::Form { endpoint: data.url.to_string(), // Handles method for Bank redirects currently. // 3DS response have method within preconditions. That would require replacing below line with a function. method: data.method.unwrap_or(Method::Post), form_fields, } }); let mandate_reference = item .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": 1450, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1450_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs } // If method is Get, parameters are appended to URL // If method is post, we http Post the method to URL RedirectForm::Form { endpoint: data.url.to_string(), // Handles method for Bank redirects currently. // 3DS response have method within preconditions. That would require replacing below line with a function. method: data.method.unwrap_or(Method::Post), form_fields, } }); let mandate_reference = item .response .registration_id .clone() .map(|id| MandateReference { connector_mandate_id: Some(id.expose()), payment_method_id: None, }); let auto_capture = matches!( item.router_data.request.get_capture_method(), Some(common_enums::CaptureMethod::Automatic) | None ); let status = if redirection_data.is_some() { map_aci_attempt_status(AciPaymentStatus::RedirectShopper, auto_capture) } else {
{ "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_2188691800113068569_1450_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs } // If method is Get, parameters are appended to URL // If method is post, we http Post the method to URL RedirectForm::Form { endpoint: data.url.to_string(), // Handles method for Bank redirects currently. // 3DS response have method within preconditions. That would require replacing below line with a function. method: data.method.unwrap_or(Method::Post), form_fields, } }); let mandate_reference = item .response .registration_id .clone() .map(|id| MandateReference { connector_mandate_id: Some(id.expose()), payment_method_id: None, }); let auto_capture = matches!( item.router_data.request.get_capture_method(), Some(common_enums::CaptureMethod::Automatic) | None ); let status = if redirection_data.is_some() { map_aci_attempt_status(AciPaymentStatus::RedirectShopper, auto_capture) } else { map_aci_attempt_status( AciPaymentStatus::from_str(&item.response.result.code)?, auto_capture, ) }; let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse {
{ "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_2188691800113068569_1475_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs ); let status = if redirection_data.is_some() { map_aci_attempt_status(AciPaymentStatus::RedirectShopper, auto_capture) } else { map_aci_attempt_status( AciPaymentStatus::from_str(&item.response.result.code)?, auto_capture, ) }; let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.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": 1475, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1475_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs ); let status = if redirection_data.is_some() { map_aci_attempt_status(AciPaymentStatus::RedirectShopper, auto_capture) } else { map_aci_attempt_status( AciPaymentStatus::from_str(&item.response.result.code)?, auto_capture, ) }; let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: redirection_data.map(Box::new), mandate_reference: mandate_reference.map(Box::new), connector_metadata: None, network_txn_id: 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_2188691800113068569_1475_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs ); let status = if redirection_data.is_some() { map_aci_attempt_status(AciPaymentStatus::RedirectShopper, auto_capture) } else { map_aci_attempt_status( AciPaymentStatus::from_str(&item.response.result.code)?, auto_capture, ) }; let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: redirection_data.map(Box::new), mandate_reference: mandate_reference.map(Box::new), connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.id), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciCaptureRequest {
{ "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": 1475, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1500_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: redirection_data.map(Box::new), mandate_reference: mandate_reference.map(Box::new), connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.id), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.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": 1500, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1500_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: redirection_data.map(Box::new), mandate_reference: mandate_reference.map(Box::new), connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.id), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciCaptureRequest { #[serde(flatten)] pub txn_details: TransactionDetails, } 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": 30, "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_2188691800113068569_1500_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: redirection_data.map(Box::new), mandate_reference: mandate_reference.map(Box::new), connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.id), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciCaptureRequest { #[serde(flatten)] pub txn_details: TransactionDetails, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for AciCaptureRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< 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": 50, "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_2188691800113068569_1525_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[serde(flatten)] pub txn_details: TransactionDetails, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
{ "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": 1525, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1525_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[serde(flatten)] pub txn_details: TransactionDetails, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for AciCaptureRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let amount = item .connector .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": 1525, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1525_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[serde(flatten)] pub txn_details: TransactionDetails, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, > for AciCaptureRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>, T, >, ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let amount = item .connector .amount_converter .convert( item.router_data.request.minor_amount_to_capture, item.router_data.request.currency, ) .change_context(ConnectorError::AmountConversionFailed)?; Ok(Self { txn_details: TransactionDetails { entity_id: auth.entity_id, amount, currency: item.router_data.request.currency.to_string(), payment_type: AciPaymentType::Capture, }, }) } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciCaptureResponse { 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": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1525, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1550_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let amount = item .connector .amount_converter .convert( item.router_data.request.minor_amount_to_capture, item.router_data.request.currency, ) .change_context(ConnectorError::AmountConversionFailed)?; Ok(Self { txn_details: TransactionDetails { entity_id: auth.entity_id, amount, currency: item.router_data.request.currency.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": 1550, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1550_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let amount = item .connector .amount_converter .convert( item.router_data.request.minor_amount_to_capture, item.router_data.request.currency, ) .change_context(ConnectorError::AmountConversionFailed)?; Ok(Self { txn_details: TransactionDetails { entity_id: auth.entity_id, amount, currency: item.router_data.request.currency.to_string(), payment_type: AciPaymentType::Capture, }, }) } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciCaptureResponse { id: String, referenced_id: String, payment_type: AciPaymentType, amount: StringMajorUnit, currency: String, descriptor: 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": 1550, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1550_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs ) -> Result<Self, Self::Error> { let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; let amount = item .connector .amount_converter .convert( item.router_data.request.minor_amount_to_capture, item.router_data.request.currency, ) .change_context(ConnectorError::AmountConversionFailed)?; Ok(Self { txn_details: TransactionDetails { entity_id: auth.entity_id, amount, currency: item.router_data.request.currency.to_string(), payment_type: AciPaymentType::Capture, }, }) } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciCaptureResponse { id: String, referenced_id: String, payment_type: AciPaymentType, amount: StringMajorUnit, currency: String, descriptor: String, result: AciCaptureResult, result_details: Option<AciCaptureResultDetails>, build_number: String, timestamp: String, ndc: Secret<String>, source: Option<Secret<String>>, payment_method: Option<String>, short_id: Option<String>, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciCaptureResult { code: String, description: String, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct AciCaptureResultDetails {
{ "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": 1550, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1575_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs referenced_id: String, payment_type: AciPaymentType, amount: StringMajorUnit, currency: String, descriptor: String, result: AciCaptureResult, result_details: Option<AciCaptureResultDetails>, build_number: String, timestamp: String, ndc: Secret<String>, source: Option<Secret<String>>, payment_method: Option<String>, short_id: Option<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": 1575, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1575_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs referenced_id: String, payment_type: AciPaymentType, amount: StringMajorUnit, currency: String, descriptor: String, result: AciCaptureResult, result_details: Option<AciCaptureResultDetails>, build_number: String, timestamp: String, ndc: Secret<String>, source: Option<Secret<String>>, payment_method: Option<String>, short_id: Option<String>, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciCaptureResult { code: String, description: String, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct AciCaptureResultDetails { extended_description: String, #[serde(rename = "clearingInstituteName")] clearing_institute_name: Option<String>, connector_tx_i_d1: Option<String>, connector_tx_i_d3: Option<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": 1575, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1575_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs referenced_id: String, payment_type: AciPaymentType, amount: StringMajorUnit, currency: String, descriptor: String, result: AciCaptureResult, result_details: Option<AciCaptureResultDetails>, build_number: String, timestamp: String, ndc: Secret<String>, source: Option<Secret<String>>, payment_method: Option<String>, short_id: Option<String>, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciCaptureResult { code: String, description: String, } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct AciCaptureResultDetails { extended_description: String, #[serde(rename = "clearingInstituteName")] clearing_institute_name: Option<String>, connector_tx_i_d1: Option<String>, connector_tx_i_d3: Option<String>, connector_tx_i_d2: Option<String>, acquirer_response: Option<String>, } #[derive(Debug, Default, Clone, Deserialize)] pub enum AciStatus { Succeeded, Failed, #[default] Pending, } impl FromStr for AciStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) {
{ "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": 1575, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1600_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs extended_description: String, #[serde(rename = "clearingInstituteName")] clearing_institute_name: Option<String>, connector_tx_i_d1: Option<String>, connector_tx_i_d3: Option<String>, connector_tx_i_d2: Option<String>, acquirer_response: Option<String>, } #[derive(Debug, Default, Clone, Deserialize)] pub enum AciStatus { Succeeded, Failed, #[default] 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": 1600, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1600_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs extended_description: String, #[serde(rename = "clearingInstituteName")] clearing_institute_name: Option<String>, connector_tx_i_d1: Option<String>, connector_tx_i_d3: Option<String>, connector_tx_i_d2: Option<String>, acquirer_response: Option<String>, } #[derive(Debug, Default, Clone, Deserialize)] pub enum AciStatus { Succeeded, Failed, #[default] Pending, } impl FromStr for AciStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) )))
{ "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": 1600, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1600_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs extended_description: String, #[serde(rename = "clearingInstituteName")] clearing_institute_name: Option<String>, connector_tx_i_d1: Option<String>, connector_tx_i_d3: Option<String>, connector_tx_i_d2: Option<String>, acquirer_response: Option<String>, } #[derive(Debug, Default, Clone, Deserialize)] pub enum AciStatus { Succeeded, Failed, #[default] Pending, } impl FromStr for AciStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } fn map_aci_capture_status(item: AciStatus) -> common_enums::AttemptStatus { match item { AciStatus::Succeeded => common_enums::AttemptStatus::Charged, AciStatus::Failed => common_enums::AttemptStatus::Failure, AciStatus::Pending => common_enums::AttemptStatus::Pending, } } impl<F, T> TryFrom<ResponseRouterData<AciCaptureResponse, Self>> for RouterDataV2<F, PaymentFlowData, T, PaymentsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciCaptureResponse, Self>) -> Result<Self, Self::Error> { let status = map_aci_capture_status(AciStatus::from_str(&item.response.result.code)?); let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse {
{ "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": 1600, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1625_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } fn map_aci_capture_status(item: AciStatus) -> common_enums::AttemptStatus { match item { AciStatus::Succeeded => common_enums::AttemptStatus::Charged, AciStatus::Failed => common_enums::AttemptStatus::Failure, AciStatus::Pending => common_enums::AttemptStatus::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": 1625, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1625_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } fn map_aci_capture_status(item: AciStatus) -> common_enums::AttemptStatus { match item { AciStatus::Succeeded => common_enums::AttemptStatus::Charged, AciStatus::Failed => common_enums::AttemptStatus::Failure, AciStatus::Pending => common_enums::AttemptStatus::Pending, } } impl<F, T> TryFrom<ResponseRouterData<AciCaptureResponse, Self>> for RouterDataV2<F, PaymentFlowData, T, PaymentsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciCaptureResponse, Self>) -> Result<Self, Self::Error> { let status = map_aci_capture_status(AciStatus::from_str(&item.response.result.code)?); let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(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": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1625, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1625_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } fn map_aci_capture_status(item: AciStatus) -> common_enums::AttemptStatus { match item { AciStatus::Succeeded => common_enums::AttemptStatus::Charged, AciStatus::Failed => common_enums::AttemptStatus::Failure, AciStatus::Pending => common_enums::AttemptStatus::Pending, } } impl<F, T> TryFrom<ResponseRouterData<AciCaptureResponse, Self>> for RouterDataV2<F, PaymentFlowData, T, PaymentsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciCaptureResponse, Self>) -> Result<Self, Self::Error> { let status = map_aci_capture_status(AciStatus::from_str(&item.response.result.code)?); let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.referenced_id.clone()), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { 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": 1625, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1650_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: 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": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1650, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1650_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.referenced_id.clone()), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.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": 1650, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1650_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.referenced_id.clone()), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciVoidResponse { id: String, referenced_id: String, payment_type: AciPaymentType, amount: StringMajorUnit, currency: String, descriptor: String, result: AciCaptureResult, result_details: Option<AciCaptureResultDetails>, build_number: String, timestamp: String, ndc: Secret<String>, } fn map_aci_void_status(item: AciStatus) -> common_enums::AttemptStatus {
{ "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": 1650, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1675_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciVoidResponse { id: String, referenced_id: String, payment_type: AciPaymentType, amount: StringMajorUnit,
{ "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": 1675, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1675_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciVoidResponse { id: String, referenced_id: String, payment_type: AciPaymentType, amount: StringMajorUnit, currency: String, descriptor: String, result: AciCaptureResult, result_details: Option<AciCaptureResultDetails>, build_number: String, timestamp: String, ndc: Secret<String>, } fn map_aci_void_status(item: AciStatus) -> common_enums::AttemptStatus { match item { AciStatus::Succeeded => common_enums::AttemptStatus::Voided, AciStatus::Failed => common_enums::AttemptStatus::VoidFailed, AciStatus::Pending => common_enums::AttemptStatus::VoidInitiated, }
{ "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": 1675, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1675_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciVoidResponse { id: String, referenced_id: String, payment_type: AciPaymentType, amount: StringMajorUnit, currency: String, descriptor: String, result: AciCaptureResult, result_details: Option<AciCaptureResultDetails>, build_number: String, timestamp: String, ndc: Secret<String>, } fn map_aci_void_status(item: AciStatus) -> common_enums::AttemptStatus { match item { AciStatus::Succeeded => common_enums::AttemptStatus::Voided, AciStatus::Failed => common_enums::AttemptStatus::VoidFailed, AciStatus::Pending => common_enums::AttemptStatus::VoidInitiated, } } impl<F, T> TryFrom<ResponseRouterData<AciVoidResponse, Self>> for RouterDataV2<F, PaymentFlowData, T, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(item: ResponseRouterData<AciVoidResponse, Self>) -> Result<Self, Self::Error> { let status = map_aci_void_status(AciStatus::from_str(&item.response.result.code)?); let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), ..Default::default() }) } else { Ok(PaymentsResponseData::TransactionResponse {
{ "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": 1675, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1700_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs match item { AciStatus::Succeeded => common_enums::AttemptStatus::Voided, AciStatus::Failed => common_enums::AttemptStatus::VoidFailed, AciStatus::Pending => common_enums::AttemptStatus::VoidInitiated, } } impl<F, T> TryFrom<ResponseRouterData<AciVoidResponse, Self>> for RouterDataV2<F, PaymentFlowData, T, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(item: ResponseRouterData<AciVoidResponse, Self>) -> Result<Self, Self::Error> { let status = map_aci_void_status(AciStatus::from_str(&item.response.result.code)?); let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse {
{ "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": 1700, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1700_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs match item { AciStatus::Succeeded => common_enums::AttemptStatus::Voided, AciStatus::Failed => common_enums::AttemptStatus::VoidFailed, AciStatus::Pending => common_enums::AttemptStatus::VoidInitiated, } } impl<F, T> TryFrom<ResponseRouterData<AciVoidResponse, Self>> for RouterDataV2<F, PaymentFlowData, T, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(item: ResponseRouterData<AciVoidResponse, Self>) -> Result<Self, Self::Error> { let status = map_aci_void_status(AciStatus::from_str(&item.response.result.code)?); let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), ..Default::default() }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: None, connector_metadata: None, network_txn_id: 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": 1700, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1700_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs match item { AciStatus::Succeeded => common_enums::AttemptStatus::Voided, AciStatus::Failed => common_enums::AttemptStatus::VoidFailed, AciStatus::Pending => common_enums::AttemptStatus::VoidInitiated, } } impl<F, T> TryFrom<ResponseRouterData<AciVoidResponse, Self>> for RouterDataV2<F, PaymentFlowData, T, PaymentsResponseData> { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(item: ResponseRouterData<AciVoidResponse, Self>) -> Result<Self, Self::Error> { let status = map_aci_void_status(AciStatus::from_str(&item.response.result.code)?); let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), ..Default::default() }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.referenced_id.clone()), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Default, Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRefundRequest { pub amount: StringMajorUnit,
{ "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": 1700, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1725_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.referenced_id.clone()), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.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": 1725, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1725_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.referenced_id.clone()), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Default, Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRefundRequest { pub amount: StringMajorUnit, pub currency: String, pub payment_type: AciPaymentType, pub entity_id: Secret<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": 1725, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1725_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.referenced_id.clone()), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Default, Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRefundRequest { pub amount: StringMajorUnit, pub currency: String, pub payment_type: AciPaymentType, pub entity_id: Secret<String>, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for AciRefundRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { let amount = item
{ "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": 1725, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1750_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs pub currency: String, pub payment_type: AciPaymentType, pub entity_id: Secret<String>, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData<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": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1750, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1750_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs pub currency: String, pub payment_type: AciPaymentType, pub entity_id: Secret<String>, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for AciRefundRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { let amount = item .connector .amount_converter .convert( item.router_data.request.minor_refund_amount, item.router_data.request.currency,
{ "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": 1750, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1750_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs pub currency: String, pub payment_type: AciPaymentType, pub entity_id: Secret<String>, } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< AciRouterData<RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T>, > for AciRefundRequest { type Error = error_stack::Report<ConnectorError>; fn try_from( item: AciRouterData< RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, T, >, ) -> Result<Self, Self::Error> { let amount = item .connector .amount_converter .convert( item.router_data.request.minor_refund_amount, item.router_data.request.currency, ) .change_context(ConnectorError::AmountConversionFailed)?; let currency = item.router_data.request.currency; let payment_type = AciPaymentType::Refund; let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; Ok(Self { amount, currency: currency.to_string(), payment_type, entity_id: auth.entity_id, }) } } #[derive(Debug, Default, Deserialize, Clone)] pub enum AciRefundStatus { Succeeded, Failed, #[default]
{ "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": 1750, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1775_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs .connector .amount_converter .convert( item.router_data.request.minor_refund_amount, item.router_data.request.currency, ) .change_context(ConnectorError::AmountConversionFailed)?; let currency = item.router_data.request.currency; let payment_type = AciPaymentType::Refund; let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; Ok(Self { amount, currency: currency.to_string(), payment_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": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1775, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1775_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs .connector .amount_converter .convert( item.router_data.request.minor_refund_amount, item.router_data.request.currency, ) .change_context(ConnectorError::AmountConversionFailed)?; let currency = item.router_data.request.currency; let payment_type = AciPaymentType::Refund; let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; Ok(Self { amount, currency: currency.to_string(), payment_type, entity_id: auth.entity_id, }) } } #[derive(Debug, Default, Deserialize, Clone)] pub enum AciRefundStatus { Succeeded, Failed, #[default] Pending, } impl FromStr for AciRefundStatus { type Err = 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": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1775, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1775_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs .connector .amount_converter .convert( item.router_data.request.minor_refund_amount, item.router_data.request.currency, ) .change_context(ConnectorError::AmountConversionFailed)?; let currency = item.router_data.request.currency; let payment_type = AciPaymentType::Refund; let auth = AciAuthType::try_from(&item.router_data.connector_auth_type)?; Ok(Self { amount, currency: currency.to_string(), payment_type, entity_id: auth.entity_id, }) } } #[derive(Debug, Default, Deserialize, Clone)] pub enum AciRefundStatus { Succeeded, Failed, #[default] Pending, } impl FromStr for AciRefundStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } impl From<AciRefundStatus> for common_enums::RefundStatus { fn from(item: AciRefundStatus) -> Self { match item { AciRefundStatus::Succeeded => Self::Success, AciRefundStatus::Failed => Self::Failure,
{ "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": 1775, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1800_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs Pending, } impl FromStr for AciRefundStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned())
{ "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": 1800, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1800_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs Pending, } impl FromStr for AciRefundStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } impl From<AciRefundStatus> for common_enums::RefundStatus { fn from(item: AciRefundStatus) -> Self { match item { AciRefundStatus::Succeeded => Self::Success, AciRefundStatus::Failed => Self::Failure, AciRefundStatus::Pending => Self::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": 1800, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1800_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs Pending, } impl FromStr for AciRefundStatus { type Err = error_stack::Report<errors::ConnectorError>; fn from_str(s: &str) -> Result<Self, Self::Err> { if FAILURE_CODES.contains(&s) { Ok(Self::Failed) } else if PENDING_CODES.contains(&s) { Ok(Self::Pending) } else if SUCCESSFUL_CODES.contains(&s) { Ok(Self::Succeeded) } else { Err(report!(errors::ConnectorError::UnexpectedResponseError( bytes::Bytes::from(s.to_owned()) ))) } } } impl From<AciRefundStatus> for common_enums::RefundStatus { fn from(item: AciRefundStatus) -> Self { match item { AciRefundStatus::Succeeded => Self::Success, AciRefundStatus::Failed => Self::Failure, AciRefundStatus::Pending => Self::Pending, } } } #[allow(dead_code)] #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRefundResponse { id: String, ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, } impl<F> TryFrom<ResponseRouterData<AciRefundResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciRefundResponse, Self>) -> Result<Self, Self::Error> { let refund_status = common_enums::RefundStatus::from(AciRefundStatus::from_str( &item.response.result.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": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1800, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1825_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs AciRefundStatus::Pending => Self::Pending, } } } #[allow(dead_code)] #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRefundResponse { id: String, ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, }
{ "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": 1825, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1825_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs AciRefundStatus::Pending => Self::Pending, } } } #[allow(dead_code)] #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRefundResponse { id: String, ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, } impl<F> TryFrom<ResponseRouterData<AciRefundResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciRefundResponse, Self>) -> Result<Self, Self::Error> { let refund_status = common_enums::RefundStatus::from(AciRefundStatus::from_str( &item.response.result.code, )?); let response = if refund_status == common_enums::RefundStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description),
{ "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": 1825, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1825_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs AciRefundStatus::Pending => Self::Pending, } } } #[allow(dead_code)] #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciRefundResponse { id: String, ndc: String, timestamp: String, build_number: String, pub(super) result: ResultCode, } impl<F> TryFrom<ResponseRouterData<AciRefundResponse, Self>> for RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciRefundResponse, Self>) -> Result<Self, Self::Error> { let refund_status = common_enums::RefundStatus::from(AciRefundStatus::from_str( &item.response.result.code, )?); let response = if refund_status == common_enums::RefundStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: None, connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(RefundsResponseData { connector_refund_id: item.response.id, refund_status, status_code: item.http_code, }) }; Ok(Self { response, ..item.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": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1825, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1850_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs let response = if refund_status == common_enums::RefundStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: None, connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(RefundsResponseData { connector_refund_id: item.response.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": 1850, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1850_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs let response = if refund_status == common_enums::RefundStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: None, connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(RefundsResponseData { connector_refund_id: item.response.id, refund_status, status_code: item.http_code, }) }; Ok(Self { response, ..item.router_data }) } } impl< F, T: PaymentMethodDataTypes + std::fmt::Debug
{ "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": 1850, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1850_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs let response = if refund_status == common_enums::RefundStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: None, connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(RefundsResponseData { connector_refund_id: item.response.id, refund_status, status_code: item.http_code, }) }; Ok(Self { response, ..item.router_data }) } } impl< F, T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<ResponseRouterData<AciMandateResponse, Self>> for RouterDataV2<F, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciMandateResponse, Self>) -> Result<Self, Self::Error> { let mandate_reference = Some(MandateReference { connector_mandate_id: Some(item.response.id.clone()), payment_method_id: None, }); let status = if SUCCESSFUL_CODES.contains(&item.response.result.code.as_str()) { common_enums::AttemptStatus::Charged } else if FAILURE_CODES.contains(&item.response.result.code.as_str()) { common_enums::AttemptStatus::Failure } else { common_enums::AttemptStatus::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": 1850, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1875_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs impl< F, T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<ResponseRouterData<AciMandateResponse, Self>> for RouterDataV2<F, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciMandateResponse, Self>) -> Result<Self, Self::Error> { let mandate_reference = Some(MandateReference {
{ "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": 1875, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1875_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs impl< F, T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<ResponseRouterData<AciMandateResponse, Self>> for RouterDataV2<F, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciMandateResponse, Self>) -> Result<Self, Self::Error> { let mandate_reference = Some(MandateReference { connector_mandate_id: Some(item.response.id.clone()), payment_method_id: None, }); let status = if SUCCESSFUL_CODES.contains(&item.response.result.code.as_str()) { common_enums::AttemptStatus::Charged } else if FAILURE_CODES.contains(&item.response.result.code.as_str()) { common_enums::AttemptStatus::Failure } else { common_enums::AttemptStatus::Pending }; let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.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": 1875, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1875_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs impl< F, T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<ResponseRouterData<AciMandateResponse, Self>> for RouterDataV2<F, PaymentFlowData, SetupMandateRequestData<T>, PaymentsResponseData> { type Error = error_stack::Report<ConnectorError>; fn try_from(item: ResponseRouterData<AciMandateResponse, Self>) -> Result<Self, Self::Error> { let mandate_reference = Some(MandateReference { connector_mandate_id: Some(item.response.id.clone()), payment_method_id: None, }); let status = if SUCCESSFUL_CODES.contains(&item.response.result.code.as_str()) { common_enums::AttemptStatus::Charged } else if FAILURE_CODES.contains(&item.response.result.code.as_str()) { common_enums::AttemptStatus::Failure } else { common_enums::AttemptStatus::Pending }; let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: mandate_reference.map(Box::new), connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.id), incremental_authorization_allowed: None, status_code: item.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": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1875, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1900_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs }; let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else {
{ "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": 1900, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1900_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs }; let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: mandate_reference.map(Box::new), connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.id), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { 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": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1900, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1900_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs }; let response = if status == common_enums::AttemptStatus::Failure { Err(ErrorResponse { code: item.response.result.code.clone(), message: item.response.result.description.clone(), reason: Some(item.response.result.description), status_code: item.http_code, attempt_status: Some(status), connector_transaction_id: Some(item.response.id.clone()), network_decline_code: None, network_advice_code: None, network_error_message: None, }) } else { Ok(PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()), redirection_data: None, mandate_reference: mandate_reference.map(Box::new), connector_metadata: None, network_txn_id: None, connector_response_reference_id: Some(item.response.id), incremental_authorization_allowed: None, status_code: item.http_code, }) }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] pub enum AciWebhookEventType { Payment, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] pub enum AciWebhookAction { Created, Updated, Deleted, }
{ "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": 1900, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1925_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] pub enum AciWebhookEventType {
{ "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": 1925, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1925_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] pub enum AciWebhookEventType { Payment, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] pub enum AciWebhookAction { Created, Updated, Deleted, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookCardDetails { pub bin: Option<String>, #[serde(rename = "last4Digits")]
{ "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": 1925, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1925_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs }; Ok(Self { resource_common_data: PaymentFlowData { status, ..item.router_data.resource_common_data }, response, ..item.router_data }) } } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] pub enum AciWebhookEventType { Payment, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] pub enum AciWebhookAction { Created, Updated, Deleted, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookCardDetails { pub bin: Option<String>, #[serde(rename = "last4Digits")] pub last4_digits: Option<String>, pub holder: Option<String>, pub expiry_month: Option<Secret<String>>, pub expiry_year: Option<Secret<String>>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookCustomerDetails { #[serde(rename = "givenName")] pub given_name: Option<Secret<String>>, pub surname: Option<Secret<String>>, #[serde(rename = "merchantCustomerId")] pub merchant_customer_id: Option<Secret<String>>, pub sex: Option<Secret<String>>, pub email: Option<Email>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")]
{ "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": 1925, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1950_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookCardDetails { pub bin: Option<String>, #[serde(rename = "last4Digits")] pub last4_digits: Option<String>, pub holder: Option<String>, pub expiry_month: Option<Secret<String>>, pub expiry_year: Option<Secret<String>>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookCustomerDetails { #[serde(rename = "givenName")]
{ "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": 1950, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1950_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookCardDetails { pub bin: Option<String>, #[serde(rename = "last4Digits")] pub last4_digits: Option<String>, pub holder: Option<String>, pub expiry_month: Option<Secret<String>>, pub expiry_year: Option<Secret<String>>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookCustomerDetails { #[serde(rename = "givenName")] pub given_name: Option<Secret<String>>, pub surname: Option<Secret<String>>, #[serde(rename = "merchantCustomerId")] pub merchant_customer_id: Option<Secret<String>>, pub sex: Option<Secret<String>>, pub email: Option<Email>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookAuthenticationDetails { #[serde(rename = "entityId")] pub entity_id: Secret<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": 1950, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1950_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookCardDetails { pub bin: Option<String>, #[serde(rename = "last4Digits")] pub last4_digits: Option<String>, pub holder: Option<String>, pub expiry_month: Option<Secret<String>>, pub expiry_year: Option<Secret<String>>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookCustomerDetails { #[serde(rename = "givenName")] pub given_name: Option<Secret<String>>, pub surname: Option<Secret<String>>, #[serde(rename = "merchantCustomerId")] pub merchant_customer_id: Option<Secret<String>>, pub sex: Option<Secret<String>>, pub email: Option<Email>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookAuthenticationDetails { #[serde(rename = "entityId")] pub entity_id: Secret<String>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookRiskDetails { pub score: Option<String>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciPaymentWebhookPayload { pub id: String, pub payment_type: String, pub payment_brand: String, pub amount: StringMajorUnit, pub currency: String, pub presentation_amount: Option<StringMajorUnit>, pub presentation_currency: Option<String>, pub descriptor: Option<String>, pub result: ResultCode, pub authentication: Option<AciWebhookAuthenticationDetails>, pub card: Option<AciWebhookCardDetails>,
{ "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": 1950, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1975_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs pub struct AciWebhookAuthenticationDetails { #[serde(rename = "entityId")] pub entity_id: Secret<String>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookRiskDetails { pub score: Option<String>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciPaymentWebhookPayload { pub 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": 1975, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1975_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs pub struct AciWebhookAuthenticationDetails { #[serde(rename = "entityId")] pub entity_id: Secret<String>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookRiskDetails { pub score: Option<String>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciPaymentWebhookPayload { pub id: String, pub payment_type: String, pub payment_brand: String, pub amount: StringMajorUnit, pub currency: String, pub presentation_amount: Option<StringMajorUnit>, pub presentation_currency: Option<String>, pub descriptor: Option<String>, pub result: ResultCode, pub authentication: Option<AciWebhookAuthenticationDetails>, pub card: Option<AciWebhookCardDetails>, pub customer: Option<AciWebhookCustomerDetails>, #[serde(rename = "customParameters")] pub custom_parameters: Option<serde_json::Value>, pub risk: Option<AciWebhookRiskDetails>, pub build_number: Option<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": 1975, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_2188691800113068569_1975_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/aci/transformers.rs pub struct AciWebhookAuthenticationDetails { #[serde(rename = "entityId")] pub entity_id: Secret<String>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookRiskDetails { pub score: Option<String>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciPaymentWebhookPayload { pub id: String, pub payment_type: String, pub payment_brand: String, pub amount: StringMajorUnit, pub currency: String, pub presentation_amount: Option<StringMajorUnit>, pub presentation_currency: Option<String>, pub descriptor: Option<String>, pub result: ResultCode, pub authentication: Option<AciWebhookAuthenticationDetails>, pub card: Option<AciWebhookCardDetails>, pub customer: Option<AciWebhookCustomerDetails>, #[serde(rename = "customParameters")] pub custom_parameters: Option<serde_json::Value>, pub risk: Option<AciWebhookRiskDetails>, pub build_number: Option<String>, pub timestamp: String, pub ndc: String, #[serde(rename = "channelName")] pub channel_name: Option<String>, pub source: Option<String>, pub payment_method: Option<String>, #[serde(rename = "shortId")] pub short_id: Option<String>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AciWebhookNotification { #[serde(rename = "type")] pub event_type: AciWebhookEventType, pub action: Option<AciWebhookAction>, pub payload: serde_json::Value, } #[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": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 1975, "struct_name": null, "total_crates": null, "trait_name": null }