Class: Pago::V2026_04::Services::CustomerPortal::Wallets
- Defined in:
- lib/pago/v2026_04/services/customer_portal.rb,
sig/pago/v2026_04/generated.rbs
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#get(id) ⇒ Models::CustomerWallet
Get a wallet by ID for the authenticated customer.
-
#list(page: 1, limit: 10, sorting: ["-created_at"]) ⇒ Models::ListResourceCustomerWallet
List wallets of the authenticated customer.
-
#list_each(limit: 10, sorting: ["-created_at"]) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of
list, fetching pages on demand.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Pago::Service
Instance Method Details
#get(id) ⇒ Models::CustomerWallet
Get a wallet by ID for the authenticated customer.
1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 1163 def get(id) data = client.request( http_method: "GET", path: "/v1/customer-portal/wallets/{id}", path_params: { "id" => id }, query: {}, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 422 => Errors::HTTPValidationError } ) Models::CustomerWallet.from_json(data) end |
#list(page: 1, limit: 10, sorting: ["-created_at"]) ⇒ Models::ListResourceCustomerWallet
List wallets of the authenticated customer.
1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 1133 def list(page: 1, limit: 10, sorting: ["-created_at"]) data = client.request( http_method: "GET", path: "/v1/customer-portal/wallets/", path_params: {}, query: { "page" => page, "limit" => limit, "sorting" => sorting }, response_type: :json, errors: { 422 => Errors::HTTPValidationError } ) Models::ListResourceCustomerWallet.from_json(data) end |
#list_each(limit: 10, sorting: ["-created_at"]) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of list, fetching pages on demand.
1149 1150 1151 1152 1153 1154 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 1149 def list_each(limit: 10, sorting: ["-created_at"], &block) paginator = ::Pago::Paginator.new do |page_number| list(page: page_number, limit: limit, sorting: sorting) end block ? paginator.each(&block) : paginator end |