Class: CyberSourceMergedSpec::NetFundingSummary

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/net_funding_summary.rb

Overview

NetFundingSummary 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(type: SKIP, payment_sub_type: SKIP, conveyed_count: SKIP, conveyed_amount: SKIP, settled_count: SKIP, funded_count: SKIP, funded_amount: SKIP, currency_code: SKIP, additional_properties: nil) ⇒ NetFundingSummary

Returns a new instance of NetFundingSummary.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 105

def initialize(type: SKIP, payment_sub_type: SKIP, conveyed_count: SKIP,
               conveyed_amount: SKIP, settled_count: SKIP,
               funded_count: SKIP, funded_amount: SKIP, currency_code: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @type = type unless type == SKIP
  @payment_sub_type = payment_sub_type unless payment_sub_type == SKIP
  @conveyed_count = conveyed_count unless conveyed_count == SKIP
  @conveyed_amount = conveyed_amount unless conveyed_amount == SKIP
  @settled_count = settled_count unless settled_count == SKIP
  @funded_count = funded_count unless funded_count == SKIP
  @funded_amount = funded_amount unless funded_amount == SKIP
  @currency_code = currency_code unless currency_code == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#conveyed_amountString

Valid values:

  • PURCHASES
  • REFUNDS
  • FEES
  • CHARGEBACKS

Returns:

  • (String)


42
43
44
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 42

def conveyed_amount
  @conveyed_amount
end

#conveyed_countInteger

Valid values:

  • PURCHASES
  • REFUNDS
  • FEES
  • CHARGEBACKS

Returns:

  • (Integer)


34
35
36
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 34

def conveyed_count
  @conveyed_count
end

#currency_codeString

Valid ISO 4217 ALPHA-3 currency code

Returns:

  • (String)


70
71
72
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 70

def currency_code
  @currency_code
end

#funded_amountString

Valid values:

  • PURCHASES
  • REFUNDS
  • FEES
  • CHARGEBACKS

Returns:

  • (String)


66
67
68
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 66

def funded_amount
  @funded_amount
end

#funded_countInteger

Valid values:

  • PURCHASES
  • REFUNDS
  • FEES
  • CHARGEBACKS

Returns:

  • (Integer)


58
59
60
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 58

def funded_count
  @funded_count
end

#payment_sub_typeString

Valid values:

  • PURCHASES
  • REFUNDS
  • FEES
  • CHARGEBACKS

Returns:

  • (String)


26
27
28
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 26

def payment_sub_type
  @payment_sub_type
end

#settled_countInteger

Valid values:

  • PURCHASES
  • REFUNDS
  • FEES
  • CHARGEBACKS

Returns:

  • (Integer)


50
51
52
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 50

def settled_count
  @settled_count
end

#typeString

Valid values:

  • PURCHASES
  • REFUNDS
  • FEES
  • CHARGEBACKS

Returns:

  • (String)


18
19
20
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 18

def type
  @type
end

Class Method Details

.from_element(root) ⇒ Object



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 158

def self.from_element(root)
  type = XmlUtilities.from_element(root, 'type', String)
  payment_sub_type = XmlUtilities.from_element(root, 'paymentSubType',
                                               String)
  conveyed_count = XmlUtilities.from_element(root, 'conveyedCount', Integer)
  conveyed_amount = XmlUtilities.from_element(root, 'conveyedAmount',
                                              String)
  settled_count = XmlUtilities.from_element(root, 'settledCount', Integer)
  funded_count = XmlUtilities.from_element(root, 'fundedCount', Integer)
  funded_amount = XmlUtilities.from_element(root, 'fundedAmount', String)
  currency_code = XmlUtilities.from_element(root, 'currencyCode', String)

  new(type: type,
      payment_sub_type: payment_sub_type,
      conveyed_count: conveyed_count,
      conveyed_amount: conveyed_amount,
      settled_count: settled_count,
      funded_count: funded_count,
      funded_amount: funded_amount,
      currency_code: currency_code,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
152
153
154
155
156
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 124

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  type = hash.key?('type') ? hash['type'] : SKIP
  payment_sub_type =
    hash.key?('paymentSubType') ? hash['paymentSubType'] : SKIP
  conveyed_count = hash.key?('conveyedCount') ? hash['conveyedCount'] : SKIP
  conveyed_amount =
    hash.key?('conveyedAmount') ? hash['conveyedAmount'] : SKIP
  settled_count = hash.key?('settledCount') ? hash['settledCount'] : SKIP
  funded_count = hash.key?('fundedCount') ? hash['fundedCount'] : SKIP
  funded_amount = hash.key?('fundedAmount') ? hash['fundedAmount'] : SKIP
  currency_code = hash.key?('currencyCode') ? hash['currencyCode'] : SKIP

  # 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.
  NetFundingSummary.new(type: type,
                        payment_sub_type: payment_sub_type,
                        conveyed_count: conveyed_count,
                        conveyed_amount: conveyed_amount,
                        settled_count: settled_count,
                        funded_count: funded_count,
                        funded_amount: funded_amount,
                        currency_code: currency_code,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 73

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['type'] = 'type'
  @_hash['payment_sub_type'] = 'paymentSubType'
  @_hash['conveyed_count'] = 'conveyedCount'
  @_hash['conveyed_amount'] = 'conveyedAmount'
  @_hash['settled_count'] = 'settledCount'
  @_hash['funded_count'] = 'fundedCount'
  @_hash['funded_amount'] = 'fundedAmount'
  @_hash['currency_code'] = 'currencyCode'
  @_hash
end

.nullablesObject

An array for nullable fields



101
102
103
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 101

def self.nullables
  []
end

.optionalsObject

An array for optional fields



87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 87

def self.optionals
  %w[
    type
    payment_sub_type
    conveyed_count
    conveyed_amount
    settled_count
    funded_count
    funded_amount
    currency_code
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



210
211
212
213
214
215
216
217
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 210

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} type: #{@type.inspect}, payment_sub_type: #{@payment_sub_type.inspect},"\
  " conveyed_count: #{@conveyed_count.inspect}, conveyed_amount: #{@conveyed_amount.inspect},"\
  " settled_count: #{@settled_count.inspect}, funded_count: #{@funded_count.inspect},"\
  " funded_amount: #{@funded_amount.inspect}, currency_code: #{@currency_code.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



201
202
203
204
205
206
207
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 201

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} type: #{@type}, payment_sub_type: #{@payment_sub_type}, conveyed_count:"\
  " #{@conveyed_count}, conveyed_amount: #{@conveyed_amount}, settled_count:"\
  " #{@settled_count}, funded_count: #{@funded_count}, funded_amount: #{@funded_amount},"\
  " currency_code: #{@currency_code}, additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/cyber_source_merged_spec/models/net_funding_summary.rb', line 181

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'paymentSubType',
                                 payment_sub_type)
  XmlUtilities.add_as_subelement(doc, root, 'conveyedCount', conveyed_count)
  XmlUtilities.add_as_subelement(doc, root, 'conveyedAmount',
                                 conveyed_amount)
  XmlUtilities.add_as_subelement(doc, root, 'settledCount', settled_count)
  XmlUtilities.add_as_subelement(doc, root, 'fundedCount', funded_count)
  XmlUtilities.add_as_subelement(doc, root, 'fundedAmount', funded_amount)
  XmlUtilities.add_as_subelement(doc, root, 'currencyCode', currency_code)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end