Class: Increase::Resources::CardDisputes

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/card_disputes.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardDisputes

Returns a new instance of CardDisputes.



6
7
8
# File 'lib/increase/resources/card_disputes.rb', line 6

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params = {}, opts = {}) ⇒ Increase::Models::CardDispute

Create a Card Dispute

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :disputed_transaction_id (String)

    The Transaction you wish to dispute. This Transaction must have a source_type of card_settlement.

  • :explanation (String)

    Why you are disputing this Transaction.

Returns:



20
21
22
23
24
25
26
27
# File 'lib/increase/resources/card_disputes.rb', line 20

def create(params = {}, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/card_disputes"
  req[:body] = params
  req[:model] = Increase::Models::CardDispute
  @client.request(req, opts)
end

#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::CardDispute>

List Card Disputes

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :created_at (CreatedAt)
  • :cursor (String)

    Return the page of entries after this one.

  • :idempotency_key (String)

    Filter records to the one with the specified idempotency_key you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about idempotency.

  • :limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 objects.

  • :status (Status)

Returns:



59
60
61
62
63
64
65
66
67
# File 'lib/increase/resources/card_disputes.rb', line 59

def list(params = {}, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/card_disputes"
  req[:query] = params
  req[:page] = Increase::Page
  req[:model] = Increase::Models::CardDispute
  @client.request(req, opts)
end

#retrieve(card_dispute_id, opts = {}) ⇒ Increase::Models::CardDispute

Retrieve a Card Dispute

Parameters:

  • card_dispute_id (String)

    The identifier of the Card Dispute.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



35
36
37
38
39
40
41
# File 'lib/increase/resources/card_disputes.rb', line 35

def retrieve(card_dispute_id, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/card_disputes/#{card_dispute_id}"
  req[:model] = Increase::Models::CardDispute
  @client.request(req, opts)
end