{"record":{"id":"00c3e34508b3a3d5","repo":"juspay/hyperswitch","slug":"globalpay-requires-bodykey-auth-type","errorCode":null,"errorMessage":"Globalpay requires BodyKey auth type","messagePattern":"Globalpay requires BodyKey auth type","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/router/src/core/unified_connector_service/connector_config.rs","lineNumber":1074,"sourceCode":"                }),\n                _ => Err(err(\"Datatrans requires BodyKey auth type\")),\n            },\n            Connector::Globalpay => match auth {\n                ConnectorAuthType::BodyKey { api_key, key1 } => {\n                    let globalpay_meta = metadata\n                        .map(|m| {\n                            serde_json::from_value::<GlobalpayMetadata>(m.clone())\n                                .map_err(|_| err(\"Invalid Globalpay metadata format\"))\n                        })\n                        .transpose()?;\n\n                    Ok(Self::Globalpay {\n                        app_id: key1.clone(),\n                        app_key: api_key.clone(),\n                        account_name: globalpay_meta.and_then(|m| m.account_name),\n                    })\n                }\n                _ => Err(err(\"Globalpay requires BodyKey auth type\")),\n            },\n            Connector::Hipay => match auth {\n                ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self::Hipay {\n                    api_key: api_key.clone(),\n                    api_secret: key1.clone(),\n                }),\n                _ => Err(err(\"Hipay requires BodyKey auth type\")),\n            },\n            Connector::Jpmorgan => match auth {\n                ConnectorAuthType::BodyKey { api_key, key1 } => {\n                    let jpm_meta = metadata\n                        .map(|m| {\n                            m.clone()\n                                .parse_value::<JpmorganMetadata>(\"JpmorganMetadata\")\n                                .change_context(errors::ApiErrorResponse::InternalServerError)\n                                .attach_printable(\"Invalid Jpmorgan metadata format\")\n                        })\n                        .transpose()?;","sourceCodeStart":1056,"sourceCodeEnd":1092,"githubUrl":"https://github.com/juspay/hyperswitch/blob/afd92843521ced2c6856b98ae4ea332e75102d88/crates/router/src/core/unified_connector_service/connector_config.rs#L1056-L1092","documentation":"Globalpay authenticates with app credentials sent in the request body (app_id + app_key), so the unified connector config accepts only `ConnectorAuthType::BodyKey` (with `key1` as app_id and `api_key` as app_key). Any other auth type falls into the catch-all arm and returns this error instead of building `Self::Globalpay`.","triggerScenarios":"Configuring the Globalpay connector with `SignatureKey`, `HeaderKey`, `CertificateKey`, or `NoKey` auth types, then performing any operation that resolves connector config in `connector_config.rs`.","commonSituations":"Merchant enters Globalpay credentials under a SignatureKey-style connector template; automated provisioning scripts default to HeaderKey; credentials copied from another connector's config shape.","solutions":["Re-save the Globalpay connector credential as `ConnectorAuthType::BodyKey` with app_key in `api_key` and app_id in `key1`","Optionally include conforming Globalpay metadata (account_name) in the same call","Migrate any wrongly-shaped stored credentials for Globalpay merchants","Retry a test transaction after updating the connector config"],"exampleFix":"// before\nConnectorAuthType::SignatureKey { api_key, key1, api_secret }\n// after\nConnectorAuthType::BodyKey { api_key: app_key, key1: app_id }","handlingStrategy":"validation","validationCode":"fn is_globalpay_auth(auth: &ConnectorAuthType) -> bool {\n    matches!(auth, ConnectorAuthType::BodyKey { .. })\n}\nif !is_globalpay_auth(&auth) {\n    return Err(report!(ConfigError::InvalidConnectorAuth(\"Globalpay requires BodyKey\")));\n}","typeGuard":"fn as_body_key(auth: &ConnectorAuthType) -> Option<(&String, &String)> {\n    match auth {\n        ConnectorAuthType::BodyKey { api_key, key1 } => Some((api_key, key1)),\n        _ => None,\n    }\n}","tryCatchPattern":"match build_connector_config(Connector::Globalpay, &auth, metadata) {\n    Ok(cfg) => use_config(cfg),\n    Err(e) if e.current_context().to_string().contains(\"BodyKey\") => {\n        // re-collect Globalpay app_id/app_key as BodyKey\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Enforce the BodyKey layout in the Globalpay connector onboarding form","Require both app_id (key1) and app_key (api_key) at entry time","Add compile-time or config-time checks mapping connector -> expected auth type"],"tags":["rust","authentication","connector-config","globalpay"],"backgroundTag":"unsupported-enum-value","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"}