Class: CyberSourceMergedSpec::TokenizedCard13

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

Overview

TokenizedCard13 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(id: SKIP, object: SKIP, source: SKIP, state: SKIP, enrollment_id: SKIP, token_reference_id: SKIP, number: SKIP, expiration_month: SKIP, expiration_year: SKIP, type: SKIP, reason: SKIP, cryptogram: SKIP, security_code: SKIP, eci: SKIP, requestor_id: SKIP, payment_account_reference: SKIP, application_transaction_counter: SKIP, card: SKIP, verification_results: SKIP, additional_properties: nil) ⇒ TokenizedCard13

Returns a new instance of TokenizedCard13.



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
224
225
226
227
228
229
230
231
232
233
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 196

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

  @id = id unless id == SKIP
  @object = object unless object == SKIP
  @source = source unless source == SKIP
  @state = state unless state == SKIP
  @enrollment_id = enrollment_id unless enrollment_id == SKIP
  @token_reference_id = token_reference_id unless token_reference_id == 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
  @reason = reason unless reason == 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
  unless  == SKIP
    @payment_account_reference =
      
  end
  unless application_transaction_counter == SKIP
    @application_transaction_counter =
      application_transaction_counter
  end
  @card = card unless card == SKIP
  @verification_results = verification_results unless verification_results == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#application_transaction_counterString

A sequence counter used as part of the input to the TAVV cryptogram and it is incremented for each cryptogram generation. This field is only returned for Visa network tokens.

Returns:

  • (String)


126
127
128
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 126

def application_transaction_counter
  @application_transaction_counter
end

#cardCard15

A sequence counter used as part of the input to the TAVV cryptogram and it is incremented for each cryptogram generation. This field is only returned for Visa network tokens.

Returns:



132
133
134
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 132

def card
  @card
end

#cryptogramString

Value generated by the card association to be used alongside the network token for processing a payment. This field is returned by default for Visa and Mastercard network tokens. It can also be explicitly requested using paymentCredentialType: CRYPTOGRAM.

Returns:

  • (String)


96
97
98
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 96

def cryptogram
  @cryptogram
end

#eciString

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

Returns:

  • (String)


112
113
114
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 112

def eci
  @eci
end

#enrollment_idString

Unique id to identify this PAN/ enrollment.

Returns:

  • (String)


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

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)


57
58
59
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 57

def expiration_month
  @expiration_month
end

#expiration_yearString

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

Returns:

  • (String)


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

def expiration_year
  @expiration_year
end

#idString

The Id of the Tokenized Card.

Returns:

  • (String)


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

def id
  @id
end

#numberString

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

Returns:

  • (String)


51
52
53
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 51

def number
  @number
end

#objectString

The type. Possible Values:

  • tokenizedCard

Returns:

  • (String)


20
21
22
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 20

def object
  @object
end

#payment_account_referenceString

Payment account reference.

Returns:

  • (String)


120
121
122
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 120

def 
  @payment_account_reference
end

#reasonString

Indicates the reason why the network token provision request failed. 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)


88
89
90
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 88

def reason
  @reason
end

#requestor_idString

11-digit identifier that uniquely identifies the Token Requestor.

Returns:

  • (String)


116
117
118
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 116

def requestor_id
  @requestor_id
end

#security_codeString

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

  • For American Express: Dynamic Card Secure Code (DCSC) returned by default.
  • For Visa: DTVV cryptogram when explicitly requested using paymentCredentialType: SECURITY_CODE. It can also be explicitly requested using paymentCredentialType: SECURITY_CODE.

Returns:

  • (String)


107
108
109
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 107

def security_code
  @security_code
end

#sourceString

Source of the card details. Possible Values:

  • ONFILE
  • TOKEN
  • ISSUER

Returns:

  • (String)


28
29
30
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 28

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)


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

def state
  @state
end

#token_reference_idString

Unique ID for netwrok token.

Returns:

  • (String)


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

def token_reference_id
  @token_reference_id
end

#typeString

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

  • visa
  • mastercard
  • americanexpress

Returns:

  • (String)


70
71
72
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 70

def type
  @type
end

#verification_resultsVerificationResults

Verification results returned by the issuer during the provisioning when Security Code or Billing Address data is provided on the request. Supported only for VTS tokens.

Returns:



138
139
140
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 138

def verification_results
  @verification_results
end

Class Method Details

.from_element(root) ⇒ Object



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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 296

