juspay/hyperswitch · error · ApiErrorResponse

Worldpayxml requires SignatureKey auth type

Error message

Worldpayxml requires SignatureKey auth type

What it means

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.

Source

Thrown at crates/router/src/core/unified_connector_service/connector_config.rs:1587

                    let worldpayxml_meta = metadata
                        .map(|m| {
                            serde_json::from_value::<WorldpayxmlMetadata>(m.clone())
                                .map_err(|_| err("Invalid Worldpayxml metadata format"))
                        })
                        .transpose()?;

                    Ok(Self::Worldpayxml {
                        api_username: api_key.clone(),
                        api_password: key1.clone(),
                        merchant_code: api_secret.clone(),
                        issuer_id: worldpayxml_meta.as_ref().and_then(|m| m.issuer_id.clone()),
                        organizational_unit_id: worldpayxml_meta
                            .as_ref()
                            .and_then(|m| m.organizational_unit_id.clone()),
                        jwt_mac_key: worldpayxml_meta.as_ref().and_then(|m| m.jwt_mac_key.clone()),
                    })
                }
                _ => Err(err("Worldpayxml requires SignatureKey auth type")),
            },
            Connector::Zift => match auth {
                ConnectorAuthType::SignatureKey {
                    api_key,
                    key1,
                    api_secret,
                } => Ok(Self::Zift {
                    user_name: api_key.clone(),
                    password: api_secret.clone(),
                    account_id: key1.clone(),
                }),
                _ => Err(err("Zift requires SignatureKey auth type")),
            },
            Connector::Forte => match auth {
                ConnectorAuthType::MultiAuthKey {
                    api_key,
                    key1,
                    api_secret,

View on GitHub (pinned to 3093f22cc4)

Solutions

  1. Reconfigure the Worldpayxml merchant connector account to use SignatureKey auth: api_key = Worldpayxml username, key1 = password, api_secret = merchant_code.
  2. 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.
  3. Check how the connector auth type is selected during account creation (dashboard form or API payload) and restrict Worldpayxml to the SignatureKey option.

Example fix

// before
let auth = ConnectorAuthType::HeaderKey { api_key: user };
// after
let auth = ConnectorAuthType::SignatureKey {
    api_key: user,
    key1: password,
    api_secret: merchant_code,
};
Defensive patterns

Strategy: type-guard

Validate before calling

fn ensure_signature_key(auth: &ConnectorAuthType) -> Result<(), String> {
    match auth {
        ConnectorAuthType::SignatureKey { .. } => Ok(()),
        other => Err(format!("Worldpayxml requires SignatureKey auth, got {}", std::mem::discriminant(other)),
    }
}

Type guard

fn is_signature_key(auth: &ConnectorAuthType) -> bool {
    matches!(auth, ConnectorAuthType::SignatureKey { .. })
}

Try / catch

let config = ConnectorConfig::from(auth, Connector::Worldpayxml, metadata)
    .map_err(|e| match e.current().to_string().as_str() {
        "Worldpayxml requires SignatureKey auth type" => AppError::ConnectorMisconfigured("worldpayxml", "auth_type"),
        _ => AppError::Internal(e),
    })?;

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of juspay/hyperswitch@3093f22cc4 (2026-09-09). Data as JSON: /api/errors/52f592022a832eac. Report an issue: GitHub.