Class: Onlyfans::Resources::Chargebacks
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Chargebacks
- Defined in:
- lib/onlyfans/resources/chargebacks.rb
Instance Method Summary collapse
-
#calculate_ratio(account, end_date: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::ChargebackCalculateRatioResponse
The Chargeback Ratio reflects the number of chargebacks compared to the total number of payments as a percentage.
-
#initialize(client:) ⇒ Chargebacks
constructor
private
A new instance of Chargebacks.
-
#list(account, end_date: nil, limit: nil, offset: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::ChargebackListResponse
Retrieve a list of chargebacks within a specified date range.
-
#list_statistics(account, end_date: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::ChargebackListStatisticsResponse
List chargeback counts & amounts per hour, day or month.
Constructor Details
#initialize(client:) ⇒ Chargebacks
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 Chargebacks.
97 98 99 |
# File 'lib/onlyfans/resources/chargebacks.rb', line 97 def initialize(client:) @client = client end |
Instance Method Details
#calculate_ratio(account, end_date: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::ChargebackCalculateRatioResponse
The Chargeback Ratio reflects the number of chargebacks compared to the total number of payments as a percentage. Ideally, your Chargeback Ratio should be under 1%.
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/onlyfans/resources/chargebacks.rb', line 55 def calculate_ratio(account, params = {}) parsed, = Onlyfans::ChargebackCalculateRatioParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/chargebacks/ratio", account], query: query, model: Onlyfans::Models::ChargebackCalculateRatioResponse, options: ) end |
#list(account, end_date: nil, limit: nil, offset: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::ChargebackListResponse
Retrieve a list of chargebacks within a specified date range. Possible statuses are ‘loading`, `done`, `undo`.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/onlyfans/resources/chargebacks.rb', line 26 def list(account, params = {}) parsed, = Onlyfans::ChargebackListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/chargebacks", account], query: query, model: Onlyfans::Models::ChargebackListResponse, options: ) end |
#list_statistics(account, end_date: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::ChargebackListStatisticsResponse
List chargeback counts & amounts per hour, day or month.
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/onlyfans/resources/chargebacks.rb', line 82 def list_statistics(account, params = {}) parsed, = Onlyfans::ChargebackListStatisticsParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/chargebacks/statistics", account], query: query, model: Onlyfans::Models::ChargebackListStatisticsResponse, options: ) end |