def self.from_element(root)
  id = XmlUtilities.from_element(root, 'id', String)
  object = XmlUtilities.from_element(root, 'object', String)
  source = XmlUtilities.from_element(root, 'source', String)
  state = XmlUtilities.from_element(root, 'state', String)
  enrollment_id = XmlUtilities.from_element(root, 'enrollmentId', String)
  token_reference_id = XmlUtilities.from_element(root, 'tokenReferenceId',
                                                 String)
  number = XmlUtilities.from_element(root, 'number', String)
  expiration_month = XmlUtilities.from_element(root, 'expirationMonth',
                                               String)
  expiration_year = XmlUtilities.from_element(root, 'expirationYear',
                                              String)
  type = XmlUtilities.from_element(root, 'type', String)
  reason = XmlUtilities.from_element(root, 'reason', String)
  cryptogram = XmlUtilities.from_element(root, 'cryptogram', String)
  security_code = XmlUtilities.from_element(root, 'securityCode', String)
  eci = XmlUtilities.from_element(root, 'eci', String)
  requestor_id = XmlUtilities.from_element(root, 'requestorId', String)
   = XmlUtilities.from_element(
    root, 'paymentAccountReference', String
  )
  application_transaction_counter = XmlUtilities.from_element(
    root, 'applicationTransactionCounter', String
  )
  card = XmlUtilities.from_element(root, 'Card15', Card15)
  verification_results = XmlUtilities.from_element(root,
                                                   'VerificationResults',
                                                   VerificationResults)

  new(id: id,
      object: object,
      source: source,
      state: state,
      enrollment_id: enrollment_id,
      token_reference_id: token_reference_id,
      number: number,
      expiration_month: expiration_month,
      expiration_year: expiration_year,
      type: type,
      reason: reason,
      cryptogram: cryptogram,
      security_code: security_code,
      eci: eci,
      requestor_id: requestor_id,
      payment_account_reference: ,
      application_transaction_counter: application_transaction_counter,
      card: card,
      verification_results: verification_results,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  object = hash.key?('object') ? hash['object'] : SKIP
  source = hash.key?('source') ? hash['source'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  enrollment_id = hash.key?('enrollmentId') ? hash['enrollmentId'] : SKIP
  token_reference_id =
    hash.key?('tokenReferenceId') ? hash['tokenReferenceId'] : 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
  reason = hash.key?('reason') ? hash['reason'] : 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
   =
    hash.key?('paymentAccountReference') ? hash['paymentAccountReference'] : SKIP
  application_transaction_counter =
    hash.key?('applicationTransactionCounter') ? hash['applicationTransactionCounter'] : SKIP
  card = Card15.from_hash(hash['card']) if hash['card']
  verification_results = VerificationResults.from_hash(hash['verificationResults']) if
    hash['verificationResults']

  # 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.
  TokenizedCard13.new(id: id,
                      object: object,
                      source: source,
                      state: state,
                      enrollment_id: enrollment_id,
                      token_reference_id: token_reference_id,
                      number: number,
                      expiration_month: expiration_month,
                      expiration_year: expiration_year,
                      type: type,
                      reason: reason,
                      cryptogram: cryptogram,
                      security_code: security_code,
                      eci: eci,
                      requestor_id: requestor_id,
                      payment_account_reference: ,
                      application_transaction_counter: application_transaction_counter,
                      card: card,
                      verification_results: verification_results,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 141

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['object'] = 'object'
  @_hash['source'] = 'source'
  @_hash['state'] = 'state'
  @_hash['enrollment_id'] = 'enrollmentId'
  @_hash['token_reference_id'] = 'tokenReferenceId'
  @_hash['number'] = 'number'
  @_hash['expiration_month'] = 'expirationMonth'
  @_hash['expiration_year'] = 'expirationYear'
  @_hash['type'] = 'type'
  @_hash['reason'] = 'reason'
  @_hash['cryptogram'] = 'cryptogram'
  @_hash['security_code'] = 'securityCode'
  @_hash['eci'] = 'eci'
  @_hash['requestor_id'] = 'requestorId'
  @_hash['payment_account_reference'] = 'paymentAccountReference'
  @_hash['application_transaction_counter'] =
    'applicationTransactionCounter'
  @_hash['card'] = 'card'
  @_hash['verification_results'] = 'verificationResults'
  @_hash
end

.nullablesObject

An array for nullable fields



192
193
194
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 192

def self.nullables
  []
end

.optionalsObject

An array for optional fields



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 167

def self.optionals
  %w[
    id
    object
    source
    state
    enrollment_id
    token_reference_id
    number
    expiration_month
    expiration_year
    type
    reason
    cryptogram
    security_code
    eci
    requestor_id
    payment_account_reference
    application_transaction_counter
    card
    verification_results
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 396

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

#to_sObject

Provides a human-readable string representation of the object.



383
384
385
386
387
388
389
390
391
392
393
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 383

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

#to_xml_element(doc, root_name) ⇒ Object



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/cyber_source_merged_spec/models/tokenized_card13.rb', line 348

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

  XmlUtilities.add_as_subelement(doc, root, 'id', id)
  XmlUtilities.add_as_subelement(doc, root, 'object', object)
  XmlUtilities.add_as_subelement(doc, root, 'source', source)
  XmlUtilities.add_as_subelement(doc, root, 'state', state)
  XmlUtilities.add_as_subelement(doc, root, 'enrollmentId', enrollment_id)
  XmlUtilities.add_as_subelement(doc, root, 'tokenReferenceId',
                                 token_reference_id)
  XmlUtilities.add_as_subelement(doc, root, 'number', number)
  XmlUtilities.add_as_subelement(doc, root, 'expirationMonth',
                                 expiration_month)
  XmlUtilities.add_as_subelement(doc, root, 'expirationYear',
                                 expiration_year)
  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'reason', reason)
  XmlUtilities.add_as_subelement(doc, root, 'cryptogram', cryptogram)
  XmlUtilities.add_as_subelement(doc, root, 'securityCode', security_code)
  XmlUtilities.add_as_subelement(doc, root, 'eci', eci)
  XmlUtilities.add_as_subelement(doc, root, 'requestorId', requestor_id)
  XmlUtilities.add_as_subelement(doc, root, 'paymentAccountReference',
                                 )
  XmlUtilities.add_as_subelement(doc, root, 'applicationTransactionCounter',
                                 application_transaction_counter)
  XmlUtilities.add_as_subelement(doc, root, 'Card15', card)
  XmlUtilities.add_as_subelement(doc, root, 'VerificationResults',
                                 verification_results)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end