Class: Onlyfans::Resources::Transactions

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/transactions.rb

Overview

APIs for managing OnlyFans transactions

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Transactions

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

Parameters:



48
49
50
# File 'lib/onlyfans/resources/transactions.rb', line 48

def initialize(client:)
  @client = client
end

Instance Method Details

#list(account, limit: nil, marker: nil, start_date: nil, tips_source: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::TransactionListResponse

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

Get a paginated list of transactions for an Account. Newest transactions are first. You can filter by transaction type and tips source.

‘post_

Parameters:

  • account (String)

    The Account ID

  • limit (String)

    The number of transactions to return. Recommended: ‘10`

  • marker (String)

    The marker used for pagination. Default: ‘null`

  • start_date (String)

    The start date for transactions list. Default: ‘-30days`

  • tips_source (String)

    Filter tips by source. Only applies when ‘type=tips`. Options: `profile`,

  • type (String)

    Filter by transaction type. Options: ‘subscribes`, `tips`, `post`, `chat_message

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

Returns:

See Also:



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/onlyfans/resources/transactions.rb', line 33

def list(, params = {})
  parsed, options = Onlyfans::TransactionListParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/transactions", ],
    query: query.transform_keys(start_date: "startDate", tips_source: "tipsSource"),
    model: Onlyfans::Models::TransactionListResponse,
    options: options
  )
end