Class: Onlyfans::Resources::Payouts
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Payouts
- Defined in:
- lib/onlyfans/resources/payouts.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Payouts
constructor
private
A new instance of Payouts.
-
#list_requests(account, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::PayoutListRequestsResponse
List all payout requests for the account.
-
#request_manual_withdrawal(account, amount:, request_options: {}) ⇒ Onlyfans::Models::PayoutRequestManualWithdrawalResponse::UnionMember0, Onlyfans::Models::PayoutRequestManualWithdrawalResponse::UnionMember1
Request a payout withdrawal, if the frequency is set to manual.
-
#retrieve_balances(account, request_options: {}) ⇒ Onlyfans::Models::PayoutRetrieveBalancesResponse
Get the current available and pending balances for the account.
-
#retrieve_earning_statistics(account, end_date: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::PayoutRetrieveEarningStatisticsResponse
Get total and monthly time-series earning statistics for the account.
-
#retrieve_eligibility(account, request_options: {}) ⇒ Onlyfans::Models::PayoutRetrieveEligibilityResponse
Get the eligibility details for receiving payouts.
-
#update_frequency(account, frequency:, request_options: {}) ⇒ Onlyfans::Models::PayoutUpdateFrequencyResponse
Update the payout frequency for the account (Manual, Weekly or Monthly).
Constructor Details
#initialize(client:) ⇒ Payouts
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 Payouts.
153 154 155 |
# File 'lib/onlyfans/resources/payouts.rb', line 153 def initialize(client:) @client = client end |
Instance Method Details
#list_requests(account, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::PayoutListRequestsResponse
List all payout requests for the account.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/onlyfans/resources/payouts.rb', line 21 def list_requests(account, params = {}) parsed, = Onlyfans::PayoutListRequestsParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/payouts/payout-requests", account], query: query, model: Onlyfans::Models::PayoutListRequestsResponse, options: ) end |
#request_manual_withdrawal(account, amount:, request_options: {}) ⇒ Onlyfans::Models::PayoutRequestManualWithdrawalResponse::UnionMember0, Onlyfans::Models::PayoutRequestManualWithdrawalResponse::UnionMember1
Request a payout withdrawal, if the frequency is set to manual. Refer to our ‘/payouts/balances` endpoint to retrieve the minimum and maximum withdrawal amounts.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/onlyfans/resources/payouts.rb', line 48 def request_manual_withdrawal(account, params) parsed, = Onlyfans::PayoutRequestManualWithdrawalParams.dump_request(params) @client.request( method: :post, path: ["api/%1$s/payouts/request-manual-withdrawal", account], body: parsed, model: Onlyfans::Models::PayoutRequestManualWithdrawalResponse, options: ) end |
#retrieve_balances(account, request_options: {}) ⇒ Onlyfans::Models::PayoutRetrieveBalancesResponse
Get the current available and pending balances for the account.
70 71 72 73 74 75 76 77 |
# File 'lib/onlyfans/resources/payouts.rb', line 70 def retrieve_balances(account, params = {}) @client.request( method: :get, path: ["api/%1$s/payouts/balances", account], model: Onlyfans::Models::PayoutRetrieveBalancesResponse, options: params[:request_options] ) end |
#retrieve_earning_statistics(account, end_date: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::PayoutRetrieveEarningStatisticsResponse
Get total and monthly time-series earning statistics for the account.
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/onlyfans/resources/payouts.rb', line 94 def retrieve_earning_statistics(account, params = {}) parsed, = Onlyfans::PayoutRetrieveEarningStatisticsParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/payouts/earning-statistics", account], query: query.transform_keys(end_date: "endDate", start_date: "startDate"), model: Onlyfans::Models::PayoutRetrieveEarningStatisticsResponse, options: ) end |
#retrieve_eligibility(account, request_options: {}) ⇒ Onlyfans::Models::PayoutRetrieveEligibilityResponse
Get the eligibility details for receiving payouts.
117 118 119 120 121 122 123 124 |
# File 'lib/onlyfans/resources/payouts.rb', line 117 def retrieve_eligibility(account, params = {}) @client.request( method: :get, path: ["api/%1$s/payouts/eligibility", account], model: Onlyfans::Models::PayoutRetrieveEligibilityResponse, options: params[:request_options] ) end |
#update_frequency(account, frequency:, request_options: {}) ⇒ Onlyfans::Models::PayoutUpdateFrequencyResponse
Update the payout frequency for the account (Manual, Weekly or Monthly).
139 140 141 142 143 144 145 146 147 148 |
# File 'lib/onlyfans/resources/payouts.rb', line 139 def update_frequency(account, params) parsed, = Onlyfans::PayoutUpdateFrequencyParams.dump_request(params) @client.request( method: :patch, path: ["api/%1$s/payouts/payout-frequency", account], body: parsed, model: Onlyfans::Models::PayoutUpdateFrequencyResponse, options: ) end |