Class: Wajub::DisputesResource

Inherits:
BaseClient show all
Defined in:
lib/wajub/resources.rb

Instance Attribute Summary

Attributes inherited from BaseClient

#api_key, #base_url, #idempotency_key_prefix, #last_request, #transport

Instance Method Summary collapse

Methods inherited from BaseClient

#delete, #get, #initialize, #post, #put, #request

Constructor Details

This class inherits a constructor from Wajub::BaseClient

Instance Method Details

#accept(id, options = nil) ⇒ Object



217
218
219
# File 'lib/wajub/resources.rb', line 217

def accept(id, options = nil)
  HttpUtils.pick_resource(post("/disputes/#{URI.encode_www_form_component(id)}/accept", nil, options), 'dispute')
end

#close(id, options = nil) ⇒ Object



221
222
223
# File 'lib/wajub/resources.rb', line 221

def close(id, options = nil)
  HttpUtils.pick_resource(post("/disputes/#{URI.encode_www_form_component(id)}/close", nil, options), 'dispute')
end

#list(params = nil) ⇒ Object



205
206
207
# File 'lib/wajub/resources.rb', line 205

def list(params = nil)
  PagedResult.create(self, '/disputes', 'disputes', params)
end

#retrieve(id) ⇒ Object



209
210
211
# File 'lib/wajub/resources.rb', line 209

def retrieve(id)
  HttpUtils.pick_resource(get("/disputes/#{URI.encode_www_form_component(id)}"), 'dispute')
end

#send_message(id, params, options = nil) ⇒ Object



225
226
227
# File 'lib/wajub/resources.rb', line 225

def send_message(id, params, options = nil)
  HttpUtils.pick_resource(post("/disputes/#{URI.encode_www_form_component(id)}/messages", params, options), 'dispute')
end

#submit_evidence(id, params, options = nil) ⇒ Object



213
214
215
# File 'lib/wajub/resources.rb', line 213

def submit_evidence(id, params, options = nil)
  HttpUtils.pick_resource(post("/disputes/#{URI.encode_www_form_component(id)}/submit-evidence", params, options), 'dispute')
end