Class: LockstepSdk::PaymentModel
- Inherits:
-
Object
- Object
- LockstepSdk::PaymentModel
- 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
-
#app_enrollment_id ⇒ Uuid
The AppEnrollmentId of the application that imported this record.
-
#applications ⇒ PaymentAppliedModel
All applications this payment is associated with.
-
#attachments ⇒ AttachmentModel
A collection of attachments linked to this record.
-
#base_currency_payment_amount ⇒ Double
Total amount of this payment in the group’s base currency.
-
#base_currency_unapplied_amount ⇒ Double
Unapplied balance of this payment in the group’s base currency.
-
#company_id ⇒ Uuid
The ID of the company to which this payment belongs.
-
#created ⇒ Date-time
The date on which this record was created.
-
#created_user_id ⇒ Uuid
The ID of the user who created this payment.
-
#currency_code ⇒ String
The ISO 4217 currency code for this payment.
-
#currency_rate ⇒ Double
The Currency Rate used to get from the account’s base currency to the payment amount.
-
#custom_field_definitions ⇒ CustomFieldDefinitionModel
A collection of custom fields linked to this record.
-
#custom_field_values ⇒ CustomFieldValueModel
A collection of custom fields linked to this record.
-
#erp_key ⇒ String
The unique ID of this record as it was known in its originating financial system.
-
#erp_write_status ⇒ ErpWriteStatuses
Possible statuses for a record that supports ERP write.
-
#erp_write_status_name ⇒ String
The name of the ErpWriteStatus for this Payment.
-
#group_key ⇒ Uuid
The GroupKey uniquely identifies a single Lockstep Platform account.
-
#in_dispute ⇒ Boolean
Is the payment in dispute?.
-
#is_open ⇒ Boolean
True if this payment includes some unassigned amount that has not yet been applied to an invoice.
-
#is_voided ⇒ Boolean
Is the payment voided?.
-
#memo_text ⇒ String
Memo or reference text (ex. memo field on a check).
-
#modified ⇒ Date-time
The date on which this record was last modified.
-
#modified_user_id ⇒ Uuid
The ID of the user who last modified this payment.
-
#notes ⇒ NoteModel
A collection of notes linked to this record.
-
#payment_amount ⇒ Double
Total amount of this payment in it’s received currency.
-
#payment_date ⇒ Date
The date when this payment was received.
-
#payment_id ⇒ Uuid
The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.
-
#payment_type ⇒ String
The type of payment, AR Payment or AP Payment.
-
#post_date ⇒ Date
The date when a payment was posted to a ledger.
-
#reference_code ⇒ String
Reference code for the payment for the given Erp system.
-
#service_fabric_status ⇒ String
The status of this payment within Service Fabric.
-
#source_modified_date ⇒ Date-time
The date on which this record was last modified in source ERP.
-
#tender_type ⇒ String
Cash, check, credit card, wire transfer.
-
#unapplied_amount ⇒ Double
Unapplied balance of this payment in it’s received currency.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ PaymentModel
constructor
Initialize the PaymentModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
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 60 61 62 63 64 65 |
# 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) @erp_write_status = params.dig(:erp_write_status) @erp_write_status_name = params.dig(:erp_write_status_name) @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) @base_currency_payment_amount = params.dig(:base_currency_payment_amount) @base_currency_unapplied_amount = params.dig(:base_currency_unapplied_amount) @service_fabric_status = params.dig(:service_fabric_status) @source_modified_date = params.dig(:source_modified_date) @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_id ⇒ Uuid
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.
149 150 151 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 149 def app_enrollment_id @app_enrollment_id end |
#applications ⇒ PaymentAppliedModel
Returns All applications this payment is associated with. To retrieve this collection, specify ‘Applications` in the “Include” parameter for your query.
181 182 183 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 181 def applications @applications end |
#attachments ⇒ AttachmentModel
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).
189 190 191 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 189 def @attachments end |
#base_currency_payment_amount ⇒ Double
Returns Total amount of this payment in the group’s base currency.
165 166 167 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 165 def base_currency_payment_amount @base_currency_payment_amount end |
#base_currency_unapplied_amount ⇒ Double
Returns Unapplied balance of this payment in the group’s base currency. If this amount is nonzero, the field ‘IsOpen` will be true.
169 170 171 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 169 def base_currency_unapplied_amount @base_currency_unapplied_amount end |
#company_id ⇒ Uuid
Returns The ID of the company to which this payment belongs.
77 78 79 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 77 def company_id @company_id end |
#created ⇒ Date-time
Returns The date on which this record was created.
133 134 135 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 133 def created @created end |
#created_user_id ⇒ Uuid
Returns The ID of the user who created this payment.
137 138 139 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 137 def created_user_id @created_user_id end |
#currency_code ⇒ String
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).
125 126 127 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 125 def currency_code @currency_code end |
#currency_rate ⇒ Double
Returns The Currency Rate used to get from the account’s base currency to the payment amount.
161 162 163 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 161 def currency_rate @currency_rate end |
#custom_field_definitions ⇒ CustomFieldDefinitionModel
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).
193 194 195 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 193 def custom_field_definitions @custom_field_definitions end |
#custom_field_values ⇒ CustomFieldValueModel
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).
197 198 199 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 197 def custom_field_values @custom_field_values end |
#erp_key ⇒ String
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).
81 82 83 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 81 def erp_key @erp_key end |
#erp_write_status ⇒ ErpWriteStatuses
Returns Possible statuses for a record that supports ERP write.
85 86 87 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 85 def erp_write_status @erp_write_status end |
#erp_write_status_name ⇒ String
Returns The name of the ErpWriteStatus for this Payment.
89 90 91 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 89 def erp_write_status_name @erp_write_status_name end |
#group_key ⇒ Uuid
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).
69 70 71 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 69 def group_key @group_key end |
#in_dispute ⇒ Boolean
Returns Is the payment in dispute?.
157 158 159 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 157 def in_dispute @in_dispute end |
#is_open ⇒ Boolean
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.
101 102 103 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 101 def is_open @is_open end |
#is_voided ⇒ Boolean
Returns Is the payment voided?.
153 154 155 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 153 def is_voided @is_voided end |
#memo_text ⇒ String
Returns Memo or reference text (ex. memo field on a check).
105 106 107 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 105 def memo_text @memo_text end |
#modified ⇒ Date-time
Returns The date on which this record was last modified.
141 142 143 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 141 def modified @modified end |
#modified_user_id ⇒ Uuid
Returns The ID of the user who last modified this payment.
145 146 147 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 145 def modified_user_id @modified_user_id end |
#notes ⇒ NoteModel
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).
185 186 187 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 185 def notes @notes end |
#payment_amount ⇒ Double
Returns Total amount of this payment in it’s received currency.
117 118 119 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 117 def payment_amount @payment_amount end |
#payment_date ⇒ Date
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.
109 110 111 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 109 def payment_date @payment_date end |
#payment_id ⇒ Uuid
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`.
73 74 75 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 73 def payment_id @payment_id end |
#payment_type ⇒ String
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.
93 94 95 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 93 def payment_type @payment_type end |
#post_date ⇒ Date
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.
113 114 115 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 113 def post_date @post_date end |
#reference_code ⇒ String
Returns Reference code for the payment for the given Erp system.
129 130 131 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 129 def reference_code @reference_code end |
#service_fabric_status ⇒ String
Returns The status of this payment within Service Fabric. “UNAUTHORISED” “PENDING” “PAID” “PAID_OFFLINE” “FAILED” “CANCELLED” “REJECTED” “REFUNDED” “PARTIALLY” “PARTIALLY_REFUNDED”.
173 174 175 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 173 def service_fabric_status @service_fabric_status end |
#source_modified_date ⇒ Date-time
Returns The date on which this record was last modified in source ERP.
177 178 179 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 177 def source_modified_date @source_modified_date end |
#tender_type ⇒ String
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.
97 98 99 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 97 def tender_type @tender_type end |
#unapplied_amount ⇒ Double
Returns Unapplied balance of this payment in it’s received currency. If this amount is nonzero, the field ‘IsOpen` will be true.
121 122 123 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 121 def unapplied_amount @unapplied_amount end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 201 def as_json(={}) { 'groupKey' => @group_key, 'paymentId' => @payment_id, 'companyId' => @company_id, 'erpKey' => @erp_key, 'erpWriteStatus' => @erp_write_status, 'erpWriteStatusName' => @erp_write_status_name, '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, 'baseCurrencyPaymentAmount' => @base_currency_payment_amount, 'baseCurrencyUnappliedAmount' => @base_currency_unapplied_amount, 'serviceFabricStatus' => @service_fabric_status, 'sourceModifiedDate' => @source_modified_date, '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.
241 242 243 |
# File 'lib/lockstep_sdk/models/payment_model.rb', line 241 def to_json(*) "[#{as_json(*).to_json(*)}]" end |