Class: PaymentsClient

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

Instance Method Summary collapse

Constructor Details

#initialize(lockstepsdk) ⇒ PaymentsClient

Initialize the PaymentsClient class with a lockstepsdk instance.

Parameters:

  • lockstepsdk (LockstepApi)

    The Lockstep API client object for this connection



25
26
27
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 25

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_payments(body:) ⇒ Object

Creates one or more Payments within this account and returns the records as created.

A Payment represents money sent from one company to another. A single payment may contain payments for one or more invoices; it is also possible for payments to be made in advance of an invoice, for example, as a deposit. The creator of the Payment is identified by the `CustomerId` field, and the recipient of the Payment is identified by the `CompanyId` field. Most Payments are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the Payment. Payments that have not been fully applied have a nonzero `UnappliedAmount` value, which represents a deposit that has been paid and not yet applied to an Invoice.

Parameters:

  • body (PaymentModel)

    The Payments to create



74
75
76
77
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 74

def create_payments(body:)
    path = "/api/v1/Payments"
    @lockstepsdk.request(:post, path, body, nil)
end

#delete_payment(id:) ⇒ Object

Deletes the Payment referred to by this unique identifier.

A Payment represents money sent from one company to another. A single payment may contain payments for one or more invoices; it is also possible for payments to be made in advance of an invoice, for example, as a deposit. The creator of the Payment is identified by the `CustomerId` field, and the recipient of the Payment is identified by the `CompanyId` field. Most Payments are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the Payment. Payments that have not been fully applied have a nonzero `UnappliedAmount` value, which represents a deposit that has been paid and not yet applied to an Invoice.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Payment to delete; NOT the customer's ERP key



63
64
65
66
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 63

def delete_payment(id:)
    path = "/api/v1/Payments/#{id}"
    @lockstepsdk.request(:delete, path, nil, nil)
end

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

Queries Payments within the Lockstep platform using the specified filtering, sorting, nested fetch, and pagination rules requested.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. A Payment represents money sent from one company to another. A single payment may contain payments for one or more invoices; it is also possible for payments to be made in advance of an invoice, for example, as a deposit. The creator of the Payment is identified by the CustomerId field, and the recipient of the Payment is identified by the CompanyId field. Most Payments are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the Payment. Payments that have not been fully applied have a nonzero UnappliedAmount value, which represents a deposit that has been paid and not yet applied to an Invoice.

Parameters:



133
134
135
136
137
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 133

def query_payment_detail_view(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/Payments/views/detail"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @lockstepsdk.request(:get, path, nil, params)
end

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

Queries Payments for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. This query endpoint provides extra data about the summary of payment information.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website.

A Payment represents money sent from one company to another. A single payment may contain payments for one or more invoices; it is also possible for payments to be made in advance of an invoice, for example, as a deposit. The creator of the Payment is identified by the `CustomerId` field, and the recipient of the Payment is identified by the `CompanyId` field. Most Payments are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the Payment. Payments that have not been fully applied have a nonzero `UnappliedAmount` value, which represents a deposit that has been paid and not yet applied to an Invoice.

Parameters:



109
110
111
112
113
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 109

def query_payment_summary_view(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/Payments/views/summary"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @lockstepsdk.request(:get, path, nil, params)
end

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

Queries 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](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website.

A Payment represents money sent from one company to another. A single payment may contain payments for one or more invoices; it is also possible for payments to be made in advance of an invoice, for example, as a deposit. The creator of the Payment is identified by the `CustomerId` field, and the recipient of the Payment is identified by the `CompanyId` field. Most Payments are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the Payment. Payments that have not been fully applied have a nonzero `UnappliedAmount` value, which represents a deposit that has been paid and not yet applied to an Invoice.

Parameters:



91
92
93
94
95
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 91

def query_payments(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/Payments/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @lockstepsdk.request(:get, path, nil, params)
end

#retrieve_payment(id:, include_param:) ⇒ Object

Retrieves the Payment specified by this unique identifier, optionally including nested data sets.

A Payment represents money sent from one company to another. A single payment may contain payments for one or more invoices; it is also possible for payments to be made in advance of an invoice, for example, as a deposit. The creator of the Payment is identified by the `CustomerId` field, and the recipient of the Payment is identified by the `CompanyId` field. Most Payments are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the Payment. Payments that have not been fully applied have a nonzero `UnappliedAmount` value, which represents a deposit that has been paid and not yet applied to an Invoice.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of this Payment; NOT the customer's ERP key

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Applications, Notes, Attachments, CustomFields



37
38
39
40
41
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 37

def retrieve_payment(id:, include_param:)
    path = "/api/v1/Payments/#{id}"
    params = {:include => include_param}
    @lockstepsdk.request(:get, path, nil, params)
end

#retrieve_payment_detail_headerObject

Retrieves aggregated payment data from your account.



118
119
120
121
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 118

def retrieve_payment_detail_header()
    path = "/api/v1/Payments/views/detail-header"
    @lockstepsdk.request(:get, path, nil, nil)
end

#update_payment(id:, body:) ⇒ Object

Updates an existing Payment with the information supplied to this PATCH call.

The PATCH method allows you to change specific values on the object while leaving other values alone. As input you should supply a list of field names and new values. If you do not provide the name of a field, that field will remain unchanged. This allows you to ensure that you are only updating the specific fields desired.

A Payment represents money sent from one company to another. A single payment may contain payments for one or more invoices; it is also possible for payments to be made in advance of an invoice, for example, as a deposit. The creator of the Payment is identified by the `CustomerId` field, and the recipient of the Payment is identified by the `CompanyId` field. Most Payments are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the Payment. Payments that have not been fully applied have a nonzero `UnappliedAmount` value, which represents a deposit that has been paid and not yet applied to an Invoice.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Payment to update; NOT the customer's ERP key

  • body (object)

    A list of changes to apply to this Payment



52
53
54
55
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 52

def update_payment(id:, body:)
    path = "/api/v1/Payments/#{id}"
    @lockstepsdk.request(:patch, path, body.to_camelback_keys.to_json, nil)
end