Class: VisaAcceptanceMergedSpec::TokenizedcardRequest

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

Overview

TokenizedcardRequest 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(links: SKIP, id: SKIP, object: SKIP, account_reference_id: SKIP, consumer_id: SKIP, create_instrument_identifier: SKIP, source: SKIP, state: SKIP, reason: SKIP, number: SKIP, expiration_month: SKIP, expiration_year: SKIP, type: SKIP, cryptogram: SKIP, security_code: SKIP, eci: SKIP, requestor_id: SKIP, enrollment_id: SKIP, token_reference_id: SKIP, payment_account_reference: SKIP, card: SKIP, passcode: SKIP, metadata: SKIP, additional_properties: nil) ⇒ TokenizedcardRequest

Returns a new instance of TokenizedcardRequest.



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

def initialize(links: SKIP, id: SKIP, object: SKIP,
               account_reference_id: SKIP, consumer_id: SKIP,
               create_instrument_identifier: SKIP, source: SKIP,
               state: SKIP, reason: SKIP, number: SKIP,
               expiration_month: SKIP, expiration_year: SKIP, type: SKIP,
               cryptogram: SKIP, security_code: SKIP, eci: SKIP,
               requestor_id: SKIP, enrollment_id: SKIP,
               token_reference_id: SKIP, payment_account_reference: SKIP,
               card: SKIP, passcode: SKIP, metadata: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @links = links unless links == SKIP
  @id = id unless id == SKIP
  @object = object unless object == SKIP
  @account_reference_id =  unless  == SKIP
  @consumer_id = consumer_id unless consumer_id == SKIP
  unless create_instrument_identifier == SKIP
    @create_instrument_identifier =
      create_instrument_identifier
  end
  @source = source unless source == SKIP
  @state = state unless state == SKIP
  @reason = reason unless reason == SKIP
  @number = number unless number == SKIP
  @expiration_month = expiration_month unless expiration_month == SKIP
  @expiration_year = expiration_year unless expiration_year == SKIP
  @type = type unless type == SKIP
  @cryptogram = cryptogram unless cryptogram == SKIP
  @security_code = security_code unless security_code == SKIP
  @eci = eci unless eci == SKIP
  @requestor_id = requestor_id unless requestor_id == SKIP
  @enrollment_id = enrollment_id unless enrollment_id == SKIP
  @token_reference_id = token_reference_id unless token_reference_id == SKIP
  unless  == SKIP
    @payment_account_reference =
      
  end
  @card = card unless card == SKIP
  @passcode = passcode unless passcode == SKIP
  @metadata =  unless  == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_reference_idString

An identifier provided by the issuer for the account.

Returns:

  • (String)


28
29
30
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 28

def 
  @account_reference_id
end

#cardCard5

Payment account reference.

Returns:



136
137
138
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 136

def card
  @card
end

#consumer_idString

Identifier of the consumer within the wallet. Maximum 24 characters for VTS.

Returns:

  • (String)


33
34
35
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 33

def consumer_id
  @consumer_id
end

#create_instrument_identifierTrueClass | FalseClass

Specifies whether the InstrumentId should be created (true) or not (false). Possible Values:

  • true: The InstrumentId should be created.
  • false: The InstrumentId should be created.

Returns:

  • (TrueClass | FalseClass)


41
42
43
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 41

def create_instrument_identifier
  @create_instrument_identifier
end

#cryptogramString

Value generated by the card association to be used alongside the network token for processing a payment.

Returns:

  • (String)


106
107
108
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 106

def cryptogram
  @cryptogram
end

#eciString

Raw Electronic Commerce Indicator provided by the card association with the result of the cardholder authentication.

Returns:

  • (String)


116
117
118
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 116

def eci
  @eci
end

#enrollment_idString

Unique id to identify this PAN/ enrollment.

Returns:

  • (String)


124
125
126
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 124

def enrollment_id
  @enrollment_id
end

#expiration_monthString

Two-digit month in which the network token expires. Format: MM. Possible Values: 01 through 12.

Returns:

  • (String)


88
89
90
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 88

def expiration_month
  @expiration_month
end

#expiration_yearString

Four-digit year in which the network token expires. Format: YYYY.

Returns:

  • (String)


93
94
95
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 93

def expiration_year
  @expiration_year
end

#idString

The Id of the Tokenized Card.

Returns:

  • (String)


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

def id
  @id
end

TODO: Write general description for this method

Returns:



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

def links
  @links
end

#metadataMetadata36

Payment account reference.

Returns:



144
145
146
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 144

def 
  @metadata
end

#numberString

The token requestor's network token for the provided PAN and consumer Id, if available.

Returns:

  • (String)


82
83
84
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 82

def number
  @number
end

#objectString

The type. Possible Values:

  • tokenizedCard

Returns:

  • (String)


24
25
26
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 24

def object
  @object
end

#passcodePasscode2

Payment account reference.

Returns:



140
141
142
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 140

def passcode
  @passcode
end

#payment_account_referenceString

Payment account reference.

Returns:

  • (String)


132
133
134
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 132

def 
  @payment_account_reference
end

#reasonString

Issuers state for the network token Possible Values:

  • INVALID_REQUEST : The network token provision request contained invalid data.
  • CARD_VERIFICATION_FAILED : The network token provision request contained data that could not be verified.
  • CARD_NOT_ELIGIBLE : Card can currently not be used with issuer for tokenization.
  • CARD_NOT_ALLOWED : Card can currently not be used with card association for tokenization.
  • DECLINED : Card can currently not be used with issuer for tokenization.
  • SERVICE_UNAVAILABLE : The network token service was unavailable or timed out.
  • SYSTEM_ERROR : An unexpected error occurred with network token service, check configuration.

Returns:

  • (String)


77
78
79
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 77

def reason
  @reason
end

#requestor_idString

11-digit identifier that uniquely identifies the Token Requestor.

Returns:

  • (String)


120
121
122
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 120

def requestor_id
  @requestor_id
end

#security_codeString

4-digit number generated by the card association to be used alogside the network token for processing a payment. Only supported for Amex and SCOF.

Returns:

  • (String)


111
112
113
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 111

def security_code
  @security_code
end

#sourceString

Source of the payment instrument. Possible Values:

  • ONFILE
  • TOKEN
  • ISSUER

Returns:

  • (String)


49
50
51
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 49

def source
  @source
end

#stateString

State of the network token or network token provision. Possible Values:

ACTIVE : Network token is active.
SUSPENDED : Network token is suspended. This state can change back to

ACTIVE. DELETED : This is a final state for a network token instance. UNPROVISIONED : A previous network token.

Returns:

  • (String)


59
60
61
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 59

def state
  @state
end

#token_reference_idString

Unique ID for netwrok token.

Returns:

  • (String)


128
129
130
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 128

def token_reference_id
  @token_reference_id
end

#typeString

The type of card (Card Network). Possible Values:

  • visa
  • mastercard
  • americanexpress

Returns:

  • (String)


101
102
103
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 101

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



255
256
257
258
259
260
261
262
263
264
265
266
267
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 255

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  links = Links22.from_hash(hash['_links']) if hash['_links']
  id = hash.key?('id') ? hash['id'] : SKIP
  object = hash.key?('object') ? hash['object'] : SKIP
   =
    hash.key?('accountReferenceId') ? hash['accountReferenceId'] : SKIP
  consumer_id = hash.key?('consumerId') ? hash['consumerId'] : SKIP
  create_instrument_identifier =
    hash.key?('createInstrumentIdentifier') ? hash['createInstrumentIdentifier'] : SKIP
  source = hash.key?('source') ? hash['source'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  reason = hash.key?('reason') ? hash['reason'] : SKIP
  number = hash.key?('number') ? hash['number'] : SKIP
  expiration_month =
    hash.key?('expirationMonth') ? hash['expirationMonth'] : SKIP
  expiration_year =
    hash.key?('expirationYear') ? hash['expirationYear'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  cryptogram = hash.key?('cryptogram') ? hash['cryptogram'] : SKIP
  security_code = hash.key?('securityCode') ? hash['securityCode'] : SKIP
  eci = hash.key?('eci') ? hash['eci'] : SKIP
  requestor_id = hash.key?('requestorId') ? hash['requestorId'] : SKIP
  enrollment_id = hash.key?('enrollmentId') ? hash['enrollmentId'] : SKIP
  token_reference_id =
    hash.key?('tokenReferenceId') ? hash['tokenReferenceId'] : SKIP
   =
    hash.key?('paymentAccountReference') ? hash['paymentAccountReference'] : SKIP
  card = Card5.from_hash(hash['card']) if hash['card']
  passcode = Passcode2.from_hash(hash['passcode']) if hash['passcode']
   = Metadata36.from_hash(hash['metadata']) if hash['metadata']

  # 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.
  TokenizedcardRequest.new(links: links,
                           id: id,
                           object: object,
                           account_reference_id: ,
                           consumer_id: consumer_id,
                           create_instrument_identifier: create_instrument_identifier,
                           source: source,
                           state: state,
                           reason: reason,
                           number: number,
                           expiration_month: expiration_month,
                           expiration_year: expiration_year,
                           type: type,
                           cryptogram: cryptogram,
                           security_code: security_code,
                           eci: eci,
                           requestor_id: requestor_id,
                           enrollment_id: enrollment_id,
                           token_reference_id: token_reference_id,
                           payment_account_reference: ,
                           card: card,
                           passcode: passcode,
                           metadata: ,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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
172
173
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 147

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['links'] = '_links'
  @_hash['id'] = 'id'
  @_hash['object'] = 'object'
  @_hash['account_reference_id'] = 'accountReferenceId'
  @_hash['consumer_id'] = 'consumerId'
  @_hash['create_instrument_identifier'] = 'createInstrumentIdentifier'
  @_hash['source'] = 'source'
  @_hash['state'] = 'state'
  @_hash['reason'] = 'reason'
  @_hash['number'] = 'number'
  @_hash['expiration_month'] = 'expirationMonth'
  @_hash['expiration_year'] = 'expirationYear'
  @_hash['type'] = 'type'
  @_hash['cryptogram'] = 'cryptogram'
  @_hash['security_code'] = 'securityCode'
  @_hash['eci'] = 'eci'
  @_hash['requestor_id'] = 'requestorId'
  @_hash['enrollment_id'] = 'enrollmentId'
  @_hash['token_reference_id'] = 'tokenReferenceId'
  @_hash['payment_account_reference'] = 'paymentAccountReference'
  @_hash['card'] = 'card'
  @_hash['passcode'] = 'passcode'
  @_hash['metadata'] = 'metadata'
  @_hash
end

.nullablesObject

An array for nullable fields



205
206
207
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 205

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 176

def self.optionals
  %w[
    links
    id
    object
    account_reference_id
    consumer_id
    create_instrument_identifier
    source
    state
    reason
    number
    expiration_month
    expiration_year
    type
    cryptogram
    security_code
    eci
    requestor_id
    enrollment_id
    token_reference_id
    payment_account_reference
    card
    passcode
    metadata
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 338

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} links: #{@links.inspect}, id: #{@id.inspect}, object: #{@object.inspect},"\
  " account_reference_id: #{@account_reference_id.inspect}, consumer_id:"\
  " #{@consumer_id.inspect}, create_instrument_identifier:"\
  " #{@create_instrument_identifier.inspect}, source: #{@source.inspect}, state:"\
  " #{@state.inspect}, reason: #{@reason.inspect}, number: #{@number.inspect},"\
  " expiration_month: #{@expiration_month.inspect}, expiration_year:"\
  " #{@expiration_year.inspect}, type: #{@type.inspect}, cryptogram: #{@cryptogram.inspect},"\
  " security_code: #{@security_code.inspect}, eci: #{@eci.inspect}, requestor_id:"\
  " #{@requestor_id.inspect}, enrollment_id: #{@enrollment_id.inspect}, token_reference_id:"\
  " #{@token_reference_id.inspect}, payment_account_reference:"\
  " #{@payment_account_reference.inspect}, card: #{@card.inspect}, passcode:"\
  " #{@passcode.inspect}, metadata: #{@metadata.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/visa_acceptance_merged_spec/models/tokenizedcard_request.rb', line 324

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} links: #{@links}, id: #{@id}, object: #{@object}, account_reference_id:"\
  " #{@account_reference_id}, consumer_id: #{@consumer_id}, create_instrument_identifier:"\
  " #{@create_instrument_identifier}, source: #{@source}, state: #{@state}, reason:"\
  " #{@reason}, number: #{@number}, expiration_month: #{@expiration_month}, expiration_year:"\
  " #{@expiration_year}, type: #{@type}, cryptogram: #{@cryptogram}, security_code:"\
  " #{@security_code}, eci: #{@eci}, requestor_id: #{@requestor_id}, enrollment_id:"\
  " #{@enrollment_id}, token_reference_id: #{@token_reference_id}, payment_account_reference:"\
  " #{@payment_account_reference}, card: #{@card}, passcode: #{@passcode}, metadata:"\
  " #{@metadata}, additional_properties: #{@additional_properties}>"
end