Class: PaymentsClient

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

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ PaymentsClient

Initialize the PaymentsClient class with an API client instance.



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

def initialize(connection)
    @connection = connection
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.



71
72
73
74
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 71

def create_payments(body:)
    path = "/api/v1/Payments"
    @connection.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.



60
61
62
63
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 60

def delete_payment(id:)
    path = "/api/v1/Payments/#{id}"
    @connection.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.



141
142
143
144
145
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 141

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}
    @connection.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.



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

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}
    @connection.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.



88
89
90
91
92
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 88

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}
    @connection.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.



34
35
36
37
38
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 34

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

#retrieve_payment_detail_headerObject

Retrieves aggregated payment data from your account.



126
127
128
129
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 126

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

#retrieve_payment_pdf(id:) ⇒ Object

Retrieves a PDF file for this payment if it has been synced using an app enrollment to one of the supported apps.

QuickBooks Online supports AR Payments.



100
101
102
103
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 100

def retrieve_payment_pdf(id:)
    path = "/api/v1/Payments/#{id}/pdf"
    @connection.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.



49
50
51
52
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 49

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

#write_payments_to_connected_erp(body:) ⇒ Object

**This API endpoint is under maintenance and may not function properly.** Schedule an ERP post request for payments.

The payments must be associated with an active app enrollment and have a valid ‘AppEnrollmentId`.



153
154
155
156
# File 'lib/lockstep_sdk/clients/payments_client.rb', line 153

def write_payments_to_connected_erp(body:)
    path = "/api/v1/Payments/erp-write"
    @connection.request(:post, path, body, nil)
end