def verify_recaptcha(options = {})
      options = {model: options} unless options.is_a? Hash
      return true if Recaptcha::Verify.skip?(options[:env])

      model = options[:model]
      attribute = options[:attribute] || :base
      recaptcha_response = options[:response] || params['g-recaptcha-response'].to_s

      begin
        verified = if recaptcha_response.empty? || recaptcha_response.length > G_RESPONSE_LIMIT
          false
        else
          recaptcha_verify_via_api_call(request, recaptcha_response, options)
        end

        if verified
          flash.delete(:recaptcha_error) if recaptcha_flash_supported? && !model
          true
        else
          recaptcha_error(
            model,
            attribute,
            options[:message],
            "recaptcha.errors.verification_failed",
            "reCAPTCHA verification failed, please try again."
          )
          false
        end
      rescue Timeout::Error
        if Recaptcha.configuration.handle_timeouts_gracefully
          recaptcha_error(
            model,
            attribute,
            options[:message],
            "recaptcha.errors.recaptcha_unreachable",
            "Oops, we failed to validate your reCAPTCHA response. Please try again."
          )
          false
        else
          raise RecaptchaError, "Recaptcha unreachable."
        end
      rescue StandardError => e
        raise RecaptchaError, e.message, e.backtrace
      end
    end
def verify_recaptcha(options = {})
      options = {model: options} unless options.is_a? Hash
      return true if Recaptcha::Verify.skip?(options[:env])

      model = options[:model]
      attribute = options[:attribute] || :base
      recaptcha_response = options[:response] || params['g-recaptcha-response'].to_s

      begin
        verified = if recaptcha_response.empty? || recaptcha_response.length > G_RESPONSE_LIMIT
          false
        else
          recaptcha_verify_via_api_call(request, recaptcha_response, options)
        end

        if verified
          flash.delete(:recaptcha_error) if recaptcha_flash_supported? && !model
          true
        else
          recaptcha_error(
            model,
            attribute,
            options[:message],
            "recaptcha.errors.verification_failed",
            "reCAPTCHA verification failed, please try again."
          )
          false
        end
      rescue Timeout::Error
        if Recaptcha.configuration.handle_timeouts_gracefully
          recaptcha_error(
            model,
            attribute,
            options[:message],
            "recaptcha.errors.recaptcha_unreachable",
            "Oops, we failed to validate your reCAPTCHA response. Please try again."
          )
          false
        else
          raise RecaptchaError, "Recaptcha unreachable."
        end
      rescue StandardError => e
        raise RecaptchaError, e.message, e.backtrace
      end
    end
Your private API can be specified in the +options+ hash or preferably
 using the Configuration.