Class: CyberSourceMergedSpec::PaymentInformation5

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

Overview

PaymentInformation5 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(card: SKIP, bank: SKIP, tokenized_card: SKIP, fluid_data: SKIP, customer: SKIP, payment_instrument: SKIP, instrument_identifier: SKIP, shipping_address: SKIP, legacy_token: SKIP, payment_type: SKIP, e_wallet: SKIP, payment_account_reference: SKIP, third_party_token: SKIP, initiation_channel: SKIP, additional_properties: nil) ⇒ PaymentInformation5

Returns a new instance of PaymentInformation5.



144
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/cyber_source_merged_spec/models/payment_information5.rb', line 144

def initialize(card: SKIP, bank: SKIP, tokenized_card: SKIP,
               fluid_data: SKIP, customer: SKIP, payment_instrument: SKIP,
               instrument_identifier: SKIP, shipping_address: SKIP,
               legacy_token: SKIP, payment_type: SKIP, e_wallet: SKIP,
               payment_account_reference: SKIP, third_party_token: SKIP,
               initiation_channel: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @card = card unless card == SKIP
  @bank = bank unless bank == SKIP
  @tokenized_card = tokenized_card unless tokenized_card == SKIP
  @fluid_data = fluid_data unless fluid_data == SKIP
  @customer = customer unless customer == SKIP
  @payment_instrument = payment_instrument unless payment_instrument == SKIP
  @instrument_identifier = instrument_identifier unless instrument_identifier == SKIP
  @shipping_address = shipping_address unless shipping_address == SKIP
  @legacy_token = legacy_token unless legacy_token == SKIP
  @payment_type = payment_type unless payment_type == SKIP
  @e_wallet = e_wallet unless e_wallet == SKIP
  unless  == SKIP
    @payment_account_reference =
      
  end
  @third_party_token = third_party_token unless third_party_token == SKIP
  @initiation_channel = initiation_channel unless initiation_channel == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#bankBank2

TODO: Write general description for this method

Returns:



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

def bank
  @bank
end

#cardCard4

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 14

def card
  @card
end

#customerCustomer

TODO: Write general description for this method

Returns:



30
31
32
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 30

def customer
  @customer
end

#e_walletEWallet2

TODO: Write general description for this method

Returns:



54
55
56
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 54

def e_wallet
  @e_wallet
end

#fluid_dataFluidData

TODO: Write general description for this method

Returns:



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

def fluid_data
  @fluid_data
end

#initiation_channelString

Mastercard-defined code that indicates how the account information was obtained for credit authorization transactions. Possible values:

  • 00: Card (default)
  • 01: Mobile network operator (MNO) controlled removable secure element (SIM or UICC) personalized for use with a mobile phone or smartphone
  • 02: Key fob
  • 03: Watch
  • 04: Mobile tag
  • 05: Wristband
  • 06: Mobile phone case or sleeve
  • 07: Mobile phone or smartphone with fixed (nonremovable) secure element controlled by the MNO (for example, code division multiple access (CDMA))
  • 08: Removable secure element not controlled by the MNO (for example, memory card personalized for use with a mobile phone or smartphone)
  • 09: Mobile phone or smartphone with a fixed (nonremovable) secure element not controlled by the MNO
  • 10: MNO-controlled removable secure element (SIM or UICC) personalized for use with a tablet or e-book
  • 11: Tablet or e-book with a fixed (nonremovable) secure element controlled by the MNO
  • 12: Removable secure element not controlled by the MNO (for example, memory card personalized for use with a tablet or e-book)
  • 13: Tablet or e-book with fixed (nonremovable) secure element not controlled by the MNO
  • 14 - 99: Reserved for future use This field flows in ISO Field 104 DSID 65 Tag 04. This field is supported for Mastercard credit authorization transactions.

Used by

Credit Authorization (Standalone) Optional field.

Returns:

  • (String)


97
98
99
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 97

def initiation_channel
  @initiation_channel
end

#instrument_identifierInstrumentIdentifier

TODO: Write general description for this method



38
39
40
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 38

def instrument_identifier
  @instrument_identifier
end

#legacy_tokenLegacyToken

TODO: Write general description for this method

Returns:



46
47
48
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 46

def legacy_token
  @legacy_token
end

#payment_account_referencePaymentAccountReference

TODO: Write general description for this method



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

def 
  @payment_account_reference
end

#payment_instrumentPaymentInstrument

TODO: Write general description for this method

Returns:



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

def payment_instrument
  @payment_instrument
end

#payment_typePaymentType3

TODO: Write general description for this method

Returns:



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

def payment_type
  @payment_type
end

#shipping_addressShippingAddress

TODO: Write general description for this method

Returns:



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

def shipping_address
  @shipping_address
end

#third_party_tokenThirdPartyToken

TODO: Write general description for this method

Returns:



62
63
64
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 62

def third_party_token
  @third_party_token
end

#tokenized_cardTokenizedCard

TODO: Write general description for this method

Returns:



22
23
24
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 22

def tokenized_card
  @tokenized_card
end

Class Method Details

.from_element(root) ⇒ Object



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
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 225

def self.from_element(root)
  card = XmlUtilities.from_element(root, 'Card4', Card4)
  bank = XmlUtilities.from_element(root, 'Bank2', Bank2)
  tokenized_card = XmlUtilities.from_element(root, 'TokenizedCard',
                                             TokenizedCard)
  fluid_data = XmlUtilities.from_element(root, 'FluidData', FluidData)
  customer = XmlUtilities.from_element(root, 'Customer', Customer)
  payment_instrument = XmlUtilities.from_element(root, 'PaymentInstrument',
                                                 PaymentInstrument)
  instrument_identifier = XmlUtilities.from_element(root,
                                                    'InstrumentIdentifier',
                                                    InstrumentIdentifier)
  shipping_address = XmlUtilities.from_element(root, 'ShippingAddress',
                                               ShippingAddress)
  legacy_token = XmlUtilities.from_element(root, 'LegacyToken', LegacyToken)
  payment_type = XmlUtilities.from_element(root, 'PaymentType3',
                                           PaymentType3)
  e_wallet = XmlUtilities.from_element(root, 'EWallet2', EWallet2)
   = XmlUtilities.from_element(
    root, 'PaymentAccountReference', PaymentAccountReference
  )
  third_party_token = XmlUtilities.from_element(root, 'ThirdPartyToken',
                                                ThirdPartyToken)
  initiation_channel = XmlUtilities.from_element(root, 'initiationChannel',
                                                 String)

  new(card: card,
      bank: bank,
      tokenized_card: tokenized_card,
      fluid_data: fluid_data,
      customer: customer,
      payment_instrument: payment_instrument,
      instrument_identifier: instrument_identifier,
      shipping_address: shipping_address,
      legacy_token: legacy_token,
      payment_type: payment_type,
      e_wallet: e_wallet,
      payment_account_reference: ,
      third_party_token: third_party_token,
      initiation_channel: initiation_channel,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 174

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  card = Card4.from_hash(hash['card']) if hash['card']
  bank = Bank2.from_hash(hash['bank']) if hash['bank']
  tokenized_card = TokenizedCard.from_hash(hash['tokenizedCard']) if hash['tokenizedCard']
  fluid_data = FluidData.from_hash(hash['fluidData']) if hash['fluidData']
  customer = Customer.from_hash(hash['customer']) if hash['customer']
  payment_instrument = PaymentInstrument.from_hash(hash['paymentInstrument']) if
    hash['paymentInstrument']
  instrument_identifier = InstrumentIdentifier.from_hash(hash['instrumentIdentifier']) if
    hash['instrumentIdentifier']
  shipping_address = ShippingAddress.from_hash(hash['shippingAddress']) if
    hash['shippingAddress']
  legacy_token = LegacyToken.from_hash(hash['legacyToken']) if hash['legacyToken']
  payment_type = PaymentType3.from_hash(hash['paymentType']) if hash['paymentType']
  e_wallet = EWallet2.from_hash(hash['eWallet']) if hash['eWallet']
  if hash['paymentAccountReference']
     = PaymentAccountReference.from_hash(hash['paymentAccountReference'])
  end
  third_party_token = ThirdPartyToken.from_hash(hash['thirdPartyToken']) if
    hash['thirdPartyToken']
  initiation_channel =
    hash.key?('initiationChannel') ? hash['initiationChannel'] : 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.
  PaymentInformation5.new(card: card,
                          bank: bank,
                          tokenized_card: tokenized_card,
                          fluid_data: fluid_data,
                          customer: customer,
                          payment_instrument: payment_instrument,
                          instrument_identifier: instrument_identifier,
                          shipping_address: shipping_address,
                          legacy_token: legacy_token,
                          payment_type: payment_type,
                          e_wallet: e_wallet,
                          payment_account_reference: ,
                          third_party_token: third_party_token,
                          initiation_channel: initiation_channel,
                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 100

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['card'] = 'card'
  @_hash['bank'] = 'bank'
  @_hash['tokenized_card'] = 'tokenizedCard'
  @_hash['fluid_data'] = 'fluidData'
  @_hash['customer'] = 'customer'
  @_hash['payment_instrument'] = 'paymentInstrument'
  @_hash['instrument_identifier'] = 'instrumentIdentifier'
  @_hash['shipping_address'] = 'shippingAddress'
  @_hash['legacy_token'] = 'legacyToken'
  @_hash['payment_type'] = 'paymentType'
  @_hash['e_wallet'] = 'eWallet'
  @_hash['payment_account_reference'] = 'paymentAccountReference'
  @_hash['third_party_token'] = 'thirdPartyToken'
  @_hash['initiation_channel'] = 'initiationChannel'
  @_hash
end

.nullablesObject

An array for nullable fields



140
141
142
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 140

def self.nullables
  []
end

.optionalsObject

An array for optional fields



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 120

def self.optionals
  %w[
    card
    bank
    tokenized_card
    fluid_data
    customer
    payment_instrument
    instrument_identifier
    shipping_address
    legacy_token
    payment_type
    e_wallet
    payment_account_reference
    third_party_token
    initiation_channel
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 311

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} card: #{@card.inspect}, bank: #{@bank.inspect}, tokenized_card:"\
  " #{@tokenized_card.inspect}, fluid_data: #{@fluid_data.inspect}, customer:"\
  " #{@customer.inspect}, payment_instrument: #{@payment_instrument.inspect},"\
  " instrument_identifier: #{@instrument_identifier.inspect}, shipping_address:"\
  " #{@shipping_address.inspect}, legacy_token: #{@legacy_token.inspect}, payment_type:"\
  " #{@payment_type.inspect}, e_wallet: #{@e_wallet.inspect}, payment_account_reference:"\
  " #{@payment_account_reference.inspect}, third_party_token: #{@third_party_token.inspect},"\
  " initiation_channel: #{@initiation_channel.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



298
299
300
301
302
303
304
305
306
307
308
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 298

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} card: #{@card}, bank: #{@bank}, tokenized_card: #{@tokenized_card},"\
  " fluid_data: #{@fluid_data}, customer: #{@customer}, payment_instrument:"\
  " #{@payment_instrument}, instrument_identifier: #{@instrument_identifier},"\
  " shipping_address: #{@shipping_address}, legacy_token: #{@legacy_token}, payment_type:"\
  " #{@payment_type}, e_wallet: #{@e_wallet}, payment_account_reference:"\
  " #{@payment_account_reference}, third_party_token: #{@third_party_token},"\
  " initiation_channel: #{@initiation_channel}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



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
# File 'lib/cyber_source_merged_spec/models/payment_information5.rb', line 268

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

  XmlUtilities.add_as_subelement(doc, root, 'Card4', card)
  XmlUtilities.add_as_subelement(doc, root, 'Bank2', bank)
  XmlUtilities.add_as_subelement(doc, root, 'TokenizedCard', tokenized_card)
  XmlUtilities.add_as_subelement(doc, root, 'FluidData', fluid_data)
  XmlUtilities.add_as_subelement(doc, root, 'Customer', customer)
  XmlUtilities.add_as_subelement(doc, root, 'PaymentInstrument',
                                 payment_instrument)
  XmlUtilities.add_as_subelement(doc, root, 'InstrumentIdentifier',
                                 instrument_identifier)
  XmlUtilities.add_as_subelement(doc, root, 'ShippingAddress',
                                 shipping_address)
  XmlUtilities.add_as_subelement(doc, root, 'LegacyToken', legacy_token)
  XmlUtilities.add_as_subelement(doc, root, 'PaymentType3', payment_type)
  XmlUtilities.add_as_subelement(doc, root, 'EWallet2', e_wallet)
  XmlUtilities.add_as_subelement(doc, root, 'PaymentAccountReference',
                                 )
  XmlUtilities.add_as_subelement(doc, root, 'ThirdPartyToken',
                                 third_party_token)
  XmlUtilities.add_as_subelement(doc, root, 'initiationChannel',
                                 initiation_channel)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end