Class: WhopSDK::Resources::Disputes

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/disputes.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Disputes

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 Disputes.

Parameters:



181
182
183
# File 'lib/whop_sdk/resources/disputes.rb', line 181

def initialize(client:)
  @client = client
end

Instance Method Details

#list(company_id: , after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::DisputeListResponse>

Lists disputes the current actor has access to

Required permissions:

  • ‘payment:dispute:read`

  • ‘plan:basic:read`

  • ‘access_pass:basic:read`

  • ‘company:basic:read`

  • ‘payment:basic:read`

Parameters:

  • company_id (String)

    The ID of the company to list disputes for

  • after (String, nil)

    Returns the elements in the list that come after the specified cursor.

  • before (String, nil)

    Returns the elements in the list that come before the specified cursor.

  • created_after (Time, nil)

    The minimum creation date to filter by

  • created_before (Time, nil)

    The maximum creation date to filter by

  • direction (Symbol, WhopSDK::Models::Direction, nil)

    The direction of the sort.

  • first (Integer, nil)

    Returns the first n elements from the list.

  • last (Integer, nil)

    Returns the last n elements from the list.

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

Returns:

See Also:



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/whop_sdk/resources/disputes.rb', line 70

def list(params)
  parsed, options = WhopSDK::DisputeListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "disputes",
    query: parsed,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::Models::DisputeListResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Dispute

Retrieves a Dispute by ID

Required permissions:

  • ‘payment:dispute:read`

  • ‘plan:basic:read`

  • ‘access_pass:basic:read`

  • ‘company:basic:read`

  • ‘payment:basic:read`

  • ‘member:email:read`

  • ‘member:basic:read`

  • ‘member:phone:read`

Parameters:

Returns:

See Also:



28
29
30
31
32
33
34
35
# File 'lib/whop_sdk/resources/disputes.rb', line 28

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["disputes/%1$s", id],
    model: WhopSDK::Dispute,
    options: params[:request_options]
  )
end

#submit_evidence(id, request_options: {}) ⇒ WhopSDK::Models::Dispute

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

Submit a payment dispute to the payment processor for review. Once submitted, no further edits can be made.

Required permissions:

  • ‘payment:dispute`

  • ‘plan:basic:read`

  • ‘access_pass:basic:read`

  • ‘company:basic:read`

  • ‘payment:basic:read`

  • ‘member:email:read`

  • ‘member:basic:read`

  • ‘member:phone:read`

Parameters:

  • id (String)

    The ID of the dispute (Ex. dspt_xxxx) you want to finalize evidence submission f

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

Returns:

See Also:



108
109
110
111
112
113
114
115
# File 'lib/whop_sdk/resources/disputes.rb', line 108

def submit_evidence(id, params = {})
  @client.request(
    method: :post,
    path: ["disputes/%1$s/submit_evidence", id],
    model: WhopSDK::Dispute,
    options: params[:request_options]
  )
end

#update_evidence(id, access_activity_log: nil, billing_address: nil, cancellation_policy_attachment: nil, cancellation_policy_disclosure: nil, customer_communication_attachment: nil, customer_email_address: nil, customer_name: nil, notes: nil, product_description: nil, refund_policy_attachment: nil, refund_policy_disclosure: nil, refund_refusal_explanation: nil, service_date: nil, uncategorized_attachment: nil, request_options: {}) ⇒ WhopSDK::Models::Dispute

Update a dispute with evidence data to attempt to win the dispute.

Required permissions:

  • ‘payment:dispute`

  • ‘plan:basic:read`

  • ‘access_pass:basic:read`

  • ‘company:basic:read`

  • ‘payment:basic:read`

  • ‘member:email:read`

  • ‘member:basic:read`

  • ‘member:phone:read`

Parameters:

Returns:

See Also:



167
168
169
170
171
172
173
174
175
176
# File 'lib/whop_sdk/resources/disputes.rb', line 167

def update_evidence(id, params = {})
  parsed, options = WhopSDK::DisputeUpdateEvidenceParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["disputes/%1$s/update_evidence", id],
    body: parsed,
    model: WhopSDK::Dispute,
    options: options
  )
end