Class: PaysecureApiDocumentationLive::RefundSuccess1

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

Overview

RefundSuccess1 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(purchase_id:, client:, updated_on:, type:, force_recurring:, created_on:, purchase:, payment:, issuer_details:, transaction_data:, status:, status_history:, viewed_on:, is_test:, brand_id:, send_receipt:, is_recurring_token:, skip_capture:, reference_generated:, issued:, due:, refund_upto:, cc_descriptor:, refund_availability:, refundable_amount:, success_redirect:, failure_redirect:, cancel_redirect:, success_callback:, platform:, created_from_ip:, checkout_url:, direct_post_url:, additional_properties: nil) ⇒ RefundSuccess1

Returns a new instance of RefundSuccess1.



193
194
195
196
197
198
199
200
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
238
239
240
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 193

def initialize(purchase_id:, client:, updated_on:, type:, force_recurring:,
               created_on:, purchase:, payment:, issuer_details:,
               transaction_data:, status:, status_history:, viewed_on:,
               is_test:, brand_id:, send_receipt:, is_recurring_token:,
               skip_capture:, reference_generated:, issued:, due:,
               refund_upto:, cc_descriptor:, refund_availability:,
               refundable_amount:, success_redirect:, failure_redirect:,
               cancel_redirect:, success_callback:, platform:,
               created_from_ip:, checkout_url:, direct_post_url:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @purchase_id = purchase_id
  @client = client
  @updated_on = updated_on
  @type = type
  @force_recurring = force_recurring
  @created_on = created_on
  @purchase = purchase
  @payment = payment
  @issuer_details = issuer_details
  @transaction_data = transaction_data
  @status = status
  @status_history = status_history
  @viewed_on = viewed_on
  @is_test = is_test
  @brand_id = brand_id
  @send_receipt = send_receipt
  @is_recurring_token = is_recurring_token
  @skip_capture = skip_capture
  @reference_generated = reference_generated
  @issued = issued
  @due = due
  @refund_upto = refund_upto
  @cc_descriptor = cc_descriptor
  @refund_availability = refund_availability
  @refundable_amount = refundable_amount
  @success_redirect = success_redirect
  @failure_redirect = failure_redirect
  @cancel_redirect = cancel_redirect
  @success_callback = success_callback
  @platform = platform
  @created_from_ip = created_from_ip
  @checkout_url = checkout_url
  @direct_post_url = direct_post_url
  @additional_properties = additional_properties
end

Instance Attribute Details

#brand_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def brand_id
  @brand_id
end

#cancel_redirectString

TODO: Write general description for this method

Returns:

  • (String)


122
123
124
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 122

def cancel_redirect
  @cancel_redirect
end

#cc_descriptorString

TODO: Write general description for this method

Returns:

  • (String)


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

def cc_descriptor
  @cc_descriptor
end

#checkout_urlString

TODO: Write general description for this method

Returns:

  • (String)


138
139
140
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 138

def checkout_url
  @checkout_url
end

#clientClient2

TODO: Write general description for this method

Returns:



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

def client
  @client
end

#created_from_ipString

TODO: Write general description for this method

Returns:

  • (String)


134
135
136
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 134

def created_from_ip
  @created_from_ip
end

#created_onInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def created_on
  @created_on
end

#direct_post_urlString

TODO: Write general description for this method

Returns:

  • (String)


142
143
144
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 142

def direct_post_url
  @direct_post_url
end

#dueInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def due
  @due
end

#failure_redirectString

TODO: Write general description for this method

Returns:

  • (String)


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

def failure_redirect
  @failure_redirect
end

#force_recurringTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def force_recurring
  @force_recurring
end

#is_recurring_tokenTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def is_recurring_token
  @is_recurring_token
end

#is_testTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def is_test
  @is_test
end

#issuedString

TODO: Write general description for this method

Returns:

  • (String)


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

def issued
  @issued
end

#issuer_detailsIssuerDetails1

TODO: Write general description for this method

Returns:



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

def issuer_details
  @issuer_details
end

#paymentPayment

TODO: Write general description for this method

Returns:



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

def payment
  @payment
end

#platformString

TODO: Write general description for this method

Returns:

  • (String)


130
131
132
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 130

def platform
  @platform
end

#purchasePurchase2

TODO: Write general description for this method

Returns:



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

def purchase
  @purchase
end

#purchase_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def purchase_id
  @purchase_id
end

#reference_generatedString

TODO: Write general description for this method

Returns:

  • (String)


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

def reference_generated
  @reference_generated
end

#refund_availabilityString

TODO: Write general description for this method

Returns:

  • (String)


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

def refund_availability
  @refund_availability
end

#refund_uptoInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def refund_upto
  @refund_upto
end

#refundable_amountInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def refundable_amount
  @refundable_amount
end

#send_receiptTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def send_receipt
  @send_receipt
end

#skip_captureTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def skip_capture
  @skip_capture
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


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

def status
  @status
end

#status_historyArray[StatusHistory]

TODO: Write general description for this method

Returns:



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

def status_history
  @status_history
end

#success_callbackString

TODO: Write general description for this method

Returns:

  • (String)


126
127
128
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 126

def success_callback
  @success_callback
end

#success_redirectString

TODO: Write general description for this method

Returns:

  • (String)


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

def success_redirect
  @success_redirect
end

#transaction_dataTransactionData3

TODO: Write general description for this method

Returns:



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

def transaction_data
  @transaction_data
end

#typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def type
  @type
end

#updated_onInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def updated_on
  @updated_on
end

#viewed_onInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def viewed_on
  @viewed_on
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 243

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  purchase_id = hash.key?('purchaseId') ? hash['purchaseId'] : nil
  client = Client2.from_hash(hash['client']) if hash['client']
  updated_on = hash.key?('updated_on') ? hash['updated_on'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  force_recurring =
    hash.key?('force_recurring') ? hash['force_recurring'] : nil
  created_on = hash.key?('created_on') ? hash['created_on'] : nil
  purchase = Purchase2.from_hash(hash['purchase']) if hash['purchase']
  payment = Payment.from_hash(hash['payment']) if hash['payment']
  issuer_details = IssuerDetails1.from_hash(hash['issuer_details']) if hash['issuer_details']
  transaction_data = TransactionData3.from_hash(hash['transaction_data']) if
    hash['transaction_data']
  status = hash.key?('status') ? hash['status'] : nil
  # Parameter is an array, so we need to iterate through it
  status_history = nil
  unless hash['status_history'].nil?
    status_history = []
    hash['status_history'].each do |structure|
      status_history << (StatusHistory.from_hash(structure) if structure)
    end
  end

  status_history = nil unless hash.key?('status_history')
  viewed_on = hash.key?('viewedOn') ? hash['viewedOn'] : nil
  is_test = hash.key?('is_test') ? hash['is_test'] : nil
  brand_id = hash.key?('brand_id') ? hash['brand_id'] : nil
  send_receipt = hash.key?('send_receipt') ? hash['send_receipt'] : nil
  is_recurring_token =
    hash.key?('is_recurring_token') ? hash['is_recurring_token'] : nil
  skip_capture = hash.key?('skip_capture') ? hash['skip_capture'] : nil
  reference_generated =
    hash.key?('reference_generated') ? hash['reference_generated'] : nil
  issued = hash.key?('issued') ? hash['issued'] : nil
  due = hash.key?('due') ? hash['due'] : nil
  refund_upto = hash.key?('refund_upto') ? hash['refund_upto'] : nil
  cc_descriptor = hash.key?('cc_descriptor') ? hash['cc_descriptor'] : nil
  refund_availability =
    hash.key?('refund_availability') ? hash['refund_availability'] : nil
  refundable_amount =
    hash.key?('refundable_amount') ? hash['refundable_amount'] : nil
  success_redirect =
    hash.key?('success_redirect') ? hash['success_redirect'] : nil
  failure_redirect =
    hash.key?('failure_redirect') ? hash['failure_redirect'] : nil
  cancel_redirect =
    hash.key?('cancel_redirect') ? hash['cancel_redirect'] : nil
  success_callback =
    hash.key?('success_callback') ? hash['success_callback'] : nil
  platform = hash.key?('platform') ? hash['platform'] : nil
  created_from_ip =
    hash.key?('created_from_ip') ? hash['created_from_ip'] : nil
  checkout_url = hash.key?('checkout_url') ? hash['checkout_url'] : nil
  direct_post_url =
    hash.key?('direct_post_url') ? hash['direct_post_url'] : 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.
  RefundSuccess1.new(purchase_id: purchase_id,
                     client: client,
                     updated_on: updated_on,
                     type: type,
                     force_recurring: force_recurring,
                     created_on: created_on,
                     purchase: purchase,
                     payment: payment,
                     issuer_details: issuer_details,
                     transaction_data: transaction_data,
                     status: status,
                     status_history: status_history,
                     viewed_on: viewed_on,
                     is_test: is_test,
                     brand_id: brand_id,
                     send_receipt: send_receipt,
                     is_recurring_token: is_recurring_token,
                     skip_capture: skip_capture,
                     reference_generated: reference_generated,
                     issued: issued,
                     due: due,
                     refund_upto: refund_upto,
                     cc_descriptor: cc_descriptor,
                     refund_availability: refund_availability,
                     refundable_amount: refundable_amount,
                     success_redirect: success_redirect,
                     failure_redirect: failure_redirect,
                     cancel_redirect: cancel_redirect,
                     success_callback: success_callback,
                     platform: platform,
                     created_from_ip: created_from_ip,
                     checkout_url: checkout_url,
                     direct_post_url: direct_post_url,
                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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
172
173
174
175
176
177
178
179
180
181
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 145

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['purchase_id'] = 'purchaseId'
  @_hash['client'] = 'client'
  @_hash['updated_on'] = 'updated_on'
  @_hash['type'] = 'type'
  @_hash['force_recurring'] = 'force_recurring'
  @_hash['created_on'] = 'created_on'
  @_hash['purchase'] = 'purchase'
  @_hash['payment'] = 'payment'
  @_hash['issuer_details'] = 'issuer_details'
  @_hash['transaction_data'] = 'transaction_data'
  @_hash['status'] = 'status'
  @_hash['status_history'] = 'status_history'
  @_hash['viewed_on'] = 'viewedOn'
  @_hash['is_test'] = 'is_test'
  @_hash['brand_id'] = 'brand_id'
  @_hash['send_receipt'] = 'send_receipt'
  @_hash['is_recurring_token'] = 'is_recurring_token'
  @_hash['skip_capture'] = 'skip_capture'
  @_hash['reference_generated'] = 'reference_generated'
  @_hash['issued'] = 'issued'
  @_hash['due'] = 'due'
  @_hash['refund_upto'] = 'refund_upto'
  @_hash['cc_descriptor'] = 'cc_descriptor'
  @_hash['refund_availability'] = 'refund_availability'
  @_hash['refundable_amount'] = 'refundable_amount'
  @_hash['success_redirect'] = 'success_redirect'
  @_hash['failure_redirect'] = 'failure_redirect'
  @_hash['cancel_redirect'] = 'cancel_redirect'
  @_hash['success_callback'] = 'success_callback'
  @_hash['platform'] = 'platform'
  @_hash['created_from_ip'] = 'created_from_ip'
  @_hash['checkout_url'] = 'checkout_url'
  @_hash['direct_post_url'] = 'direct_post_url'
  @_hash
end

.nullablesObject

An array for nullable fields



189
190
191
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 189

def self.nullables
  []
end

.optionalsObject

An array for optional fields



184
185
186
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 184

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 366

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} purchase_id: #{@purchase_id.inspect}, client: #{@client.inspect},"\
  " updated_on: #{@updated_on.inspect}, type: #{@type.inspect}, force_recurring:"\
  " #{@force_recurring.inspect}, created_on: #{@created_on.inspect}, purchase:"\
  " #{@purchase.inspect}, payment: #{@payment.inspect}, issuer_details:"\
  " #{@issuer_details.inspect}, transaction_data: #{@transaction_data.inspect}, status:"\
  " #{@status.inspect}, status_history: #{@status_history.inspect}, viewed_on:"\
  " #{@viewed_on.inspect}, is_test: #{@is_test.inspect}, brand_id: #{@brand_id.inspect},"\
  " send_receipt: #{@send_receipt.inspect}, is_recurring_token:"\
  " #{@is_recurring_token.inspect}, skip_capture: #{@skip_capture.inspect},"\
  " reference_generated: #{@reference_generated.inspect}, issued: #{@issued.inspect}, due:"\
  " #{@due.inspect}, refund_upto: #{@refund_upto.inspect}, cc_descriptor:"\
  " #{@cc_descriptor.inspect}, refund_availability: #{@refund_availability.inspect},"\
  " refundable_amount: #{@refundable_amount.inspect}, success_redirect:"\
  " #{@success_redirect.inspect}, failure_redirect: #{@failure_redirect.inspect},"\
  " cancel_redirect: #{@cancel_redirect.inspect}, success_callback:"\
  " #{@success_callback.inspect}, platform: #{@platform.inspect}, created_from_ip:"\
  " #{@created_from_ip.inspect}, checkout_url: #{@checkout_url.inspect}, direct_post_url:"\
  " #{@direct_post_url.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/paysecure_api_documentation_live/models/refund_success1.rb', line 347

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} purchase_id: #{@purchase_id}, client: #{@client}, updated_on:"\
  " #{@updated_on}, type: #{@type}, force_recurring: #{@force_recurring}, created_on:"\
  " #{@created_on}, purchase: #{@purchase}, payment: #{@payment}, issuer_details:"\
  " #{@issuer_details}, transaction_data: #{@transaction_data}, status: #{@status},"\
  " status_history: #{@status_history}, viewed_on: #{@viewed_on}, is_test: #{@is_test},"\
  " brand_id: #{@brand_id}, send_receipt: #{@send_receipt}, is_recurring_token:"\
  " #{@is_recurring_token}, skip_capture: #{@skip_capture}, reference_generated:"\
  " #{@reference_generated}, issued: #{@issued}, due: #{@due}, refund_upto: #{@refund_upto},"\
  " cc_descriptor: #{@cc_descriptor}, refund_availability: #{@refund_availability},"\
  " refundable_amount: #{@refundable_amount}, success_redirect: #{@success_redirect},"\
  " failure_redirect: #{@failure_redirect}, cancel_redirect: #{@cancel_redirect},"\
  " success_callback: #{@success_callback}, platform: #{@platform}, created_from_ip:"\
  " #{@created_from_ip}, checkout_url: #{@checkout_url}, direct_post_url: #{@direct_post_url},"\
  " additional_properties: #{@additional_properties}>"
end