class Chargehound::Disputes

Access the Chargehound dispute resource

Public Class Methods

accept(dispute_id) click to toggle source

Accept a dispute and do not submit a response @param dispute_id A dispute id @return [Dispute]

# File lib/chargehound/disputes.rb, line 67
def self.accept(dispute_id)
  ApiRequest.new(:post, "disputes/#{dispute_id}/accept").run
end
create(create = {}) click to toggle source

Create a dispute @option [Hash] A dispute create object @return [Dispute]

# File lib/chargehound/disputes.rb, line 9
def self.create(create = {})
  ApiRequest.new(:post, 'disputes', body: create).run
end
list(params = {}) click to toggle source

A list of disputes This endpoint will list all the disputes that we have synced from your payment processor. By default the disputes will be ordered by `created` with the most recent dispute first. { }`has_more` will be `true` if more results are available. @option [Hash] params the query parameters @return [Disputes]

# File lib/chargehound/disputes.rb, line 20
def self.list(params = {})
  ApiRequest.new(:get, 'disputes', query_params: params).run
end
response(dispute_id) click to toggle source

Retrieve the response for a dispute. @param [String] dispute_id A dispute id @return [Dispute]

# File lib/chargehound/disputes.rb, line 35
def self.response(dispute_id)
  ApiRequest.new(:get, "disputes/#{dispute_id}/response").run
end
retrieve(dispute_id) click to toggle source

Retrieve a dispute This endpoint will return a single dispute. @param [String] dispute_id A dispute id @return [Dispute]

# File lib/chargehound/disputes.rb, line 28
def self.retrieve(dispute_id)
  ApiRequest.new(:get, "disputes/#{dispute_id}").run
end
submit(dispute_id, update = {}) click to toggle source

Submitting a dispute You will want to submit the dispute through Chargehound after you recieve a webhook notification of a new dispute. With one `POST` request you can update a dispute with the evidence fields and submit the generated response. The response will have a `201` status if the submit was successful. The dispute will also be in the submitted state. @param dispute_id A dispute id @option [Hash] update A dispute update object @return [Dispute]

# File lib/chargehound/disputes.rb, line 49
def self.submit(dispute_id, update = {})
  ApiRequest.new(:post, "disputes/#{dispute_id}/submit",
                 body: update).run
end
update(dispute_id, update = {}) click to toggle source

Updating a dispute You can update the template and the fields on a dispute. @param dispute_id A dispute id @option [Hash] update A dispute update object @return [Dispute]

# File lib/chargehound/disputes.rb, line 59
def self.update(dispute_id, update = {})
  ApiRequest.new(:put, "disputes/#{dispute_id}",
                 body: update).run
end