Class: Straddle::Resources::Payments
- Inherits:
-
Object
- Object
- Straddle::Resources::Payments
- Defined in:
- lib/straddle/resources/payments.rb,
sig/straddle/resources/payments.rbs
Overview
Payments provide a combined view of charges and payouts.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Payments
constructor
private
A new instance of Payments.
-
#list(customer_id: nil, default_page_size: nil, default_sort: nil, default_sort_order: nil, external_id: nil, funding_id: nil, has_refund: nil, has_resubmit: nil, include_metadata: nil, is_refund: nil, is_resubmit: nil, max_amount: nil, max_created_at: nil, max_effective_at: nil, max_payment_date: nil, max_updated_at: nil, min_amount: nil, min_created_at: nil, min_effective_at: nil, min_payment_date: nil, min_updated_at: nil, page_number: nil, page_size: nil, paykey: nil, paykey_id: nil, payment_id: nil, payment_status: nil, payment_type: nil, search_text: nil, sort_by: nil, sort_order: nil, status_reason: nil, status_source: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaymentSummaryList
Some parameter documentations has been truncated, see Models::PaymentListParams for more details.
Constructor Details
#initialize(client:) ⇒ Payments
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 Payments.
147 148 149 |
# File 'lib/straddle/resources/payments.rb', line 147 def initialize(client:) @client = client end |
Instance Method Details
#list(customer_id: nil, default_page_size: nil, default_sort: nil, default_sort_order: nil, external_id: nil, funding_id: nil, has_refund: nil, has_resubmit: nil, include_metadata: nil, is_refund: nil, is_resubmit: nil, max_amount: nil, max_created_at: nil, max_effective_at: nil, max_payment_date: nil, max_updated_at: nil, min_amount: nil, min_created_at: nil, min_effective_at: nil, min_payment_date: nil, min_updated_at: nil, page_number: nil, page_size: nil, paykey: nil, paykey_id: nil, payment_id: nil, payment_status: nil, payment_type: nil, search_text: nil, sort_by: nil, sort_order: nil, status_reason: nil, status_source: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaymentSummaryList
Some parameter documentations has been truncated, see Models::PaymentListParams for more details.
Returns a paged list of charges and payouts that match the filters.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/straddle/resources/payments.rb', line 91 def list(params = {}) query_params = %i[ customer_id default_page_size default_sort default_sort_order external_id funding_id has_refund has_resubmit include_metadata is_refund is_resubmit max_amount max_created_at max_effective_at max_payment_date max_updated_at min_amount min_created_at min_effective_at min_payment_date min_updated_at page_number page_size paykey paykey_id payment_id payment_status payment_type search_text sort_by sort_order status_reason status_source ] parsed, = Straddle::PaymentListParams.dump_request(params) query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "v1/payments", query: query, headers: parsed.except(*query_params).transform_keys( correlation_id: "correlation-id", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::PaymentSummaryList, options: ) end |