src/core/DeCaptchaAbstract.php
protected function decodeResponse($action, $data)
    {
        if (!array_key_exists($action, $this->decodeSettings[static::DECODE_ACTION])) {
            throw new DeCaptchaErrors('нет action');
        }
        $decodeSetting = $this->decodeSettings[static::DECODE_ACTION][$action];
        $decodeFormat = array_key_exists(static::DECODE_FORMAT, $decodeSetting) ?
            $decodeSetting[static::DECODE_FORMAT] :
            $this->decodeSettings[static::DECODE_FORMAT];
        $values = [];
        switch ($decodeFormat) {
            case static::RESPONSE_TYPE_STRING:
                foreach (explode($decodeSetting[static::DECODE_SEPARATOR], $data) as $key => $value) {
                    foreach ($decodeSetting[static::DECODE_PARAMS] as $param => $paramSetting) {
                        if ($key === $paramSetting[static::DECODE_PARAM_SETTING_MARKER]) {
                            $values[$param] = $value;
                        }
                    }
                }
                break;
            case static::RESPONSE_TYPE_JSON:
                foreach (json_decode($data, true) as $key => $value) {
                    foreach ($decodeSetting[static::DECODE_PARAMS] as $param => $paramSetting) {
                        if (count(explode('.', $paramSetting[static::DECODE_PARAM_SETTING_MARKER])) > 1) {
                            if ($key === explode('.', $paramSetting[static::DECODE_PARAM_SETTING_MARKER])[0]) {
                                if (array_key_exists(explode('.', $paramSetting[static::DECODE_PARAM_SETTING_MARKER])[1], $value)) {
                                    $values[$param] = $value[explode('.', $paramSetting[static::DECODE_PARAM_SETTING_MARKER])[1]];
                                }
                            }
                        }
                        if ($key === $paramSetting[static::DECODE_PARAM_SETTING_MARKER]) {
                            $values[$param] = $value;
                        }
                    }
                }
                break;
        }

        return $values;
    }
protected function decodeResponse($action, $data)
    {
        if (!array_key_exists($action, $this->decodeSettings[static::DECODE_ACTION])) {
            throw new DeCaptchaErrors('нет action');
        }
        $decodeSetting = $this->decodeSettings[static::DECODE_ACTION][$action];
        $decodeFormat = array_key_exists(static::DECODE_FORMAT, $decodeSetting) ?
            $decodeSetting[static::DECODE_FORMAT] :
            $this->decodeSettings[static::DECODE_FORMAT];
        $values = [];
        switch ($decodeFormat) {
            case static::RESPONSE_TYPE_STRING:
                foreach (explode($decodeSetting[static::DECODE_SEPARATOR], $data) as $key => $value) {
                    foreach ($decodeSetting[static::DECODE_PARAMS] as $param => $paramSetting) {
                        if ($key === $paramSetting[static::DECODE_PARAM_SETTING_MARKER]) {
                            $values[$param] = $value;
                        }
                    }
                }
                break;
            case static::RESPONSE_TYPE_JSON:
                foreach (json_decode($data, true) as $key => $value) {
                    foreach ($decodeSetting[static::DECODE_PARAMS] as $param => $paramSetting) {
                        if (count(explode('.', $paramSetting[static::DECODE_PARAM_SETTING_MARKER])) > 1) {
                            if ($key === explode('.', $paramSetting[static::DECODE_PARAM_SETTING_MARKER])[0]) {
                                if (array_key_exists(explode('.', $paramSetting[static::DECODE_PARAM_SETTING_MARKER])[1], $value)) {
                                    $values[$param] = $value[explode('.', $paramSetting[static::DECODE_PARAM_SETTING_MARKER])[1]];
                                }
                            }
                        }
                        if ($key === $paramSetting[static::DECODE_PARAM_SETTING_MARKER]) {
                            $values[$param] = $value;
                        }
                    }
                }
                break;
        }

        return $values;
    }
@param $action
@param $data

@throws DeCaptchaErrors

@return array