lib/square/api/payments_api.rb
# Retrieves a list of payments taken by the account making the request.
# Results are eventually consistent, and new payments or changes to payments
# might take several
# seconds to appear.
# The maximum results per page is 100.
# @param [String] begin_time Optional parameter: The timestamp for the
# beginning of the reporting period, in RFC 3339 format. Inclusive. Default:
# The current time minus one year.
# @param [String] end_time Optional parameter: The timestamp for the end of
# the reporting period, in RFC 3339 format.  Default: The current time.
# @param [String] sort_order Optional parameter: The order in which results
# are listed: - `ASC` - Oldest to newest. - `DESC` - Newest to oldest
# (default).
# @param [String] cursor Optional parameter: A pagination cursor returned by
# a previous call to this endpoint. Provide this cursor to retrieve the next
# set of results for the original query.  For more information, see
# [Pagination](https://developer.squareup.com/docs/basics/api101/pagination)
# .
# @param [String] location_id Optional parameter: Limit results to the
# location supplied. By default, results are returned for the default (main)
# location associated with the seller.
# @param [Long] total Optional parameter: The exact amount in the
# `total_money` for a payment.
# @param [String] last_4 Optional parameter: The last four digits of a
# payment card.
# @param [String] card_brand Optional parameter: The brand of the payment
# card (for example, VISA).
# @param [Integer] limit Optional parameter: The maximum number of results
# to be returned in a single page. It is possible to receive fewer results
# than the specified limit on a given page.  The default value of 100 is
# also the maximum allowed value. If the provided value is  greater than
# 100, it is ignored and the default value is used instead.  Default:
# `100`
# @return [ListPaymentsResponse Hash] response from the API call
Retrieves a list of payments taken by the account making the request.
Results are eventually consistent, and new payments or changes to payments
might take several
seconds to appear.
The maximum results per page is 100.
Retrieves a list of payments taken by the account making the request . Results are eventually consistent and new payments or changes to payments might take several seconds to appear . The maximum results per page is 100 .
def list_payments(begin_time: nil,
                      end_time: nil,
                      sort_order: nil,
                      cursor: nil,
                      location_id: nil,
                      total: nil,
                      last_4: nil,
                      card_brand: nil,
                      limit: nil)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/payments'
      _query_builder = APIHelper.append_url_with_query_parameters(
        _query_builder,
        'begin_time' => begin_time,
        'end_time' => end_time,
        'sort_order' => sort_order,
        'cursor' => cursor,
        'location_id' => location_id,
        'total' => total,
        'last_4' => last_4,
        'card_brand' => card_brand,
        'limit' => limit
      )
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json'
      }
      _request = config.http_client.get(
        _query_url,
        headers: _headers
      )
      OAuth2.apply(config, _request)
      _response = execute_request(_request)
      decoded = APIHelper.json_deserialize(_response.raw_body)
      _errors = APIHelper.map_response(decoded, ['errors'])
      ApiResponse.new(
        _response, data: decoded, errors: _errors
      )
    end
def list_payments ( begin_time : nil , end_time : nil , sort_order : nil , cursor : nil , location_id : nil , total : nil , last_4 : nil , card_brand : nil , limit : nil ) _query_builder = config . get_base_uri _query_builder << '/v2/payments' _query_builder = APIHelper . append_url_with_query_parameters ( _query_builder , 'begin_time' => begin_time , 'end_time' => end_time , 'sort_order' => sort_order , 'cursor' => cursor , 'location_id' => location_id , 'total' => total , 'last_4' => last_4 , 'card_brand' => card_brand , 'limit' => limit ) _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' } _request = config . http_client . get ( _query_url , headers : _headers ) OAuth2 . apply ( config , _request ) _response = execute_request ( _request ) decoded = APIHelper . json_deserialize ( _response . raw_body ) _errors = APIHelper . map_response ( decoded , [ 'errors' ] ) ApiResponse . new ( _response , data : decoded , errors : _errors ) end
Retrieves a list of payments taken by the account making the request.
Retrieves a list of payments taken by the account making the request .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
ListPaymentsResponse Hash
begin_time
<not_specific>
end_time
<not_specific>
sort_order
<not_specific>
cursor
<not_specific>
location_id
<not_specific>
total
<not_specific>
last_4
<not_specific>
card_brand
<not_specific>
limit
<not_specific>
<not_specific>
limit Optional parameter: The maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page. The default value of 100 is also the maximum allowed value. If the provided value is greater than 100, it is ignored and the default value is used instead.
limit Optional parameter : The maximum number of results to be returned in a single page . It is possible to receive fewer results than the specified limit on a given page . The default value of 100 is also the maximum allowed value . If the provided value is greater than 100 it is ignored and the default value is used instead .