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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CardDisputes.

Parameters:



92
93
94
# File 'lib/increase/resources/card_disputes.rb', line 92

def initialize(client:)
  @client = client
end

Instance Method Details

#create(disputed_transaction_id: , explanation: , amount: nil, request_options: {}) ⇒ Increase::Models::CardDispute

Some parameter documentations has been truncated, see Models::CardDisputeCreateParams for more details.

Create a Card Dispute

Parameters:

  • disputed_transaction_id (String)

    The Transaction you wish to dispute. This Transaction must have a ‘source_type`

  • explanation (String)

    Why you are disputing this Transaction.

  • amount (Integer)

    The monetary amount of the part of the transaction that is being disputed. This

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
# File 'lib/increase/resources/card_disputes.rb', line 24

def create(params)
  parsed, options = Increase::CardDisputeCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "card_disputes",
    body: parsed,
    model: Increase::CardDispute,
    options: options
  )
end

#list(created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, status: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::CardDispute>

Some parameter documentations has been truncated, see Models::CardDisputeListParams for more details.

List Card Disputes

Parameters:

Returns:

See Also:



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/increase/resources/card_disputes.rb', line 77

def list(params = {})
  parsed, options = Increase::CardDisputeListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "card_disputes",
    query: parsed,
    page: Increase::Internal::Page,
    model: Increase::CardDispute,
    options: options
  )
end

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

Retrieve a Card Dispute

Parameters:

  • card_dispute_id (String)

    The identifier of the Card Dispute.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



46
47
48
49
50
51
52
53
# File 'lib/increase/resources/card_disputes.rb', line 46

def retrieve(card_dispute_id, params = {})
  @client.request(
    method: :get,
    path: ["card_disputes/%1$s", card_dispute_id],
    model: Increase::CardDispute,
    options: params[:request_options]
  )
end