lib/api_connector/api_connector.rb
def call method, endpoint, args={}, params
      raise "Endpoint can't be blank" unless endpoint
      raise "Method is missing" unless method

      url = (method == :get || method == :delete) ? url(endpoint,params) : url(endpoint)

      RestClient::Request.execute(method: method,
                              url: url,
                              headers: header(args[:headers]),
                              payload: params || {}
                             ) do |response, request, result|
                               #status = response.code == 200 ? :debug : :error
                               #print(status, request, response.body)
                               parse(response, endpoint)
                             end

    end
def call method, endpoint, args={}, params
      raise "Endpoint can't be blank" unless endpoint
      raise "Method is missing" unless method

      url = (method == :get || method == :delete) ? url(endpoint,params) : url(endpoint)

      RestClient::Request.execute(method: method,
                              url: url,
                              headers: header(args[:headers]),
                              payload: params || {}
                             ) do |response, request, result|
                               #status = response.code == 200 ? :debug : :error
                               #print(status, request, response.body)
                               parse(response, endpoint)
                             end

    end
low level api for request (needed por PUT, PATCH & DELETE methods)

 ==== Attributes
 * +endpoint+ - Url endpoint ex. /merchant/get
 * +args+ - Request arguments, (add headers key for extra headers options) ex. { method: :get, headers: { 'content-type' => 'xml' } } (method key is needed, otherwise :get will be setted)
 * +params+ - Request parameters / payload data