Class: VisaAcceptanceMergedSpec::PaymentInformation5

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_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, additional_properties: nil) ⇒ PaymentInformation5

Returns a new instance of PaymentInformation5.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/visa_acceptance_merged_spec/models/payment_information5.rb', line 101

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, 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
  @additional_properties = additional_properties
end

Instance Attribute Details

#bankBank2

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_merged_spec/models/payment_information5.rb', line 26

def fluid_data
  @fluid_data
end

#instrument_identifierInstrumentIdentifier

TODO: Write general description for this method



38
39
40
# File 'lib/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_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/visa_acceptance_merged_spec/models/payment_information5.rb', line 42

def shipping_address
  @shipping_address
end

#tokenized_cardTokenizedCard

TODO: Write general description for this method

Returns:



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

def tokenized_card
  @tokenized_card
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/visa_acceptance_merged_spec/models/payment_information5.rb', line 128

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

  # 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: ,
                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/visa_acceptance_merged_spec/models/payment_information5.rb', line 61

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
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/visa_acceptance_merged_spec/models/payment_information5.rb', line 79

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
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



185
186
187
188
189
190
191
192
193
194
# File 'lib/visa_acceptance_merged_spec/models/payment_information5.rb', line 185

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}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



174
175
176
177
178
179
180
181
182
# File 'lib/visa_acceptance_merged_spec/models/payment_information5.rb', line 174

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}, additional_properties: #{@additional_properties}>"
end