Class: PaymentsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/payments.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



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

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_paymentsObject

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



69
70
71
72
# File 'lib/lockstep_sdk/clients/payments.rb', line 69

def create_payments()
    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



58
59
60
61
62
# File 'lib/lockstep_sdk/clients/payments.rb', line 58

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

#query_payment_detail_view(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ 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:



124
125
126
127
128
# File 'lib/lockstep_sdk/clients/payments.rb', line 124

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

#query_payment_summary_view(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ 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:



102
103
104
105
106
# File 'lib/lockstep_sdk/clients/payments.rb', line 102

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

#query_payments(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ 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:



85
86
87
88
89
# File 'lib/lockstep_sdk/clients/payments.rb', line 85

def query_payments(filter:, include_param:, order:, pageSize:, pageNumber:)
    path = "/api/v1/Payments/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => pageSize, :pageNumber => pageNumber}
    @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



33
34
35
36
37
# File 'lib/lockstep_sdk/clients/payments.rb', line 33

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.



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

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

#update_payment(id:) ⇒ 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



47
48
49
50
51
# File 'lib/lockstep_sdk/clients/payments.rb', line 47

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