{"record":{"id":"1bfc1cabf7d2fac3","repo":"juspay/hyperswitch","slug":"todo","errorCode":null,"errorMessage":"todo!()","messagePattern":"todo!\\(\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/router/src/core/payouts.rs","lineNumber":4222,"sourceCode":"    #[cfg(feature = \"v2\")]\n    {\n        None // V2 does not use feature metadata for gateway system tracking\n    }\n}\n\n#[cfg(feature = \"v2\")]\n#[allow(clippy::too_many_arguments)]\n#[allow(clippy::type_complexity)]\n#[instrument(skip_all)]\npub async fn decide_unified_connector_service_payout<F: Clone>(\n    state: &SessionState,\n    platform: &domain::Platform,\n    header_payload: HeaderPayload,\n    router_data: &types::RouterData<F, types::PayoutsData, types::PayoutsResponseData>,\n    connector_data: &api::ConnectorData,\n    payout_data: &mut PayoutData,\n) -> RouterResult<(gateway_context::RouterGatewayContext, SessionState)> {\n    todo!()\n}\n\n/// Updates the payout intent's metadata to track the gateway system being used.\n/// Merges gateway_system into the existing metadata map so merchant-provided fields are preserved.\n#[cfg(feature = \"v1\")]\npub fn update_gateway_system_in_payout_metadata(\n    payout_data: &mut PayoutData,\n    gateway_system: common_enums::GatewaySystem,\n) -> RouterResult<()> {\n    let gateway_system_metadata = FeatureMetadata {\n        gateway_system: Some(gateway_system),\n        ..Default::default()\n    };\n\n    let gateway_system_metadata_value = serde_json::to_value(gateway_system_metadata)\n        .change_context(errors::ApiErrorResponse::InternalServerError)\n        .attach_printable(\"Failed to serialize gateway_system metadata\")?;\n","sourceCodeStart":4204,"sourceCodeEnd":4240,"githubUrl":"https://github.com/juspay/hyperswitch/blob/afd92843521ced2c6856b98ae4ea332e75102d88/crates/router/src/core/payouts.rs#L4204-L4240","documentation":"This is a Rust `todo!()` panic: the function `get_gateway_context` (or similar) in crates/router/src/core/payouts.rs is declared but intentionally unimplemented, so calling it panics with 'not yet implemented' at line 4222. It is a deliberate placeholder, not a runtime condition.","triggerScenarios":"Any call into the payout gateway-context/session preparation path that reaches this stubbed function (e.g. executing a payout flow that requests the RouterGatewayContext + SessionState for a connector).","commonSituations":"Developers wiring up payout connector integration or calling core payout APIs in an in-progress refactor hit the panic at runtime; the crate compiles because todo!() type-checks as RouterResult.","solutions":["Implement the function body to construct and return the (RouterGatewayContext, SessionState) tuple","If the flow is not meant to be reachable, return a typed RouterResult error instead of todo!() so callers fail gracefully","Gate the call site behind a feature flag or config check until the implementation lands"],"exampleFix":"// before\n) -> RouterResult<(gateway_context::RouterGatewayContext, SessionState)> {\n    todo!()\n}\n// after\n) -> RouterResult<(gateway_context::RouterGatewayContext, SessionState)> {\n    let gateway_context = gateway_context::RouterGatewayContext { /* build from router_data */ };\n    let session_state = SessionState::new(header_payload, payout_data);\n    Ok((gateway_context, session_state))\n}","handlingStrategy":"validation","validationCode":"if cfg!(feature = \"payouts\") && is_gateway_context_stubbed() { return Err(error_stack::report!(errors::PayoutsError::NotImplemented)); }","typeGuard":"fn is_implemented(f: &dyn Fn() -> RouterResult<(RouterGatewayContext, SessionState)>) -> bool { !std::ptr::eq(f as *const _, &stub as *const _) } // prefer: feature-flag/config guard over runtime probing","tryCatchPattern":"match result { Err(e) if e.is_not_implemented() => fallback_gateway_context(), other => other }","preventionTips":["Track all todo!() call sites with CI grep/lint gates","Return typed NotImplemented errors instead of todo!() in library code"],"tags":["rust","unimplemented","payouts","panic"],"backgroundTag":"method-not-implemented","analyzedSha":"afd92843521ced2c6856b98ae4ea332e75102d88","analyzedAt":"2026-09-18T01:18:02.947Z","contentChangedAt":"2026-09-18T01:18:02.947Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}