Class: LockstepSdk::PaymentSyncModel

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ PaymentSyncModel

Initialize the PaymentSyncModel using the provided prototype



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 35

def initialize(params = {})
    @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)
end

Instance Attribute Details

#company_erp_keyString

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).

Returns:



60
61
62
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 60

def company_erp_key
  @company_erp_key
end

#createdDate-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.

Returns:

  • (Date-time)

    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.



100
101
102
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 100

def created
  @created
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/currencies data set.

Returns:



96
97
98
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 96

def currency_code
  @currency_code
end

#erp_keyString

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).

Returns:

  • (String)

    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).



56
57
58
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 56

def erp_key
  @erp_key
end

#in_disputeBoolean

Returns True if this payment is in dispute.

Returns:

  • (Boolean)

    True if this payment is in dispute.



116
117
118
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 116

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.



72
73
74
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 72

def is_open
  @is_open
end

#is_voidedBoolean

Returns True if this payment was voided.

Returns:

  • (Boolean)

    True if this payment was voided.



112
113
114
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 112

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).



76
77
78
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 76

def memo_text
  @memo_text
end

#modifiedDate-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.

Returns:

  • (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. If the originating financial system does not maintain a most-recently-modified-date, leave this field null.



104
105
106
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 104

def modified
  @modified
end

#payment_amountDouble

Returns Total amount of this payment.

Returns:

  • (Double)

    Total amount of this payment.



88
89
90
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 88

def payment_amount
  @payment_amount
end

#payment_dateDate-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.

Returns:

  • (Date-time)

    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.



80
81
82
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 80

def payment_date
  @payment_date
end

#payment_typeString

Returns The type of payment, cash or check. Recognized PaymentType values are: * ‘Cash` - A cash payment or other direct transfer. * `Check` - A check payment.

Returns:

  • (String)

    The type of payment, cash or check. Recognized PaymentType values are: * ‘Cash` - A cash payment or other direct transfer. * `Check` - A check payment.



64
65
66
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 64

def payment_type
  @payment_type
end

#post_dateDate-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.

Returns:

  • (Date-time)

    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.



84
85
86
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 84

def 
  @post_date
end

#reference_codeString

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.

Returns:

  • (String)

    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.



108
109
110
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 108

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.

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.



68
69
70
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 68

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.



92
93
94
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 92

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



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/lockstep_sdk/models/payment_sync_model.rb', line 120

def as_json(options={})
    {
        '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,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



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

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