Class: TransactionsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/transactions_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ TransactionsClient

Initialize the TransactionsClient class with an API client instance.

Parameters:

  • connection (LockstepApi)

    The API client object for this connection



22
23
24
# File 'lib/lockstep_sdk/clients/transactions_client.rb', line 22

def initialize(connection)
    @connection = connection
end

Instance Method Details

#query_transactions(filter:, include_param:, order:, page_size:, page_number:, current_date:) ⇒ Object

Queries transactions (invoices/credit memos/payments) for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.

More information on querying can be found on the Searchlight Query Language page on the Lockstep Developer website.

Parameters:

  • filter (string)

    The filter for this query. See Searchlight Query Language

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available but may be offered in the future

  • order (string)

    The sort order for this query. See Searchlight Query Language

  • page_size (int32)

    The page size for results (default 250, maximum of 500). See Searchlight Query Language

  • page_number (int32)

    The page number for results (default 0). See Searchlight Query Language

  • current_date (date-time)

    The date the days past due value will be calculated against. If no currentDate is provided the current UTC date will be used.



38
39
40
41
42
# File 'lib/lockstep_sdk/clients/transactions_client.rb', line 38

def query_transactions(filter:, include_param:, order:, page_size:, page_number:, current_date:)
    path = "/api/v1/Transactions/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number, :currentDate => current_date}
    @connection.request(:get, path, nil, params)
end

#retrieve_transaction_details(id:) ⇒ Object

Retrieves a list of transaction details for the supplied transaction id.

A Transaction Detail contains information about the associated Transaction. This information can be an invoice associated to a payment or credit memo or a payment or credit memo used as payment for one or more invoices.

Parameters:

  • id (uuid)


50
51
52
53
# File 'lib/lockstep_sdk/clients/transactions_client.rb', line 50

def retrieve_transaction_details(id:)
    path = "/api/v1/Transactions/#{id}/details"
    @connection.request(:get, path, nil, nil)
end