Class: CyberSourceMergedSpec::TokenizedCard1

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

Overview

TokenizedCard1 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(prefix: SKIP, suffix: SKIP, type: SKIP, assurance_level: SKIP, expiration_month: SKIP, expiration_year: SKIP, requestor_id: SKIP, assurance_method: SKIP, additional_properties: nil) ⇒ TokenizedCard1

Returns a new instance of TokenizedCard1.



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 282

def initialize(prefix: SKIP, suffix: SKIP, type: SKIP,
               assurance_level: SKIP, expiration_month: SKIP,
               expiration_year: SKIP, requestor_id: SKIP,
               assurance_method: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @prefix = prefix unless prefix == SKIP
  @suffix = suffix unless suffix == SKIP
  @type = type unless type == SKIP
  @assurance_level = assurance_level unless assurance_level == SKIP
  @expiration_month = expiration_month unless expiration_month == SKIP
  @expiration_year = expiration_year unless expiration_year == SKIP
  @requestor_id = requestor_id unless requestor_id == SKIP
  @assurance_method = assurance_method unless assurance_method == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#assurance_levelString

Confidence level of the tokenization. This value is assigned by the token service provider. Note This field is supported only for CyberSource through VisaNet and FDC Nashville Global. Returned by PIN debit credit or PIN debit purchase. Note Merchants supported for CyberSource through VisaNet/Visa Platform Connect are advised not to use this field.

Returns:

  • (String)


169
170
171
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 169

def assurance_level
  @assurance_level
end

#assurance_methodString

Confidence level of the tokenization. This value is assigned by the token service provider. Note This field is supported only for Visa Platform Connect

Returns:

  • (String)


247
248
249
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 247

def assurance_method
  @assurance_method
end

#expiration_monthString

One of two possible meanings:

  • The two-digit month in which a token expires.
  • The two-digit month in which a card expires. Format: MM Possible values: 01 through 12 NOTE The meaning of this field is dependent on the payment processor that is returning the value in an authorization reply. Please see the processor-specific details below.

Barclays and Streamline

For Maestro (UK Domestic) and Maestro (International) cards on Barclays and Streamline, this must be a valid value (01 through 12) but is not required to be a valid expiration date. In other words, an expiration date that is in the past does not cause CyberSource to reject your request. However, an invalid expiration date might cause the issuer to reject your request.

Encoded Account Numbers

For encoded account numbers (card_type=039), if there is no expiration date on the card, use 12.
Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

Samsung Pay and Apple Pay

Month in which the token expires. CyberSource includes this field in the reply message when it decrypts the payment blob for the tokenized transaction.

Returns:

  • (String)


196
197
198
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 196

def expiration_month
  @expiration_month
end

#expiration_yearString

One of two possible meanings:

  • The four-digit year in which a token expires.
  • The four-digit year in which a card expires. Format: YYYY Possible values: 1900 through 3000 Data type: Non-negative integer NOTE The meaning of this field is dependent on the payment processor that is returning the value in an authorization reply. Please see the processor-specific details below.

Barclays and Streamline

For Maestro (UK Domestic) and Maestro (International) cards on Barclays and Streamline, this must be a valid value (1900 through 3000) but is not required to be a valid expiration date. In other words, an expiration date that is in the past does not cause CyberSource to reject your request. However, an invalid expiration date might cause the issuer to reject your request.

Encoded Account Numbers

For encoded account numbers (card_ type=039), if there is no expiration date on the card, use 2021.

FDC Nashville Global and FDMS South

You can send in 2 digits or 4 digits. When you send in 2 digits, they must be the last 2 digits of the year.

Samsung Pay and Apple Pay

Year in which the token expires. CyberSource includes this field in the reply message when it decrypts the payment blob for the tokenized transaction. Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

Returns:

  • (String)


229
230
231
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 229

def expiration_year
  @expiration_year
end

#prefixString

First six digits of token. CyberSource includes this field in the reply message when it decrypts the payment blob for the tokenized transaction.

Returns:

  • (String)


16
17
18
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 16

def prefix
  @prefix
end

#requestor_idString

Value that identifies your business and indicates that the cardholder’s account number is tokenized. This value is assigned by the token service provider and is unique within the token service provider’s database. Note This field is supported only for CyberSource through VisaNet and FDC Nashville Global.

PIN debit

Optional field for PIN debit credit or PIN debit purchase transactions that use payment network tokens; otherwise, not used.

Returns:

  • (String)


241
242
243
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 241

def requestor_id
  @requestor_id
end

#suffixString

Last four digits of token. CyberSource includes this field in the reply message when it decrypts the payment blob for the tokenized transaction. For details, see token_suffix field description in [Google Pay Using the SCMP API.] (https://apps.cybersource.com/library/documentation/dev_guides/Google_Pay_ SCMP_API/html/)

Returns:

  • (String)


26
27
28
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 26

def suffix
  @suffix
end

#typeString

Three-digit value that indicates the card type. IMPORTANT It is strongly recommended that you include the card type field in request messages even if it is optional for your processor and card type. Omitting the card type can cause the transaction to be processed with the wrong card type. Possible values:

  • 001: Visa. Use card type value 001 for Visa Electron.
  • 002: Mastercard, Eurocard, which is a European regional brand of Mastercard.
  • 003: American Express
  • 004: Discover
  • 005: Diners Club
  • 006: Carte Blanche
  • 007: JCB
  • 008: Optima
  • 009: GE Private Label
  • 010: Beneficial Private Label
  • 011: Twinpay Credit Card
  • 012: Twinpay Debit Card
  • 013: WalMart
  • 014: Enroute
  • 015: Lowe's Consumer
  • 016: Home Depot Consumer
  • 017: MBNA
  • 018: Dick's Sportswear
  • 019: Casual Corner
  • 020: Sears
  • 021: JAL
  • 023: Disney Card
  • 024: Maestro (UK Domestic)[^1]
  • 025: Sam's Club Consumer
  • 026: Sam's Club Business
  • 027: Nico's
  • 028: Paymentech Bill Me Later
  • 029: Bebe
  • 030: Restoration Hardware
  • 031: Delta Online
  • 032: Solo
  • 033: Visa Electron. Do not use this value. Use 001 for all Visa card types.
  • 034: Dankort
  • 035: Laser
  • 036: Cartes Bancaires
  • 037: Carta Si
  • 038: Pinless Debit
  • 039: Encoded account number
  • 040: UATP
  • 041: HOUSEHOLD
  • 042: Maestro (International)[^1]
  • 043: GE MONEY
  • 044: Korean Cards
  • 045: Style Cards
  • 046: JCrew
  • 047: Payeasecn eWallet
  • 048: Payeasecn Bank Transfer
  • 049: Meijer
  • 050: Hipercard
  • 051: Aura
  • 052: Redecard
  • 053: Orico card
  • 054: Elo
  • 055: Capitol One Private Label
  • 056: Carnet
  • 057: Costco Private Label
  • 058: Carnet
  • 059: ValueLink
  • 060: MADA
  • 061: RuPay
  • 062: China UnionPay
  • 063: Falabella Private Label
  • 064: Prompt Card
  • 065: Korean Domestic
  • 066: Banricompras
  • 067: MEEZA
  • 068: PayPak
  • 070: EFTPOS
  • 071: Codensa
  • 072: Olimpica
  • 073: Colsubsidio
  • 074: Tuya
  • 075: Sodexo
  • 076: Naranja
  • 077: Cabal
  • 078: DINELCO
  • 079: PANAL
  • 080: EPM
  • 081: Jaywan [^1]: For this card type, you must include the paymentInformation.card.type or paymentInformation.tokenizedCard.type field in your request for an authorization or a stand-alone credit. [^2]: For this card type on Cielo 3.0, you must include the paymentInformation.card.type or paymentInformation.tokenizedCard.type field in a request for an authorization or a stand-alone credit. This card type is not supported on Cielo 1.5. [^3]: For this card type on Getnet and Rede, you must include the paymentInformation.card.type or paymentInformation.tokenizedCard.type field in a request for an authorization or a stand-alone credit. [^4]: For this card type, you must include the paymentInformation.card.type in your request for any payer authentication services.

Used by

Authorization Required for Carte Blanche and JCB. Optional for all other card types.

Card Present reply

This field is included in the reply message when the client software that is installed on the POS terminal uses the token management service (TMS) to retrieve tokenized payment details. You must contact customer support to have your account enabled to receive these fields in the credit reply message. Returned by the Credit service. This reply field is only supported by the following processors:

  • American Express Direct
  • Credit Mutuel-CIC
  • FDC Nashville Global
  • OmniPay Direct
  • SIX

Google Pay transactions

For PAN-based Google Pay transactions, this field is returned in the API response.

GPX

This field only supports transactions from the following card types:

  • Visa
  • Mastercard
  • AMEX
  • Discover
  • Diners
  • JCB
  • Union Pay International

Returns:

  • (String)


159
160
161
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 159

def type
  @type
end

Class Method Details

.from_element(root) ⇒ Object



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_card1.rb', line 337

def self.from_element(root)
  prefix = XmlUtilities.from_element(root, 'prefix', String)
  suffix = XmlUtilities.from_element(root, 'suffix', String)
  type = XmlUtilities.from_element(root, 'type', String)
  assurance_level = XmlUtilities.from_element(root, 'assuranceLevel',
                                              String)
  expiration_month = XmlUtilities.from_element(root, 'expirationMonth',
                                               String)
  expiration_year = XmlUtilities.from_element(root, 'expirationYear',
                                              String)
  requestor_id = XmlUtilities.from_element(root, 'requestorId', String)
  assurance_method = XmlUtilities.from_element(root, 'assuranceMethod',
                                               String)

  new(prefix: prefix,
      suffix: suffix,
      type: type,
      assurance_level: assurance_level,
      expiration_month: expiration_month,
      expiration_year: expiration_year,
      requestor_id: requestor_id,
      assurance_method: assurance_method,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  prefix = hash.key?('prefix') ? hash['prefix'] : SKIP
  suffix = hash.key?('suffix') ? hash['suffix'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  assurance_level =
    hash.key?('assuranceLevel') ? hash['assuranceLevel'] : SKIP
  expiration_month =
    hash.key?('expirationMonth') ? hash['expirationMonth'] : SKIP
  expiration_year =
    hash.key?('expirationYear') ? hash['expirationYear'] : SKIP
  requestor_id = hash.key?('requestorId') ? hash['requestorId'] : SKIP
  assurance_method =
    hash.key?('assuranceMethod') ? hash['assuranceMethod'] : 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.
  TokenizedCard1.new(prefix: prefix,
                     suffix: suffix,
                     type: type,
                     assurance_level: assurance_level,
                     expiration_month: expiration_month,
                     expiration_year: expiration_year,
                     requestor_id: requestor_id,
                     assurance_method: assurance_method,
                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 250

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['prefix'] = 'prefix'
  @_hash['suffix'] = 'suffix'
  @_hash['type'] = 'type'
  @_hash['assurance_level'] = 'assuranceLevel'
  @_hash['expiration_month'] = 'expirationMonth'
  @_hash['expiration_year'] = 'expirationYear'
  @_hash['requestor_id'] = 'requestorId'
  @_hash['assurance_method'] = 'assuranceMethod'
  @_hash
end

.nullablesObject

An array for nullable fields



278
279
280
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 278

def self.nullables
  []
end

.optionalsObject

An array for optional fields



264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 264

def self.optionals
  %w[
    prefix
    suffix
    type
    assurance_level
    expiration_month
    expiration_year
    requestor_id
    assurance_method
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



393
394
395
396
397
398
399
400
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 393

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} prefix: #{@prefix.inspect}, suffix: #{@suffix.inspect}, type:"\
  " #{@type.inspect}, assurance_level: #{@assurance_level.inspect}, expiration_month:"\
  " #{@expiration_month.inspect}, expiration_year: #{@expiration_year.inspect}, requestor_id:"\
  " #{@requestor_id.inspect}, assurance_method: #{@assurance_method.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



384
385
386
387
388
389
390
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 384

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} prefix: #{@prefix}, suffix: #{@suffix}, type: #{@type}, assurance_level:"\
  " #{@assurance_level}, expiration_month: #{@expiration_month}, expiration_year:"\
  " #{@expiration_year}, requestor_id: #{@requestor_id}, assurance_method:"\
  " #{@assurance_method}, 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
# File 'lib/cyber_source_merged_spec/models/tokenized_card1.rb', line 362

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

  XmlUtilities.add_as_subelement(doc, root, 'prefix', prefix)
  XmlUtilities.add_as_subelement(doc, root, 'suffix', suffix)
  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'assuranceLevel',
                                 assurance_level)
  XmlUtilities.add_as_subelement(doc, root, 'expirationMonth',
                                 expiration_month)
  XmlUtilities.add_as_subelement(doc, root, 'expirationYear',
                                 expiration_year)
  XmlUtilities.add_as_subelement(doc, root, 'requestorId', requestor_id)
  XmlUtilities.add_as_subelement(doc, root, 'assuranceMethod',
                                 assurance_method)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end