Class: WhopSDK::Resources::Disputes

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

Overview

Disputes

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:



188
189
190
# File 'lib/whop_sdk/resources/disputes.rb', line 188

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>

Returns a paginated list of disputes for a company, with optional filtering by creation date. A dispute represents a chargeback or inquiry filed by a customer against a payment.

Required permissions:

  • ‘payment:dispute:read`

  • ‘plan:basic:read`

  • ‘access_pass:basic:read`

  • ‘company:basic:read`

  • ‘payment:basic:read`

Parameters:

  • company_id (String)

    The unique identifier 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)

    Only return disputes created after this timestamp.

  • created_before (Time, nil)

    Only return disputes created before this timestamp.

  • 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:



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/whop_sdk/resources/disputes.rb', line 73

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

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

Retrieves the details of an existing dispute.

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:

  • id (String)

    The unique identifier of the dispute.

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

Returns:

See Also:



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

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 unique identifier of the dispute to submit to the payment processor for revi

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

Returns:

See Also:



112
113
114
115
116
117
118
119
# File 'lib/whop_sdk/resources/disputes.rb', line 112

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

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

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:

  • id (String)

    The unique identifier of the dispute to update.

  • access_activity_log (String, nil)

    An IP access activity log showing the customer used the service.

  • billing_address (String, nil)

    The billing address associated with the customer’s payment method.

  • cancellation_policy_attachment (WhopSDK::Models::DisputeUpdateEvidenceParams::CancellationPolicyAttachment, nil)

    A file upload containing the company’s cancellation policy document.

  • cancellation_policy_disclosure (String, nil)

    The company’s cancellation policy text to submit as evidence.

  • customer_communication_attachment (WhopSDK::Models::DisputeUpdateEvidenceParams::CustomerCommunicationAttachment, nil)

    A file upload containing evidence of customer communication. Must be a JPEG, PNG

  • customer_email_address (String, nil)

    The email address of the customer associated with the disputed payment.

  • customer_name (String, nil)

    The full name of the customer associated with the disputed payment.

  • notes (String, nil)

    Additional notes or context to submit as part of the dispute evidence.

  • product_description (String, nil)

    A description of the product or service that was provided to the customer.

  • refund_policy_attachment (WhopSDK::Models::DisputeUpdateEvidenceParams::RefundPolicyAttachment, nil)

    A file upload containing the company’s refund policy document.

  • refund_policy_disclosure (String, nil)

    The company’s refund policy text to submit as evidence.

  • refund_refusal_explanation (String, nil)

    An explanation of why the refund request was refused.

  • service_date (String, nil)

    The date when the product or service was delivered to the customer.

  • uncategorized_attachment (WhopSDK::Models::DisputeUpdateEvidenceParams::UncategorizedAttachment, nil)

    A file upload for evidence that does not fit into the other categories.

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

Returns:

See Also:



174
175
176
177
178
179
180
181
182
183
# File 'lib/whop_sdk/resources/disputes.rb', line 174

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