Language: Python
Label: safe
CWE: CWE-203 \u2014 Observable Discrepancy
The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor, which exposes security-relevant information about the state of the product, such as whether a particular operation was successful or not.

Code:
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        configuration = {item["name"]: item["value"] for item in self.configuration}
        self.config = GatewayConfig(
            gateway_name=GATEWAY_NAME,
            auto_capture=configuration[
                "Automatically mark payment as a capture"
            ],  # FIXME check this
            supported_currencies=configuration["Supported currencies"],
            connection_params={
                "api_key": configuration["API key"],
                "merchant_account": configuration["Merchant Account"],
                "return_url": configuration["Return Url"],
                "origin_key": configuration["Origin Key"],
                "origin_url": configuration["Origin Url"],
                "live": configuration["Live"],
                "webhook_hmac": configuration["HMAC secret key"],
                "webhook_user": configuration["Notification user"],
                "webhook_user_password": configuration["Notification password"],
            },
        )
        api_key = self.config.connection_params["api_key"]
        self.adyen = Adyen.Adyen(xapikey=api_key)