Class: PaysecureApiDocumentationLive::CaptureTxn

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paysecure_api_documentation_live/models/capture_txn.rb

Overview

CaptureTxn Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(capture_id:, purchase_id:, amount:, fx_amount:, status:, psp_reference:, merchant_reference:, created_at:, updated_at:, white_id:, fx_currency:, bank_mid:, is_test:, currency:, amount_in_usd:, merchant_name:, bank_name:, bank_id:, trx_method:, rolling_reserve:, trans_fees:, mdr:, is_settlement_pending:, parent_id:, trans_settlement_id:, error_settlement_id:, merchant_id:, additional_properties: nil) ⇒ CaptureTxn

Returns a new instance of CaptureTxn.



167
168
169
170
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
202
203
204
205
206
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 167

def initialize(capture_id:, purchase_id:, amount:, fx_amount:, status:,
               psp_reference:, merchant_reference:, created_at:,
               updated_at:, white_id:, fx_currency:, bank_mid:, is_test:,
               currency:, amount_in_usd:, merchant_name:, bank_name:,
               bank_id:, trx_method:, rolling_reserve:, trans_fees:, mdr:,
               is_settlement_pending:, parent_id:, trans_settlement_id:,
               error_settlement_id:, merchant_id:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @capture_id = capture_id
  @purchase_id = purchase_id
  @amount = amount
  @fx_amount = fx_amount
  @status = status
  @psp_reference = psp_reference
  @merchant_reference = merchant_reference
  @created_at = created_at
  @updated_at = updated_at
  @white_id = white_id
  @fx_currency = fx_currency
  @bank_mid = bank_mid
  @is_test = is_test
  @currency = currency
  @amount_in_usd = amount_in_usd
  @merchant_name = merchant_name
  @bank_name = bank_name
  @bank_id = bank_id
  @trx_method = trx_method
  @rolling_reserve = rolling_reserve
  @trans_fees = trans_fees
  @mdr = mdr
  @is_settlement_pending = is_settlement_pending
  @parent_id = parent_id
  @trans_settlement_id = trans_settlement_id
  @error_settlement_id = error_settlement_id
  @merchant_id = merchant_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#amountFloat

TODO: Write general description for this method

Returns:

  • (Float)


22
23
24
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 22

def amount
  @amount
end

#amount_in_usdFloat

TODO: Write general description for this method

Returns:

  • (Float)


70
71
72
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 70

def amount_in_usd
  @amount_in_usd
end

#bank_idString

TODO: Write general description for this method

Returns:

  • (String)


82
83
84
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 82

def bank_id
  @bank_id
end

#bank_midString

TODO: Write general description for this method

Returns:

  • (String)


58
59
60
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 58

def bank_mid
  @bank_mid
end

#bank_nameString

TODO: Write general description for this method

Returns:

  • (String)


78
79
80
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 78

def bank_name
  @bank_name
end

#capture_idString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 14

def capture_id
  @capture_id
end

#created_atInteger

TODO: Write general description for this method

Returns:

  • (Integer)


42
43
44
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 42

def created_at
  @created_at
end

#currencyString

TODO: Write general description for this method

Returns:

  • (String)


66
67
68
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 66

def currency
  @currency
end

#error_settlement_idString

TODO: Write general description for this method

Returns:

  • (String)


114
115
116
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 114

def error_settlement_id
  @error_settlement_id
end

#fx_amountFloat

TODO: Write general description for this method

Returns:

  • (Float)


26
27
28
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 26

def fx_amount
  @fx_amount
end

#fx_currencyString

TODO: Write general description for this method

Returns:

  • (String)


54
55
56
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 54

def fx_currency
  @fx_currency
end

#is_settlement_pendingInteger

TODO: Write general description for this method

Returns:

  • (Integer)


102
103
104
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 102

def is_settlement_pending
  @is_settlement_pending
end

#is_testTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


62
63
64
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 62

def is_test
  @is_test
end

#mdrFloat

TODO: Write general description for this method

Returns:

  • (Float)


98
99
100
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 98

def mdr
  @mdr
end

#merchant_idString

TODO: Write general description for this method

Returns:

  • (String)


118
119
120
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 118

def merchant_id
  @merchant_id
end

#merchant_nameString

TODO: Write general description for this method

Returns:

  • (String)


74
75
76
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 74

def merchant_name
  @merchant_name
end

#merchant_referenceString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 38

def merchant_reference
  @merchant_reference
end

#parent_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


106
107
108
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 106

def parent_id
  @parent_id
end

#psp_referenceString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 34

def psp_reference
  @psp_reference
end

#purchase_idString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 18

def purchase_id
  @purchase_id
end

#rolling_reserveFloat

TODO: Write general description for this method

Returns:

  • (Float)


90
91
92
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 90

def rolling_reserve
  @rolling_reserve
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 30

def status
  @status
end

#trans_feesFloat

TODO: Write general description for this method

Returns:

  • (Float)


94
95
96
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 94

def trans_fees
  @trans_fees
end

#trans_settlement_idString

TODO: Write general description for this method

Returns:

  • (String)


110
111
112
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 110

def trans_settlement_id
  @trans_settlement_id
end

#trx_methodString

TODO: Write general description for this method

Returns:

  • (String)


86
87
88
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 86

def trx_method
  @trx_method
end

#updated_atInteger

TODO: Write general description for this method

Returns:

  • (Integer)


46
47
48
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 46

def updated_at
  @updated_at
end

#white_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


50
51
52
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 50

def white_id
  @white_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 209

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  capture_id = hash.key?('captureId') ? hash['captureId'] : nil
  purchase_id = hash.key?('purchaseId') ? hash['purchaseId'] : nil
  amount = hash.key?('amount') ? hash['amount'] : nil
  fx_amount = hash.key?('fxAmount') ? hash['fxAmount'] : nil
  status = hash.key?('status') ? hash['status'] : nil
  psp_reference = hash.key?('pspReference') ? hash['pspReference'] : nil
  merchant_reference =
    hash.key?('merchantReference') ? hash['merchantReference'] : nil
  created_at = hash.key?('createdAt') ? hash['createdAt'] : nil
  updated_at = hash.key?('updatedAt') ? hash['updatedAt'] : nil
  white_id = hash.key?('whiteId') ? hash['whiteId'] : nil
  fx_currency = hash.key?('fxCurrency') ? hash['fxCurrency'] : nil
  bank_mid = hash.key?('bankMid') ? hash['bankMid'] : nil
  is_test = hash.key?('isTest') ? hash['isTest'] : nil
  currency = hash.key?('currency') ? hash['currency'] : nil
  amount_in_usd = hash.key?('amountInUsd') ? hash['amountInUsd'] : nil
  merchant_name = hash.key?('merchantName') ? hash['merchantName'] : nil
  bank_name = hash.key?('bankName') ? hash['bankName'] : nil
  bank_id = hash.key?('bankId') ? hash['bankId'] : nil
  trx_method = hash.key?('trxMethod') ? hash['trxMethod'] : nil
  rolling_reserve =
    hash.key?('rollingReserve') ? hash['rollingReserve'] : nil
  trans_fees = hash.key?('transFees') ? hash['transFees'] : nil
  mdr = hash.key?('mdr') ? hash['mdr'] : nil
  is_settlement_pending =
    hash.key?('isSettlementPending') ? hash['isSettlementPending'] : nil
  parent_id = hash.key?('parentId') ? hash['parentId'] : nil
  trans_settlement_id =
    hash.key?('transSettlementId') ? hash['transSettlementId'] : nil
  error_settlement_id =
    hash.key?('errorSettlementId') ? hash['errorSettlementId'] : nil
  merchant_id = hash.key?('merchantId') ? hash['merchantId'] : nil

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  CaptureTxn.new(capture_id: capture_id,
                 purchase_id: purchase_id,
                 amount: amount,
                 fx_amount: fx_amount,
                 status: status,
                 psp_reference: psp_reference,
                 merchant_reference: merchant_reference,
                 created_at: created_at,
                 updated_at: updated_at,
                 white_id: white_id,
                 fx_currency: fx_currency,
                 bank_mid: bank_mid,
                 is_test: is_test,
                 currency: currency,
                 amount_in_usd: amount_in_usd,
                 merchant_name: merchant_name,
                 bank_name: bank_name,
                 bank_id: bank_id,
                 trx_method: trx_method,
                 rolling_reserve: rolling_reserve,
                 trans_fees: trans_fees,
                 mdr: mdr,
                 is_settlement_pending: is_settlement_pending,
                 parent_id: parent_id,
                 trans_settlement_id: trans_settlement_id,
                 error_settlement_id: error_settlement_id,
                 merchant_id: merchant_id,
                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 121

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['capture_id'] = 'captureId'
  @_hash['purchase_id'] = 'purchaseId'
  @_hash['amount'] = 'amount'
  @_hash['fx_amount'] = 'fxAmount'
  @_hash['status'] = 'status'
  @_hash['psp_reference'] = 'pspReference'
  @_hash['merchant_reference'] = 'merchantReference'
  @_hash['created_at'] = 'createdAt'
  @_hash['updated_at'] = 'updatedAt'
  @_hash['white_id'] = 'whiteId'
  @_hash['fx_currency'] = 'fxCurrency'
  @_hash['bank_mid'] = 'bankMid'
  @_hash['is_test'] = 'isTest'
  @_hash['currency'] = 'currency'
  @_hash['amount_in_usd'] = 'amountInUsd'
  @_hash['merchant_name'] = 'merchantName'
  @_hash['bank_name'] = 'bankName'
  @_hash['bank_id'] = 'bankId'
  @_hash['trx_method'] = 'trxMethod'
  @_hash['rolling_reserve'] = 'rollingReserve'
  @_hash['trans_fees'] = 'transFees'
  @_hash['mdr'] = 'mdr'
  @_hash['is_settlement_pending'] = 'isSettlementPending'
  @_hash['parent_id'] = 'parentId'
  @_hash['trans_settlement_id'] = 'transSettlementId'
  @_hash['error_settlement_id'] = 'errorSettlementId'
  @_hash['merchant_id'] = 'merchantId'
  @_hash
end

.nullablesObject

An array for nullable fields



159
160
161
162
163
164
165
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 159

def self.nullables
  %w[
    psp_reference
    trans_settlement_id
    error_settlement_id
  ]
end

.optionalsObject

An array for optional fields



154
155
156
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 154

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 301

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} capture_id: #{@capture_id.inspect}, purchase_id: #{@purchase_id.inspect},"\
  " amount: #{@amount.inspect}, fx_amount: #{@fx_amount.inspect}, status: #{@status.inspect},"\
  " psp_reference: #{@psp_reference.inspect}, merchant_reference:"\
  " #{@merchant_reference.inspect}, created_at: #{@created_at.inspect}, updated_at:"\
  " #{@updated_at.inspect}, white_id: #{@white_id.inspect}, fx_currency:"\
  " #{@fx_currency.inspect}, bank_mid: #{@bank_mid.inspect}, is_test: #{@is_test.inspect},"\
  " currency: #{@currency.inspect}, amount_in_usd: #{@amount_in_usd.inspect}, merchant_name:"\
  " #{@merchant_name.inspect}, bank_name: #{@bank_name.inspect}, bank_id: #{@bank_id.inspect},"\
  " trx_method: #{@trx_method.inspect}, rolling_reserve: #{@rolling_reserve.inspect},"\
  " trans_fees: #{@trans_fees.inspect}, mdr: #{@mdr.inspect}, is_settlement_pending:"\
  " #{@is_settlement_pending.inspect}, parent_id: #{@parent_id.inspect}, trans_settlement_id:"\
  " #{@trans_settlement_id.inspect}, error_settlement_id: #{@error_settlement_id.inspect},"\
  " merchant_id: #{@merchant_id.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/paysecure_api_documentation_live/models/capture_txn.rb', line 285

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} capture_id: #{@capture_id}, purchase_id: #{@purchase_id}, amount:"\
  " #{@amount}, fx_amount: #{@fx_amount}, status: #{@status}, psp_reference:"\
  " #{@psp_reference}, merchant_reference: #{@merchant_reference}, created_at: #{@created_at},"\
  " updated_at: #{@updated_at}, white_id: #{@white_id}, fx_currency: #{@fx_currency},"\
  " bank_mid: #{@bank_mid}, is_test: #{@is_test}, currency: #{@currency}, amount_in_usd:"\
  " #{@amount_in_usd}, merchant_name: #{@merchant_name}, bank_name: #{@bank_name}, bank_id:"\
  " #{@bank_id}, trx_method: #{@trx_method}, rolling_reserve: #{@rolling_reserve}, trans_fees:"\
  " #{@trans_fees}, mdr: #{@mdr}, is_settlement_pending: #{@is_settlement_pending}, parent_id:"\
  " #{@parent_id}, trans_settlement_id: #{@trans_settlement_id}, error_settlement_id:"\
  " #{@error_settlement_id}, merchant_id: #{@merchant_id}, additional_properties:"\
  " #{@additional_properties}>"
end