Class: Increase::Resources::CardDisputes

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

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:



179
180
181
# File 'lib/increase/resources/card_disputes.rb', line 179

def initialize(client:)
  @client = client
end

Instance Method Details

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

Create a Card Dispute

Parameters:

  • disputed_transaction_id (String)

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

  • network (Symbol, Increase::Models::CardDisputeCreateParams::Network)

    The network of the disputed transaction. Details specific to the network are required under the sub-object with the same identifier as the network.

  • amount (Integer)

    The monetary amount of the part of the transaction that is being disputed. This is optional and will default to the full amount of the transaction if not provided. If provided, the amount must be less than or equal to the amount of the transaction.

  • attachment_files (Array<Increase::Models::CardDisputeCreateParams::AttachmentFile>)

    The files to be attached to the initial dispute submission.

  • explanation (String)

    The free-form explanation provided to Increase to provide more context for the user submission. This field is not sent directly to the card networks.

  • visa (Increase::Models::CardDisputeCreateParams::Visa)

    The Visa-specific parameters for the dispute. Required if and only if network is visa.

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

Returns:

See Also:



40
41
42
43
44
45
46
47
48
49
# File 'lib/increase/resources/card_disputes.rb', line 40

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>

List Card Disputes

Parameters:

Returns:

See Also:



96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/increase/resources/card_disputes.rb', line 96

def list(params = {})
  parsed, options = Increase::CardDisputeListParams.dump_request(params)
  query = Increase::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "card_disputes",
    query: query,
    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:



62
63
64
65
66
67
68
69
# File 'lib/increase/resources/card_disputes.rb', line 62

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

#submit_user_submission(card_dispute_id, network:, amount: nil, attachment_files: nil, explanation: nil, visa: nil, request_options: {}) ⇒ Increase::Models::CardDispute

Submit a User Submission for a Card Dispute

Parameters:

  • card_dispute_id (String)

    The identifier of the Card Dispute to submit a user submission for.

  • network (Symbol, Increase::Models::CardDisputeSubmitUserSubmissionParams::Network)

    The network of the Card Dispute. Details specific to the network are required under the sub-object with the same identifier as the network.

  • amount (Integer)

    The adjusted monetary amount of the part of the transaction that is being disputed. This is optional and will default to the most recent amount provided. If provided, the amount must be less than or equal to the amount of the transaction.

  • attachment_files (Array<Increase::Models::CardDisputeSubmitUserSubmissionParams::AttachmentFile>)

    The files to be attached to the user submission.

  • explanation (String)

    The free-form explanation provided to Increase to provide more context for the user submission. This field is not sent directly to the card networks.

  • visa (Increase::Models::CardDisputeSubmitUserSubmissionParams::Visa)

    The Visa-specific parameters for the dispute. Required if and only if network is visa.

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

Returns:

See Also:



141
142
143
144
145
146
147
148
149
150
# File 'lib/increase/resources/card_disputes.rb', line 141

def submit_user_submission(card_dispute_id, params)
  parsed, options = Increase::CardDisputeSubmitUserSubmissionParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["card_disputes/%1$s/submit_user_submission", card_dispute_id],
    body: parsed,
    model: Increase::CardDispute,
    options: options
  )
end

#withdraw(card_dispute_id, explanation: nil, request_options: {}) ⇒ Increase::Models::CardDispute

Withdraw a Card Dispute

Parameters:

  • card_dispute_id (String)

    The identifier of the Card Dispute to withdraw.

  • explanation (String)

    The explanation for withdrawing the Card Dispute.

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

Returns:

See Also:



165
166
167
168
169
170
171
172
173
174
# File 'lib/increase/resources/card_disputes.rb', line 165

def withdraw(card_dispute_id, params = {})
  parsed, options = Increase::CardDisputeWithdrawParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["card_disputes/%1$s/withdraw", card_dispute_id],
    body: parsed,
    model: Increase::CardDispute,
    options: options
  )
end