{"record":{"id":"52f592022a832eac","repo":"juspay/hyperswitch","slug":"worldpayxml-requires-signaturekey-auth-type","errorCode":null,"errorMessage":"Worldpayxml requires SignatureKey auth type","messagePattern":"Worldpayxml requires SignatureKey auth type","errorType":"error_code","errorClass":"ApiErrorResponse","httpStatus":500,"severity":"error","filePath":"crates/router/src/core/unified_connector_service/connector_config.rs","lineNumber":1587,"sourceCode":"                    let worldpayxml_meta = metadata\n                        .map(|m| {\n                            serde_json::from_value::<WorldpayxmlMetadata>(m.clone())\n                                .map_err(|_| err(\"Invalid Worldpayxml metadata format\"))\n                        })\n                        .transpose()?;\n\n                    Ok(Self::Worldpayxml {\n                        api_username: api_key.clone(),\n                        api_password: key1.clone(),\n                        merchant_code: api_secret.clone(),\n                        issuer_id: worldpayxml_meta.as_ref().and_then(|m| m.issuer_id.clone()),\n                        organizational_unit_id: worldpayxml_meta\n                            .as_ref()\n                            .and_then(|m| m.organizational_unit_id.clone()),\n                        jwt_mac_key: worldpayxml_meta.as_ref().and_then(|m| m.jwt_mac_key.clone()),\n                    })\n                }\n                _ => Err(err(\"Worldpayxml requires SignatureKey auth type\")),\n            },\n            Connector::Zift => match auth {\n                ConnectorAuthType::SignatureKey {\n                    api_key,\n                    key1,\n                    api_secret,\n                } => Ok(Self::Zift {\n                    user_name: api_key.clone(),\n                    password: api_secret.clone(),\n                    account_id: key1.clone(),\n                }),\n                _ => Err(err(\"Zift requires SignatureKey auth type\")),\n            },\n            Connector::Forte => match auth {\n                ConnectorAuthType::MultiAuthKey {\n                    api_key,\n                    key1,\n                    api_secret,","sourceCodeStart":1569,"sourceCodeEnd":1605,"githubUrl":"https://github.com/juspay/hyperswitch/blob/3093f22cc46b46415cca152ea0b234277b251ecd/crates/router/src/core/unified_connector_service/connector_config.rs#L1569-L1605","documentation":"This error is thrown while building the Worldpayxml connector configuration when the provided `ConnectorAuthType` is anything other than `SignatureKey` (the wildcard `_` arm). Worldpayxml's integration maps api_key/key1/api_secret to api_username/api_password/merchant_code, so it can only be constructed from SignatureKey credentials; using e.g. HeaderKey, BodyKey, or NoKey auth triggers this error. It is a configuration/auth-type mismatch, not a network or credential-validity failure.","triggerScenarios":"Attempting the connector config conversion for `Connector::Worldpayxml` while the merchant connector account was configured with any `ConnectorAuthType` variant other than `SignatureKey { api_key, key1, api_secret }` — for example a single API key (`HeaderKey`/`BodyKey`), certificate auth, or no auth.","commonSituations":"Merchant connector account created with the wrong auth type selected in the dashboard; migration/import of connector credentials from another processor storing them in a different auth shape; programmatic connector setup where the auth enum was built generically without checking the connector's requirements.","solutions":["Reconfigure the Worldpayxml merchant connector account to use SignatureKey auth: api_key = Worldpayxml username, key1 = password, api_secret = merchant_code.","In code, match on the auth type before conversion and map single-key credentials into a `ConnectorAuthType::SignatureKey` value, or return a clear validation error to the caller.","Check how the connector auth type is selected during account creation (dashboard form or API payload) and restrict Worldpayxml to the SignatureKey option."],"exampleFix":"// before\nlet auth = ConnectorAuthType::HeaderKey { api_key: user };\n// after\nlet auth = ConnectorAuthType::SignatureKey {\n    api_key: user,\n    key1: password,\n    api_secret: merchant_code,\n};","handlingStrategy":"type-guard","validationCode":"fn ensure_signature_key(auth: &ConnectorAuthType) -> Result<(), String> {\n    match auth {\n        ConnectorAuthType::SignatureKey { .. } => Ok(()),\n        other => Err(format!(\"Worldpayxml requires SignatureKey auth, got {}\", std::mem::discriminant(other)),\n    }\n}","typeGuard":"fn is_signature_key(auth: &ConnectorAuthType) -> bool {\n    matches!(auth, ConnectorAuthType::SignatureKey { .. })\n}","tryCatchPattern":"let config = ConnectorConfig::from(auth, Connector::Worldpayxml, metadata)\n    .map_err(|e| match e.current().to_string().as_str() {\n        \"Worldpayxml requires SignatureKey auth type\" => AppError::ConnectorMisconfigured(\"worldpayxml\", \"auth_type\"),\n        _ => AppError::Internal(e),\n    })?;","preventionTips":["When creating a Worldpayxml merchant connector account, always select SignatureKey auth and supply all three fields (api_key, key1, api_secret).","Guard the auth type with matches! before invoking connector config conversion for Worldpayxml.","Restrict the auth-type options in your dashboard/form per connector so unsupported types can't be chosen.","Centralize per-connector auth-type requirements in one table/constant instead of relying on the runtime match arm."],"tags":["authentication","worldpayxml","configuration","connector-config","auth-type"],"backgroundTag":"invalid-config-value","analyzedSha":"3093f22cc46b46415cca152ea0b234277b251ecd","analyzedAt":"2026-09-09T12:35:17.659Z","contentChangedAt":"2026-09-09T12:35:17.659Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}