Class: CyberSourceMergedSpec::TokenizedCard9
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::TokenizedCard9
- Defined in:
- lib/cyber_source_merged_spec/models/tokenized_card9.rb
Overview
TokenizedCard9 Model.
Instance Attribute Summary collapse
-
#application_transaction_counter ⇒ String
A sequence counter used as part of the input to the TAVV cryptogram and it is incremented for each cryptogram generation.
-
#card ⇒ Card15
A sequence counter used as part of the input to the TAVV cryptogram and it is incremented for each cryptogram generation.
-
#cryptogram ⇒ String
Value generated by the card association to be used alongside the network token for processing a payment.
-
#eci ⇒ String
Raw Electronic Commerce Indicator provided by the card association with the result of the cardholder authentication.
-
#enrollment_id ⇒ String
Unique id to identify this PAN/ enrollment.
-
#expiration_month ⇒ String
Two-digit month in which the network token expires.
-
#expiration_year ⇒ String
Four-digit year in which the network token expires.
-
#id ⇒ String
The Id of the Tokenized Card.
-
#metadata ⇒ Metadata2
Verification results returned by the issuer during the provisioning when Security Code or Billing Address data is provided on the request.
-
#number ⇒ String
The token requestor's network token for the provided PAN and consumer Id, if available.
-
#object ⇒ String
The type.
-
#payment_account_reference ⇒ String
Payment account reference.
-
#reason ⇒ String
Indicates the reason why the network token provision request failed.
-
#requestor_id ⇒ String
11-digit identifier that uniquely identifies the Token Requestor.
-
#security_code ⇒ String
Dynamic number generated by the card association to be used alongside the network token for processing a payment.
-
#source ⇒ String
Source of the card details.
-
#state ⇒ String
State of the network token or network token provision.
-
#token_reference_id ⇒ String
Unique ID for netwrok token.
-
#type ⇒ String
The type of card (Card Network).
-
#verification_results ⇒ VerificationResults
Verification results returned by the issuer during the provisioning when Security Code or Billing Address data is provided on the request.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#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, metadata: SKIP, additional_properties: nil) ⇒ TokenizedCard9
constructor
A new instance of TokenizedCard9.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ Object
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, metadata: SKIP, additional_properties: nil) ⇒ TokenizedCard9
Returns a new instance of TokenizedCard9.
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 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 204 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, metadata: 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 payment_account_reference == SKIP @payment_account_reference = 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 @metadata = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#application_transaction_counter ⇒ String
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.
126 127 128 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 126 def application_transaction_counter @application_transaction_counter end |
#card ⇒ Card15
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.
132 133 134 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 132 def card @card end |
#cryptogram ⇒ String
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.
96 97 98 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 96 def cryptogram @cryptogram end |
#eci ⇒ String
Raw Electronic Commerce Indicator provided by the card association with the result of the cardholder authentication.
112 113 114 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 112 def eci @eci end |
#enrollment_id ⇒ String
Unique id to identify this PAN/ enrollment.
42 43 44 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 42 def enrollment_id @enrollment_id end |
#expiration_month ⇒ String
Two-digit month in which the network token expires.
Format: MM.
Possible Values: 01 through 12.
57 58 59 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 57 def expiration_month @expiration_month end |
#expiration_year ⇒ String
Four-digit year in which the network token expires.
Format: YYYY.
62 63 64 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 62 def expiration_year @expiration_year end |
#id ⇒ String
The Id of the Tokenized Card.
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 14 def id @id end |
#metadata ⇒ Metadata2
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.
144 145 146 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 144 def @metadata end |
#number ⇒ String
The token requestor's network token for the provided PAN and consumer Id, if available.
51 52 53 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 51 def number @number end |
#object ⇒ String
The type. Possible Values:
- tokenizedCard
20 21 22 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 20 def object @object end |
#payment_account_reference ⇒ String
Payment account reference.
120 121 122 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 120 def payment_account_reference @payment_account_reference end |
#reason ⇒ String
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.
88 89 90 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 88 def reason @reason end |
#requestor_id ⇒ String
11-digit identifier that uniquely identifies the Token Requestor.
116 117 118 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 116 def requestor_id @requestor_id end |
#security_code ⇒ String
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.
107 108 109 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 107 def security_code @security_code end |
#source ⇒ String
Source of the card details. Possible Values:
- ONFILE
- TOKEN
- ISSUER
28 29 30 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 28 def source @source end |
#state ⇒ String
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.
38 39 40 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 38 def state @state end |
#token_reference_id ⇒ String
Unique ID for netwrok token.
46 47 48 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 46 def token_reference_id @token_reference_id end |
#type ⇒ String
The type of card (Card Network). Possible Values:
- visa
- mastercard
- americanexpress
70 71 72 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 70 def type @type end |
#verification_results ⇒ VerificationResults
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.
138 139 140 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 138 def verification_results @verification_results end |
Class Method Details
.from_element(root) ⇒ Object
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 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 308 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) payment_account_reference = 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) = XmlUtilities.from_element(root, 'Metadata2', Metadata2) 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: payment_account_reference, application_transaction_counter: application_transaction_counter, card: card, verification_results: verification_results, metadata: , additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 246 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 payment_account_reference = 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'] = Metadata2.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. TokenizedCard9.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: payment_account_reference, application_transaction_counter: application_transaction_counter, card: card, verification_results: verification_results, metadata: , additional_properties: additional_properties) end |
.names ⇒ Object
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 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 147 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['metadata'] = 'metadata' @_hash end |
.nullables ⇒ Object
An array for nullable fields
200 201 202 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 200 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 174 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 metadata ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 412 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}, metadata: #{@metadata.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 398 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}, metadata: #{@metadata}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
# File 'lib/cyber_source_merged_spec/models/tokenized_card9.rb', line 362 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', payment_account_reference) 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, 'Metadata2', ) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |