Class: UnivapayClientSdk::TokenResponseOnlineData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/token_response_online_data.rb

Overview

Token Response Online Data schema.

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(brand: SKIP, call_method: SKIP, os_type: SKIP, user_identifier: SKIP, user_identifier_source: SKIP, issuer_token: SKIP, issuer_token_payload: SKIP, additional_properties: nil) ⇒ TokenResponseOnlineData

Returns a new instance of TokenResponseOnlineData.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 82

def initialize(brand: SKIP, call_method: SKIP, os_type: SKIP,
               user_identifier: SKIP, user_identifier_source: SKIP,
               issuer_token: SKIP, issuer_token_payload: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @brand = brand unless brand == SKIP
  @call_method = call_method unless call_method == SKIP
  @os_type = os_type unless os_type == SKIP
  @user_identifier = user_identifier unless user_identifier == SKIP
  @user_identifier_source = user_identifier_source unless user_identifier_source == SKIP
  @issuer_token = issuer_token unless issuer_token == SKIP
  @issuer_token_payload = issuer_token_payload unless issuer_token_payload == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#brandBaseOnlineDataBrand

Base Online Data Brand schema. alipay_china, alipay_hk, gcash, dana, truemoney, kakaopay, tng, rabbit_line_pay, bpi, boost, tinaba, naver_pay, toss_pay, maya, grab_sg, kredivo_id, k_plus, and kaspi_kz are Alipay+ regional wallets routed through the alipay_plus_online gateway family.

Returns:



18
19
20
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 18

def brand
  @brand
end

#call_methodBaseOnlineDataCallMethod

Base Online Data Call Method schema.



22
23
24
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 22

def call_method
  @call_method
end

#issuer_tokenString

Token provided by the issuer (if applicable).

Returns:

  • (String)


39
40
41
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 39

def issuer_token
  @issuer_token
end

#issuer_token_payloadString

Additional payload from the issuer.

Returns:

  • (String)


43
44
45
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 43

def issuer_token_payload
  @issuer_token_payload
end

#os_typeBaseOnlineDataOsType

Base Online Data Os Type schema.



26
27
28
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 26

def os_type
  @os_type
end

#user_identifierString

Consumer specific identifier required by some gateways for fraud prevention.

Returns:

  • (String)


31
32
33
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 31

def user_identifier
  @user_identifier
end

#user_identifier_sourceBaseOnlineDataUserIdentifierSource

The source of the user identifier



35
36
37
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 35

def user_identifier_source
  @user_identifier_source
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



100
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
126
127
128
129
130
131
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 100

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  brand = hash.key?('brand') ? hash['brand'] : SKIP
  call_method = hash.key?('call_method') ? hash['call_method'] : SKIP
  os_type = hash.key?('os_type') ? hash['os_type'] : SKIP
  user_identifier =
    hash.key?('user_identifier') ? hash['user_identifier'] : SKIP
  user_identifier_source =
    hash.key?('user_identifier_source') ? hash['user_identifier_source'] : SKIP
  issuer_token = hash.key?('issuer_token') ? hash['issuer_token'] : SKIP
  issuer_token_payload =
    hash.key?('issuer_token_payload') ? hash['issuer_token_payload'] : 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.
  TokenResponseOnlineData.new(brand: brand,
                              call_method: call_method,
                              os_type: os_type,
                              user_identifier: user_identifier,
                              user_identifier_source: user_identifier_source,
                              issuer_token: issuer_token,
                              issuer_token_payload: issuer_token_payload,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['brand'] = 'brand'
  @_hash['call_method'] = 'call_method'
  @_hash['os_type'] = 'os_type'
  @_hash['user_identifier'] = 'user_identifier'
  @_hash['user_identifier_source'] = 'user_identifier_source'
  @_hash['issuer_token'] = 'issuer_token'
  @_hash['issuer_token_payload'] = 'issuer_token_payload'
  @_hash
end

.nullablesObject

An array for nullable fields



72
73
74
75
76
77
78
79
80
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 72

def self.nullables
  %w[
    os_type
    user_identifier
    user_identifier_source
    issuer_token
    issuer_token_payload
  ]
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 59

def self.optionals
  %w[
    brand
    call_method
    os_type
    user_identifier
    user_identifier_source
    issuer_token
    issuer_token_payload
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



135
136
137
138
139
140
141
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 135

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



153
154
155
156
157
158
159
160
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 153

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} brand: #{@brand.inspect}, call_method: #{@call_method.inspect}, os_type:"\
  " #{@os_type.inspect}, user_identifier: #{@user_identifier.inspect}, user_identifier_source:"\
  " #{@user_identifier_source.inspect}, issuer_token: #{@issuer_token.inspect},"\
  " issuer_token_payload: #{@issuer_token_payload.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



144
145
146
147
148
149
150
# File 'lib/univapay_client_sdk/models/token_response_online_data.rb', line 144

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} brand: #{@brand}, call_method: #{@call_method}, os_type: #{@os_type},"\
  " user_identifier: #{@user_identifier}, user_identifier_source: #{@user_identifier_source},"\
  " issuer_token: #{@issuer_token}, issuer_token_payload: #{@issuer_token_payload},"\
  " additional_properties: #{@additional_properties}>"
end