Class: PaysecureApiDocumentationLive::Payment4

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

Overview

Payment4 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(is_outgoing:, payment_type:, amount:, currency:, net_amount:, fee_amount:, pending_amount:, pending_unfreeze_on:, description:, paid_on:, remote_paid_on:, additional_properties: nil) ⇒ Payment4

Returns a new instance of Payment4.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/paysecure_api_documentation_live/models/payment4.rb', line 85

def initialize(is_outgoing:, payment_type:, amount:, currency:, net_amount:,
               fee_amount:, pending_amount:, pending_unfreeze_on:,
               description:, paid_on:, remote_paid_on:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @is_outgoing = is_outgoing
  @payment_type = payment_type
  @amount = amount
  @currency = currency
  @net_amount = net_amount
  @fee_amount = fee_amount
  @pending_amount = pending_amount
  @pending_unfreeze_on = pending_unfreeze_on
  @description = description
  @paid_on = paid_on
  @remote_paid_on = remote_paid_on
  @additional_properties = additional_properties
end

Instance Attribute Details

#amountInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def amount
  @amount
end

#currencyString

TODO: Write general description for this method

Returns:

  • (String)


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

def currency
  @currency
end

#descriptionString

TODO: Write general description for this method

Returns:

  • (String)


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

def description
  @description
end

#fee_amountInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def fee_amount
  @fee_amount
end

#is_outgoingTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def is_outgoing
  @is_outgoing
end

#net_amountInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def net_amount
  @net_amount
end

TODO: Write general description for this method

Returns:

  • (Integer)


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

def paid_on
  @paid_on
end

#payment_typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def payment_type
  @payment_type
end

#pending_amountInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def pending_amount
  @pending_amount
end

#pending_unfreeze_onString

TODO: Write general description for this method

Returns:

  • (String)


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

def pending_unfreeze_on
  @pending_unfreeze_on
end

#remote_paid_onInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def remote_paid_on
  @remote_paid_on
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
# File 'lib/paysecure_api_documentation_live/models/payment4.rb', line 107

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  is_outgoing = hash.key?('is_outgoing') ? hash['is_outgoing'] : nil
  payment_type = hash.key?('payment_type') ? hash['payment_type'] : nil
  amount = hash.key?('amount') ? hash['amount'] : nil
  currency = hash.key?('currency') ? hash['currency'] : nil
  net_amount = hash.key?('net_amount') ? hash['net_amount'] : nil
  fee_amount = hash.key?('fee_amount') ? hash['fee_amount'] : nil
  pending_amount =
    hash.key?('pending_amount') ? hash['pending_amount'] : nil
  pending_unfreeze_on =
    hash.key?('pending_unfreeze_on') ? hash['pending_unfreeze_on'] : nil
  description = hash.key?('description') ? hash['description'] : nil
  paid_on = hash.key?('paid_on') ? hash['paid_on'] : nil
  remote_paid_on =
    hash.key?('remote_paid_on') ? hash['remote_paid_on'] : 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.
  Payment4.new(is_outgoing: is_outgoing,
               payment_type: payment_type,
               amount: amount,
               currency: currency,
               net_amount: net_amount,
               fee_amount: fee_amount,
               pending_amount: pending_amount,
               pending_unfreeze_on: pending_unfreeze_on,
               description: description,
               paid_on: paid_on,
               remote_paid_on: remote_paid_on,
               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/paysecure_api_documentation_live/models/payment4.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['is_outgoing'] = 'is_outgoing'
  @_hash['payment_type'] = 'payment_type'
  @_hash['amount'] = 'amount'
  @_hash['currency'] = 'currency'
  @_hash['net_amount'] = 'net_amount'
  @_hash['fee_amount'] = 'fee_amount'
  @_hash['pending_amount'] = 'pending_amount'
  @_hash['pending_unfreeze_on'] = 'pending_unfreeze_on'
  @_hash['description'] = 'description'
  @_hash['paid_on'] = 'paid_on'
  @_hash['remote_paid_on'] = 'remote_paid_on'
  @_hash
end

.nullablesObject

An array for nullable fields



79
80
81
82
83
# File 'lib/paysecure_api_documentation_live/models/payment4.rb', line 79

def self.nullables
  %w[
    pending_unfreeze_on
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} is_outgoing: #{@is_outgoing.inspect}, payment_type:"\
  " #{@payment_type.inspect}, amount: #{@amount.inspect}, currency: #{@currency.inspect},"\
  " net_amount: #{@net_amount.inspect}, fee_amount: #{@fee_amount.inspect}, pending_amount:"\
  " #{@pending_amount.inspect}, pending_unfreeze_on: #{@pending_unfreeze_on.inspect},"\
  " description: #{@description.inspect}, paid_on: #{@paid_on.inspect}, remote_paid_on:"\
  " #{@remote_paid_on.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



149
150
151
152
153
154
155
156
# File 'lib/paysecure_api_documentation_live/models/payment4.rb', line 149

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} is_outgoing: #{@is_outgoing}, payment_type: #{@payment_type}, amount:"\
  " #{@amount}, currency: #{@currency}, net_amount: #{@net_amount}, fee_amount:"\
  " #{@fee_amount}, pending_amount: #{@pending_amount}, pending_unfreeze_on:"\
  " #{@pending_unfreeze_on}, description: #{@description}, paid_on: #{@paid_on},"\
  " remote_paid_on: #{@remote_paid_on}, additional_properties: #{@additional_properties}>"
end