Class: Square::Payouts::Client
- Inherits:
-
Object
- Object
- Square::Payouts::Client
- Defined in:
- lib/square/payouts/client.rb
Instance Method Summary collapse
-
#get(request_options: {}, **params) ⇒ Square::Types::GetPayoutResponse
Retrieves details of a specific payout identified by a payout ID.
- #initialize(client:) ⇒ Square::Payouts::Client constructor
-
#list(request_options: {}, **params) ⇒ Square::Types::ListPayoutsResponse
Retrieves a list of all payouts for the default location.
-
#list_entries(request_options: {}, **params) ⇒ Square::Types::ListPayoutEntriesResponse
Retrieves a list of all payout entries for a specific payout.
Constructor Details
#initialize(client:) ⇒ Square::Payouts::Client
7 8 9 |
# File 'lib/square/payouts/client.rb', line 7 def initialize(client:) @client = client end |
Instance Method Details
#get(request_options: {}, **params) ⇒ Square::Types::GetPayoutResponse
Retrieves details of a specific payout identified by a payout ID. To call this endpoint, set ‘PAYOUTS_READ` for the OAuth scope.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/square/payouts/client.rb', line 39 def get(request_options: {}, **params) _request = Square::Internal::JSON::Request.new( base_url: [:base_url] || Square::Environment::SANDBOX, method: "GET", path: "v2/payouts/#{params[:payout_id]}" ) _response = @client.send(_request) if _response.code >= "200" && _response.code < "300" return Square::Types::GetPayoutResponse.load(_response.body) end raise _response.body end |
#list(request_options: {}, **params) ⇒ Square::Types::ListPayoutsResponse
Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. To call this endpoint, set ‘PAYOUTS_READ` for the OAuth scope.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/square/payouts/client.rb', line 16 def list(request_options: {}, **params) _query_param_names = %w[location_id status begin_time end_time sort_order cursor limit] _query = params.slice(*_query_param_names) params.except(*_query_param_names) _request = Square::Internal::JSON::Request.new( base_url: [:base_url] || Square::Environment::SANDBOX, method: "GET", path: "v2/payouts", query: _query ) _response = @client.send(_request) if _response.code >= "200" && _response.code < "300" return Square::Types::ListPayoutsResponse.load(_response.body) end raise _response.body end |
#list_entries(request_options: {}, **params) ⇒ Square::Types::ListPayoutEntriesResponse
Retrieves a list of all payout entries for a specific payout. To call this endpoint, set ‘PAYOUTS_READ` for the OAuth scope.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/square/payouts/client.rb', line 57 def list_entries(request_options: {}, **params) _query_param_names = %w[sort_order cursor limit] _query = params.slice(*_query_param_names) params = params.except(*_query_param_names) _request = Square::Internal::JSON::Request.new( base_url: [:base_url] || Square::Environment::SANDBOX, method: "GET", path: "v2/payouts/#{params[:payout_id]}/payout-entries", query: _query ) _response = @client.send(_request) if _response.code >= "200" && _response.code < "300" return Square::Types::ListPayoutEntriesResponse.load(_response.body) end raise _response.body end |