Class: WhopSDK::Resources::Refunds
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Refunds
- Defined in:
- lib/whop_sdk/resources/refunds.rb
Overview
Refunds
Instance Method Summary collapse
-
#initialize(client:) ⇒ Refunds
constructor
private
A new instance of Refunds.
-
#list(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, payment_id: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::RefundListResponse>
Returns a paginated list of refunds, with optional filtering by payment, company, user, and creation date.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::RefundRetrieveResponse
Retrieves the details of an existing refund.
Constructor Details
#initialize(client:) ⇒ Refunds
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 Refunds.
84 85 86 |
# File 'lib/whop_sdk/resources/refunds.rb', line 84 def initialize(client:) @client = client end |
Instance Method Details
#list(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, payment_id: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::RefundListResponse>
Returns a paginated list of refunds, with optional filtering by payment, company, user, and creation date.
Required permissions:
-
‘payment:basic:read`
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/whop_sdk/resources/refunds.rb', line 68 def list(params = {}) parsed, = WhopSDK::RefundListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "refunds", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::RefundListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::RefundRetrieveResponse
Retrieves the details of an existing refund.
Required permissions:
-
‘payment:basic:read`
-
‘member:email:read`
-
‘member:basic:read`
-
‘member:phone:read`
25 26 27 28 29 30 31 32 |
# File 'lib/whop_sdk/resources/refunds.rb', line 25 def retrieve(id, params = {}) @client.request( method: :get, path: ["refunds/%1$s", id], model: WhopSDK::Models::RefundRetrieveResponse, options: params[:request_options] ) end |