Class: LockstepSdk::InsertPaymentRequestModel

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

Overview

A request to insert a new Payment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ InsertPaymentRequestModel

Initialize the InsertPaymentRequestModel using the provided prototype



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 25

def initialize(params = {})
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @payment_id = params.dig(:payment_id)
    @company_id = params.dig(:company_id)
    @company_erp_key = params.dig(:company_erp_key)
    @company_external_reference = params.dig(:company_external_reference)
    @erp_key = params.dig(:erp_key)
    @payment_type = params.dig(:payment_type)
    @tender_type = params.dig(:tender_type)
    @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)
    @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)
    @group_key = params.dig(:group_key)
    @applications = params.dig(:applications)
end

Instance Attribute Details

#app_enrollment_idUuid

Returns The AppEnrollmentId of the application to write this record to.

Returns:

  • (Uuid)

    The AppEnrollmentId of the application to write this record to.



53
54
55
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 53

def app_enrollment_id
  @app_enrollment_id
end

#applicationsInsertPaymentAppliedRequestModel

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

Returns:

  • (InsertPaymentAppliedRequestModel)

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



141
142
143
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 141

def applications
  @applications
end

#bank_account_idString

Returns The Bank account id for the company to which this payment belongs.

Returns:

  • (String)

    The Bank account id for the company to which this payment belongs.



133
134
135
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 133

def 
  @bank_account_id
end

#base_currency_payment_amountDouble

Returns Total amount of this payment in the group’s base currency.

Returns:

  • (Double)

    Total amount of this payment in the group’s base currency.



125
126
127
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 125

def base_currency_payment_amount
  @base_currency_payment_amount
end

#base_currency_unapplied_amountDouble

Returns Unapplied balance of this payment in the group’s base currency. If this amount is nonzero, the field ‘IsOpen` will be true.

Returns:

  • (Double)

    Unapplied balance of this payment in the group’s base currency. If this amount is nonzero, the field ‘IsOpen` will be true.



129
130
131
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 129

def base_currency_unapplied_amount
  @base_currency_unapplied_amount
end

#company_erp_keyString

Returns The ERP key for the company to which this payment belongs.

Returns:

  • (String)

    The ERP key for the company to which this payment belongs.



65
66
67
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 65

def company_erp_key
  @company_erp_key
end

#company_external_referenceString

Returns A additional reference that may be used in the ERP.

Returns:

  • (String)

    A additional reference that may be used in the ERP



69
70
71
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 69

def company_external_reference
  @company_external_reference
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.



61
62
63
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 61

def company_id
  @company_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).

Returns:



105
106
107
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 105

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.



121
122
123
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 121

def currency_rate
  @currency_rate
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).



73
74
75
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 73

def erp_key
  @erp_key
end

#group_keyUuid

Returns The GroupKey this request belongs to.

Returns:

  • (Uuid)

    The GroupKey this request belongs to.



137
138
139
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 137

def group_key
  @group_key
end

#in_disputeBoolean

Returns Is the payment in dispute?.

Returns:

  • (Boolean)

    Is the payment in dispute?



117
118
119
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 117

def in_dispute
  @in_dispute
end

#is_voidedBoolean

Returns Is the payment voided?.

Returns:

  • (Boolean)

    Is the payment voided?



113
114
115
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 113

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



85
86
87
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 85

def memo_text
  @memo_text
end

#payment_amountDouble

Returns Total amount of this payment in it’s received currency.

Returns:

  • (Double)

    Total amount of this payment in it’s received currency.



97
98
99
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 97

def payment_amount
  @payment_amount
end

#payment_dateDate-time

Returns The date when this payment was received.

Returns:

  • (Date-time)

    The date when this payment was received.



89
90
91
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 89

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



57
58
59
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 57

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



77
78
79
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 77

def payment_type
  @payment_type
end

#post_dateDate-time

Returns The date when a payment was posted to a ledger.

Returns:

  • (Date-time)

    The date when a payment was posted to a ledger.



93
94
95
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 93

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.



109
110
111
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 109

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.



81
82
83
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 81

def tender_type
  @tender_type
end

#unapplied_amountDouble

Returns Unapplied balance of this payment in it’s received currency. If this amount is nonzero, the field ‘IsOpen` will be true.

Returns:

  • (Double)

    Unapplied balance of this payment in it’s received currency. If this amount is nonzero, the field ‘IsOpen` will be true.



101
102
103
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 101

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



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 145

def as_json(options={})
    {
        'appEnrollmentId' => @app_enrollment_id,
        'paymentId' => @payment_id,
        'companyId' => @company_id,
        'companyErpKey' => @company_erp_key,
        'companyExternalReference' => @company_external_reference,
        'erpKey' => @erp_key,
        'paymentType' => @payment_type,
        'tenderType' => @tender_type,
        'memoText' => @memo_text,
        'paymentDate' => @payment_date,
        'postDate' => @post_date,
        'paymentAmount' => @payment_amount,
        'unappliedAmount' => @unapplied_amount,
        'currencyCode' => @currency_code,
        '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,
        'groupKey' => @group_key,
        'applications' => @applications,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



175
176
177
# File 'lib/lockstep_sdk/models/insert_payment_request_model.rb', line 175

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