Class: LockstepSdk::PaymentModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/payment_model.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ PaymentModel

Initialize the PaymentModel using the provided prototype



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/lockstep_sdk/models/payment_model.rb', line 31

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @payment_id = params.dig(:payment_id)
    @company_id = params.dig(:company_id)
    @erp_key = params.dig(:erp_key)
    @payment_type = params.dig(:payment_type)
    @tender_type = params.dig(:tender_type)
    @is_open = params.dig(:is_open)
    @memo_text = params.dig(:memo_text)
    @payment_date = params.dig(:payment_date)
    @post_date = params.dig(:post_date)
    @payment_amount = params.dig(:payment_amount)
    @unapplied_amount = params.dig(:unapplied_amount)
    @currency_code = params.dig(:currency_code)
    @reference_code = params.dig(:reference_code)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @is_voided = params.dig(:is_voided)
    @in_dispute = params.dig(:in_dispute)
    @currency_rate = params.dig(:currency_rate)
    @applications = params.dig(:applications)
    @notes = params.dig(:notes)
    @attachments = params.dig(:attachments)
    @custom_field_definitions = params.dig(:custom_field_definitions)
    @custom_field_values = params.dig(:custom_field_values)
end

Instance Attribute Details

#app_enrollment_idUuid

Returns The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.

Returns:

  • (Uuid)

    The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.



135
136
137
# File 'lib/lockstep_sdk/models/payment_model.rb', line 135

def app_enrollment_id
  @app_enrollment_id
end

#applicationsPaymentAppliedModel

Returns All applications this payment is associated with. To retrieve this collection, specify Applications in the “Include” parameter for your query.

Returns:

  • (PaymentAppliedModel)

    All applications this payment is associated with. To retrieve this collection, specify Applications in the “Include” parameter for your query.



151
152
153
# File 'lib/lockstep_sdk/models/payment_model.rb', line 151

def applications
  @applications
end

#attachmentsAttachmentModel

Returns A collection of attachments linked to this record. To retrieve this collection, specify Attachments in the include parameter when retrieving data. To create an attachment, use the [Upload Attachment](developer.lockstep.io/reference/post_api-v1-attachments) endpoint with the TableKey to Payment and the ObjectKey set to the PaymentId for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



159
160
161
# File 'lib/lockstep_sdk/models/payment_model.rb', line 159

def attachments
  @attachments
end

#company_idUuid

Returns The ID of the company to which this payment belongs.

Returns:

  • (Uuid)

    The ID of the company to which this payment belongs.



71
72
73
# File 'lib/lockstep_sdk/models/payment_model.rb', line 71

def company_id
  @company_id
end

#createdDate-time

Returns The date on which this record was created.

Returns:

  • (Date-time)

    The date on which this record was created.



119
120
121
# File 'lib/lockstep_sdk/models/payment_model.rb', line 119

def created
  @created
end

#created_user_idUuid

Returns The ID of the user who created this payment.

Returns:

  • (Uuid)

    The ID of the user who created this payment.



123
124
125
# File 'lib/lockstep_sdk/models/payment_model.rb', line 123

def created_user_id
  @created_user_id
end

#currency_codeString

Returns The ISO 4217 currency code for this payment. For a list of ISO 4217 currency codes, see [Query Currencies](developer.lockstep.io/reference/get_api-v1-definitions-currencies). This will be validated by the /api/v1/definitions/currencies data set.

Returns:



111
112
113
# File 'lib/lockstep_sdk/models/payment_model.rb', line 111

def currency_code
  @currency_code
end

#currency_rateDouble

Returns The Currency Rate used to get from the account’s base currency to the payment amount.

Returns:

  • (Double)

    The Currency Rate used to get from the account’s base currency to the payment amount.



147
148
149
# File 'lib/lockstep_sdk/models/payment_model.rb', line 147

def currency_rate
  @currency_rate
end

#custom_field_definitionsCustomFieldDefinitionModel

