Class: LockstepSdk::PaymentSyncModel
- Inherits:
-
Object
- Object
- LockstepSdk::PaymentSyncModel
- Defined in:
- lib/lockstep_sdk/models/payment_sync_model.rb
Overview
The PaymentSyncModel represents information coming into Lockstep from an external financial system or other enterprise resource planning system. To import data from an external system, convert your original data into the PaymentSyncModel format and call the [Upload Sync File API](developer.lockstep.io/reference/post_api-v1-sync-zip). This API retrieves all of the data you uploaded in a compressed ZIP file and imports it into the Lockstep platform.
Once imported, this record will be available in the Lockstep API as a [PaymentModel](developer.lockstep.io/docs/paymentmodel).
For more information on writing your own connector, see [Connector Data](developer.lockstep.io/docs/connector-data).
Instance Attribute Summary collapse
-
#bank_account_id ⇒ String
Bank account id for the payment.
-
#base_currency_payment_amount ⇒ Double
Total amount of this payment in the erp’s base currency.
-
#base_currency_unapplied_amount ⇒ Double
Unapplied balance of this payment in the erp’s base currency.
-
#company_erp_key ⇒ String
The original primary key or unique ID of the company to which this payment belongs.
-
#created ⇒ Date-time
If known, the date when this record was created according to the originating financial system in which this record is maintained.
-
#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.
-
#erp_key ⇒ String
This is the primary key of the Payment record.
-
#in_dispute ⇒ Boolean
True if this payment is 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
True if this payment was voided.
-
#memo_text ⇒ String
Memo or reference text (ex. memo field on a check).
-
#modified ⇒ Date-time
If known, the date when this record was most recently modified according to the originating financial system in which this record is maintained.
-
#on_match_action ⇒ MatchAction
Indicates what action to take when an existing object has been found during the sync process.
-
#payment_amount ⇒ Double
Total amount of this payment in the payment’s currency.
-
#payment_date ⇒ Date-time
The date when this payment was received.
-
#payment_type ⇒ String
The type of payment, AR Payment or AP Payment.
-
#post_date ⇒ Date-time
The date when a payment was posted to a ledger.
-
#reference_code ⇒ String
A reference code for the payment for the given financial or ERP system.
-
#tender_type ⇒ String
Cash, check, credit card, wire transfer.
-
#unapplied_amount ⇒ Double
Unapplied balance of this payment in the payment’s currency.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ PaymentSyncModel
constructor
Initialize the PaymentSyncModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ PaymentSyncModel
Initialize the PaymentSyncModel using the provided prototype
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 33 def initialize(params = {}) @on_match_action = params.dig(:on_match_action) @erp_key = params.dig(:erp_key) @company_erp_key = params.dig(:company_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) @created = params.dig(:created) @modified = params.dig(:modified) @reference_code = params.dig(:reference_code) @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) @bank_account_id = params.dig(:bank_account_id) end |
Instance Attribute Details
#bank_account_id ⇒ String
Returns Bank account id for the payment.
139 140 141 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 139 def bank_account_id @bank_account_id end |
#base_currency_payment_amount ⇒ Double
Returns Total amount of this payment in the erp’s base currency.
131 132 133 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 131 def base_currency_payment_amount @base_currency_payment_amount end |
#base_currency_unapplied_amount ⇒ Double
Returns Unapplied balance of this payment in the erp’s base currency. If this amount is nonzero, the field ‘IsOpen` will be true.
135 136 137 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 135 def base_currency_unapplied_amount @base_currency_unapplied_amount end |
#company_erp_key ⇒ String
Returns The original primary key or unique ID of the company to which this payment belongs. This value should match the [Company ErpKey](developer.lockstep.io/docs/importing-companies#erpkey) field on the [CompanySyncModel](developer.lockstep.io/docs/importing-companies).
67 68 69 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 67 def company_erp_key @company_erp_key end |
#created ⇒ Date-time
Returns If known, the date when this record was created according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a created-date, leave this field null.
107 108 109 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 107 def created @created 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).
103 104 105 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 103 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.
127 128 129 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 127 def currency_rate @currency_rate end |
#erp_key ⇒ String
Returns This is the primary key of the Payment record. For this field, you should use whatever the payment’s unique identifying number is in the originating system. Search for a unique, non-changing number within the originating financial system for this record. Example: If you store your payment records in a database, whatever the primary key for the payment table is in the database should be the “ErpKey”. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).
63 64 65 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 63 def erp_key @erp_key end |
#in_dispute ⇒ Boolean
Returns True if this payment is in dispute.
123 124 125 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 123 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.
79 80 81 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 79 def is_open @is_open end |
#is_voided ⇒ Boolean
Returns True if this payment was voided.
119 120 121 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 119 def is_voided @is_voided end |
#memo_text ⇒ String
Returns Memo or reference text (ex. memo field on a check).
83 84 85 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 83 def memo_text @memo_text end |
#modified ⇒ Date-time
Returns If known, the date when this record was most recently modified according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a most-recently-modified-date, leave this field null.
111 112 113 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 111 def modified @modified end |
#on_match_action ⇒ MatchAction
Returns Indicates what action to take when an existing object has been found during the sync process.
59 60 61 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 59 def on_match_action @on_match_action end |
#payment_amount ⇒ Double
Returns Total amount of this payment in the payment’s currency.
95 96 97 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 95 def payment_amount @payment_amount end |
#payment_date ⇒ Date-time
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.
87 88 89 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 87 def payment_date @payment_date 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.
71 72 73 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 71 def payment_type @payment_type end |
#post_date ⇒ Date-time
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.
91 92 93 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 91 def post_date @post_date end |
#reference_code ⇒ String
Returns A reference code for the payment for the given financial or ERP system. This can be any value that the originating system uses to designate the payment, such as a confirmation number or tracking number, that is different from the ‘ErpKey` value.
115 116 117 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 115 def reference_code @reference_code 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.
75 76 77 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 75 def tender_type @tender_type end |
#unapplied_amount ⇒ Double
Returns Unapplied balance of this payment in the payment’s currency. If this amount is nonzero, the field ‘IsOpen` will be true.
99 100 101 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 99 def unapplied_amount @unapplied_amount end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 143 def as_json(={}) { 'onMatchAction' => @on_match_action, 'erpKey' => @erp_key, 'companyErpKey' => @company_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, 'created' => @created, 'modified' => @modified, 'referenceCode' => @reference_code, 'isVoided' => @is_voided, 'inDispute' => @in_dispute, 'currencyRate' => @currency_rate, 'baseCurrencyPaymentAmount' => @base_currency_payment_amount, 'baseCurrencyUnappliedAmount' => @base_currency_unapplied_amount, 'bankAccountId' => @bank_account_id, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
171 172 173 |
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 171 def to_json(*) "[#{as_json(*).to_json(*)}]" end |