Sha256: a5734e6d9733f35d4baf1064b98e105a11c678b70e75bdb2a272d9127220e9ac

Contents?: true

Size: 599 Bytes

Versions: 1

Compression:

Stored size: 599 Bytes

Contents

module WirecardSepa
  module Utils
    module ParamsValidator
      module_function

      def validate!(params, expected_params)
        if params.keys.sort != expected_params.sort
          # TODO: Provide link to official wirecard spec which explains the use of the keys
          raise Errors::InvalidParamsError.new(
            "Please provide a hash exactly with the following keys: #{expected_params}\n" +
            "Missing params: #{expected_params - params.keys}\n" +
            "Unexpected params: #{params.keys - expected_params}"
          )
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wirecard_sepa-0.0.1 lib/wirecard_sepa/utils/params_validator.rb