Returns A collection of custom fields linked to this record. To retrieve this collection, specify CustomFieldDefinitions in the include parameter when retrieving data. To create a custom field, use the [Create Custom Field](developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the TableKey to Payment and the ObjectKey set to the PaymentId for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



163
164
165
# File 'lib/lockstep_sdk/models/payment_model.rb', line 163

def custom_field_definitions
  @custom_field_definitions
end

#custom_field_valuesCustomFieldValueModel

Returns A collection of custom fields linked to this record. To retrieve this collection, specify CustomFieldValues in the include parameter when retrieving data. To create a custom field, use the [Create Custom Field](developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the TableKey to Payment and the ObjectKey set to the PaymentId for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



167
168
169
# File 'lib/lockstep_sdk/models/payment_model.rb', line 167

def custom_field_values
  @custom_field_values
end

#erp_keyString

Returns The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value ErpKey set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be null. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).

Returns:

  • (String)

    The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value ErpKey set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be null. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).



75
76
77
# File 'lib/lockstep_sdk/models/payment_model.rb', line 75

def erp_key
  @erp_key
end

#group_keyUuid

Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).

Returns:

  • (Uuid)

    The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).



63
64
65
# File 'lib/lockstep_sdk/models/payment_model.rb', line 63

def group_key
  @group_key
end

#in_disputeBoolean

Returns Is the payment in dispute?.

Returns:

  • (Boolean)

    Is the payment in dispute?



143
144
145
# File 'lib/lockstep_sdk/models/payment_model.rb', line 143

def in_dispute
  @in_dispute
end

#is_openBoolean

Returns True if this payment includes some unassigned amount that has not yet been applied to an invoice. If this value is true, the field UnappliedAmount will be nonzero.

Returns:

  • (Boolean)

    True if this payment includes some unassigned amount that has not yet been applied to an invoice. If this value is true, the field UnappliedAmount will be nonzero.



87
88
89
# File 'lib/lockstep_sdk/models/payment_model.rb', line 87

def is_open
  @is_open
end

#is_voidedBoolean

Returns Is the payment voided?.

Returns:

  • (Boolean)

    Is the payment voided?



139
140
141
# File 'lib/lockstep_sdk/models/payment_model.rb', line 139

def is_voided
  @is_voided
end

#memo_textString

Returns Memo or reference text (ex. memo field on a check).

Returns:

  • (String)

    Memo or reference text (ex. memo field on a check).



91
92
93
# File 'lib/lockstep_sdk/models/payment_model.rb', line 91

def memo_text
  @memo_text
end

#modifiedDate-time

Returns The date on which this record was last modified.

Returns:

  • (Date-time)

    The date on which this record was last modified.



127
128
129
# File 'lib/lockstep_sdk/models/payment_model.rb', line 127

def modified
  @modified
end

#modified_user_idUuid

Returns The ID of the user who last modified this payment.

Returns:

  • (Uuid)

    The ID of the user who last modified this payment.



131
132
133
# File 'lib/lockstep_sdk/models/payment_model.rb', line 131

def modified_user_id
  @modified_user_id
end

#notesNoteModel

Returns A collection of notes linked to this record. To retrieve this collection, specify Notes in the include parameter when retrieving data. To create a note, use the [Create Note](developer.lockstep.io/reference/post_api-v1-notes) endpoint with the TableKey to Payment and the ObjectKey set to the PaymentId for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



155
156
157
# File 'lib/lockstep_sdk/models/payment_model.rb', line 155

def notes
  @notes
end

#payment_amountDouble

Returns Total amount of this payment.

Returns:

  • (Double)

    Total amount of this payment.



103
104
105
# File 'lib/lockstep_sdk/models/payment_model.rb', line 103

def payment_amount
  @payment_amount
end

#payment_dateDate

Returns The date when this payment was received. This typically is the date when an accounting employee recorded that they received notification that the payment had occurred, whether they were notified by email, postal mail, or financial transaction notification.

Returns:

  • (Date)

    The date when this payment was received. This typically is the date when an accounting employee recorded that they received notification that the payment had occurred, whether they were notified by email, postal mail, or financial transaction notification.



