Class: VisaAcceptanceMergedSpec::TokenInformation2

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/token_information2.rb

Overview

TokenInformation2 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(customer: SKIP, payment_instrument: SKIP, shipping_address: SKIP, instrument_identifier: SKIP, jti: SKIP, transient_token_jwt: SKIP, additional_properties: nil) ⇒ TokenInformation2

Returns a new instance of TokenInformation2.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 67

def initialize(customer: SKIP, payment_instrument: SKIP,
               shipping_address: SKIP, instrument_identifier: SKIP,
               jti: SKIP, transient_token_jwt: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @customer = customer unless customer == SKIP
  @payment_instrument = payment_instrument unless payment_instrument == SKIP
  @shipping_address = shipping_address unless shipping_address == SKIP
  @instrument_identifier = instrument_identifier unless instrument_identifier == SKIP
  @jti = jti unless jti == SKIP
  @transient_token_jwt = transient_token_jwt unless transient_token_jwt == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#customerCustomer4

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 14

def customer
  @customer
end

#instrument_identifierInstrumentIdentifier27

TODO: Write general description for this method



26
27
28
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 26

def instrument_identifier
  @instrument_identifier
end

#jtiString

TMS Transient Token, 64 hexadecimal id value representing captured payment credentials (including Sensitive Authentication Data, e.g. CVV).

Returns:

  • (String)


31
32
33
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 31

def jti
  @jti
end

#payment_instrumentPaymentInstrument4

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 18

def payment_instrument
  @payment_instrument
end

#shipping_addressShippingAddress4

TODO: Write general description for this method

Returns:



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

def shipping_address
  @shipping_address
end

#transient_token_jwtString

Flex API Transient Token encoded as JWT (JSON Web Token), e.g. Flex microform or Unified Payment checkout result.

Returns:

  • (String)


36
37
38
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 36

def transient_token_jwt
  @transient_token_jwt
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 84

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  customer = Customer4.from_hash(hash['customer']) if hash['customer']
  payment_instrument = PaymentInstrument4.from_hash(hash['paymentInstrument']) if
    hash['paymentInstrument']
  shipping_address = ShippingAddress4.from_hash(hash['shippingAddress']) if
    hash['shippingAddress']
  instrument_identifier = InstrumentIdentifier27.from_hash(hash['instrumentIdentifier']) if
    hash['instrumentIdentifier']
  jti = hash.key?('jti') ? hash['jti'] : SKIP
  transient_token_jwt =
    hash.key?('transientTokenJwt') ? hash['transientTokenJwt'] : 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.
  TokenInformation2.new(customer: customer,
                        payment_instrument: payment_instrument,
                        shipping_address: shipping_address,
                        instrument_identifier: instrument_identifier,
                        jti: jti,
                        transient_token_jwt: transient_token_jwt,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



39
40
41
42
43
44
45
46
47
48
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 39

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['customer'] = 'customer'
  @_hash['payment_instrument'] = 'paymentInstrument'
  @_hash['shipping_address'] = 'shippingAddress'
  @_hash['instrument_identifier'] = 'instrumentIdentifier'
  @_hash['jti'] = 'jti'
  @_hash['transient_token_jwt'] = 'transientTokenJwt'
  @_hash
end

.nullablesObject

An array for nullable fields



63
64
65
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 63

def self.nullables
  []
end

.optionalsObject

An array for optional fields



51
52
53
54
55
56
57
58
59
60
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 51

def self.optionals
  %w[
    customer
    payment_instrument
    shipping_address
    instrument_identifier
    jti
    transient_token_jwt
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



126
127
128
129
130
131
132
133
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 126

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} customer: #{@customer.inspect}, payment_instrument:"\
  " #{@payment_instrument.inspect}, shipping_address: #{@shipping_address.inspect},"\
  " instrument_identifier: #{@instrument_identifier.inspect}, jti: #{@jti.inspect},"\
  " transient_token_jwt: #{@transient_token_jwt.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



117
118
119
120
121
122
123
# File 'lib/visa_acceptance_merged_spec/models/token_information2.rb', line 117

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} customer: #{@customer}, payment_instrument: #{@payment_instrument},"\
  " shipping_address: #{@shipping_address}, instrument_identifier: #{@instrument_identifier},"\
  " jti: #{@jti}, transient_token_jwt: #{@transient_token_jwt}, additional_properties:"\
  " #{@additional_properties}>"
end