95
96
97
# File 'lib/lockstep_sdk/models/payment_model.rb', line 95

def payment_date
  @payment_date
end

#payment_idUuid

Returns The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see ErpKey.

Returns:

  • (Uuid)

    The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see ErpKey.



67
68
69
# File 'lib/lockstep_sdk/models/payment_model.rb', line 67

def payment_id
  @payment_id
end

#payment_typeString

Returns The type of payment, AR Payment or AP Payment. Recognized PaymentType values are: * ‘AR Payment` - A payment made by a Customer to the Company * `AP Payment` - A payment made by the Company to a Vendor.

Returns:

  • (String)

    The type of payment, AR Payment or AP Payment. Recognized PaymentType values are: * ‘AR Payment` - A payment made by a Customer to the Company * `AP Payment` - A payment made by the Company to a Vendor



79
80
81
# File 'lib/lockstep_sdk/models/payment_model.rb', line 79

def payment_type
  @payment_type
end

#post_dateDate

Returns The date when a payment was posted to a ledger. This date is often determined by a company’s accounting practices and may be different than the date when the payment was received. This date may be affected by issues such as temporary holds on funds transferred, bank holidays, or other actions.

Returns:

  • (Date)

    The date when a payment was posted to a ledger. This date is often determined by a company’s accounting practices and may be different than the date when the payment was received. This date may be affected by issues such as temporary holds on funds transferred, bank holidays, or other actions.



99
100
101
# File 'lib/lockstep_sdk/models/payment_model.rb', line 99

def 
  @post_date
end

#reference_codeString

Returns Reference code for the payment for the given Erp system.

Returns:

  • (String)

    Reference code for the payment for the given Erp system.



115
116
117
# File 'lib/lockstep_sdk/models/payment_model.rb', line 115

def reference_code
  @reference_code
end

#tender_typeString

Returns Cash, check, credit card, wire transfer. Recognized TenderType values are: * Cash - A cash payment or other direct transfer. * Check - A check payment. * ‘Credit Card` - A payment made via a credit card. * `Wire Transfer` - A payment made via wire transfer from another financial institution. * Other - A payment made via another method not listed above.

Returns:

  • (String)

    Cash, check, credit card, wire transfer. Recognized TenderType values are: * Cash - A cash payment or other direct transfer. * Check - A check payment. * ‘Credit Card` - A payment made via a credit card. * `Wire Transfer` - A payment made via wire transfer from another financial institution. * Other - A payment made via another method not listed above.



83
84
85
# File 'lib/lockstep_sdk/models/payment_model.rb', line 83

def tender_type
  @tender_type
end

#unapplied_amountDouble

Returns Unapplied balance of this payment. If this amount is nonzero, the field IsOpen will be true.

Returns:

  • (Double)

    Unapplied balance of this payment. If this amount is nonzero, the field IsOpen will be true.



107
108
109
# File 'lib/lockstep_sdk/models/payment_model.rb', line 107

def unapplied_amount
  @unapplied_amount
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/lockstep_sdk/models/payment_model.rb', line 171

def as_json(options={})
    {
        'groupKey' => @group_key,
        'paymentId' => @payment_id,
        'companyId' => @company_id,
        'erpKey' => @erp_key,
        'paymentType' => @payment_type,
        'tenderType' => @tender_type,
        'isOpen' => @is_open,
        'memoText' => @memo_text,
        'paymentDate' => @payment_date,
        'postDate' => @post_date,
        'paymentAmount' => @payment_amount,
        'unappliedAmount' => @unapplied_amount,
        'currencyCode' => @currency_code,
        'referenceCode' => @reference_code,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'appEnrollmentId' => @app_enrollment_id,
        'isVoided' => @is_voided,
        'inDispute' => @in_dispute,
        'currencyRate' => @currency_rate,
        'applications' => @applications,
        'notes' => @notes,
        'attachments' => @attachments,
        'customFieldDefinitions' => @custom_field_definitions,
        'customFieldValues' => @custom_field_values,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



205
206
207
# File 'lib/lockstep_sdk/models/payment_model.rb', line 205

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end