Class: VisaAcceptanceMergedSpec::Card

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

Overview

Card 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(number: SKIP, expiration_month: SKIP, expiration_year: SKIP, type: SKIP, use_as: SKIP, source_account_type: SKIP, source_account_type_details: SKIP, security_code: SKIP, security_code_indicator: SKIP, account_encoder_id: SKIP, issue_number: SKIP, start_month: SKIP, start_year: SKIP, product_name: SKIP, product_subtype: SKIP, type_selection_indicator: SKIP, additional_properties: nil) ⇒ Card

Returns a new instance of Card.



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 459

def initialize(number: SKIP, expiration_month: SKIP, expiration_year: SKIP,
               type: SKIP, use_as: SKIP, source_account_type: SKIP,
               source_account_type_details: SKIP, security_code: SKIP,
               security_code_indicator: SKIP, account_encoder_id: SKIP,
               issue_number: SKIP, start_month: SKIP, start_year: SKIP,
               product_name: SKIP, product_subtype: SKIP,
               type_selection_indicator: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @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
  @use_as = use_as unless use_as == SKIP
  @source_account_type =  unless  == SKIP
  unless  == SKIP
    @source_account_type_details =
      
  end
  @security_code = security_code unless security_code == SKIP
  @security_code_indicator = security_code_indicator unless security_code_indicator == SKIP
  @account_encoder_id =  unless  == SKIP
  @issue_number = issue_number unless issue_number == SKIP
  @start_month = start_month unless start_month == SKIP
  @start_year = start_year unless start_year == SKIP
  @product_name = product_name unless product_name == SKIP
  @product_subtype = product_subtype unless product_subtype == SKIP
  @type_selection_indicator = type_selection_indicator unless type_selection_indicator == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_encoder_idString

Identifier for the issuing bank that provided the customer’s encoded account number. Contact your processor for the bank’s ID.

Returns:

  • (String)


340
341
342
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 340

def 
  @account_encoder_id
end

#expiration_monthString

Two-digit month in which the payment card expires. Format: MM. Valid values: 01 through 12. Leading 0 is required.

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 Visa Acceptance to reject your request. However, an invalid expiration date might cause the issuer to reject your request.

Encoded Account Numbers

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

FDMS Nashville

Required field.

All other processors

Required if pointOfSaleInformation.entryMode=keyed. However, this field is optional if your account is configured for relaxed requirements for address data and expiration date. Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

Google Pay transactions

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

Returns:

  • (String)


58
59
60
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 58

def expiration_month
  @expiration_month
end

#expiration_yearString

Four-digit year in which the payment card expires. Format: YYYY.

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 Visa Acceptance to reject your request. However, an invalid expiration date might cause the issuer to reject your request.

Encoded Account Numbers

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

FDMS Nashville

Required field.

FDC Nashville Global and FDMS South

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

All other processors

Required if pointOfSaleInformation.entryMode=keyed. However, this field is optional if your account is configured for relaxed requirements for address data and expiration date. Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

Google Pay transactions

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

Returns:

  • (String)


87
88
89
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 87

def expiration_year
  @expiration_year
end

#issue_numberString

Number of times a Maestro (UK Domestic) card has been issued to the account holder. The card might or might not have an issue number. The number can consist of one or two digits, and the first digit might be a zero. When you include this value in your request, include exactly what is printed on the card. A value of 2 is different than a value of 02. Do not include the field, even with a blank value, if the card is not a Maestro (UK Domestic) card. Note The issue number is not required for Maestro (UK Domestic) transactions.

Returns:

  • (String)


352
353
354
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 352

def issue_number
  @issue_number
end

#numberString

The customer’s payment card number, also known as the Primary Account Number (PAN). You can also use this field for encoded account numbers.

FDMS Nashville

Required. String (19)

GPX

Required if pointOfSaleInformation.entryMode=keyed. However, this field is optional if your account is configured for relaxed requirements for address data and expiration date. Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

All other processors

Required if pointOfSaleInformation.entryMode=keyed. However, this field is optional if your account is configured for relaxed requirements for address data and expiration date. Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

Returns:

  • (String)


30
31
32
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 30

def number
  @number
end

#product_nameString

Name of the card product. Possible value:

  • BNDES This field is supported only for BNDES transactions on Visa Acceptance through VisaNet. The value for this field corresponds to the following data in the TC 33 capture file5:
  • Record: CP07 TCR4
  • Position: 115-120
  • Field: Brazil Country Data

Returns:

  • (String)


381
382
383
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 381

def product_name
  @product_name
end

#product_subtypeString

This field would contain the indicator for transaction type Possible values:

  • AC: Agriculture Maintenance Account
  • AE: Agriculture Debit Account/Electron
  • AG: Agriculture
  • AI: Agriculture Investment Loan
  • CG: Brazil Cargo
  • CS: Construction
  • DS: Distribution
  • HC: Healthcare
  • LP: Visa Large Purchase Advantage
  • MA: Visa Mobile Agent
  • MB: Interoperable Mobile Branchless Banking
  • MG: Visa Mobile General
  • VA: Visa Vale - Supermarket
  • VF: Visa Vale - Fuel
  • VR: Visa Vale - Restaurant

Returns:

  • (String)


401
402
403
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 401

def product_subtype
  @product_subtype
end

#security_codeString

Card Verification Number.

FDMS Nashville

Required for American Express or if swiped; otherwise, optional.

Ingenico ePayments

Do not include this field when commerceIndicator=recurring. Note Ingenico ePayments was previously called Global Collect.

TSYS Acquiring Solutions

Optional if pointOfSaleInformation.entryMode=keyed; otherwise, not used.

GPX

Optional.

All other processors:

Optional.

Returns:

  • (String)


317
318
319
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 317

def security_code
  @security_code
end

#security_code_indicatorString

Indicates whether a CVN code was sent. Possible values:

  • 0 (default): CVN service not requested. This default value is used when you do not include securityCode field in the request.
  • 1 (default): CVN service requested and supported. This default value is used when you include securityCode field in the request.
  • 2: CVN on credit card is illegible.
  • 9: CVN was not imprinted on credit card.

FDMS Nashville

Required for American Express cards; otherwise, optional.

TSYS Acquiring Solutions

Optional if pointOfSaleInformation.entryMode=keyed; otherwise, not used.

All other processors

Optional.

Returns:

  • (String)


335
336
337
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 335

def security_code_indicator
  @security_code_indicator
end

#source_account_typeString

Flag that specifies the type of account associated with the card. The cardholder provides this information during the payment process. This field is required in the following cases:

- Debit transactions on Cielo and Comercio Latino.
- Transactions with Brazilian-issued cards on Visa Acceptance through

VisaNet.

  • Applicable only for Visa Acceptance through VisaNet (CtV). Note Combo cards in Brazil contain credit and debit functionality in a single card. Visa systems use a credit bank identification number (BIN) for this type of card. Using the BIN to determine whether a card is debit or credit can cause transactions with these cards to be processed incorrectly. Visa Acceptance strongly recommends that you include this field for combo card transactions. Possible values include the following.
  • CH: Checking account
  • CR: Credit card account
  • SA: Saving account
  • LI: Line of credit or credit portion of combo card
  • PP: Prepaid card account or prepaid portion of combo card
  • UA: Universal account If useAs is set to credit/debit and there is a value in SourceAccountType, the value in the SourceAccountType field will take precedence. If useAs is set to CR/DB and there is a value in SourceAccountType, the value in the useAs field will take precedence.

Returns:

  • (String)


286
287
288
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 286

def 
  @source_account_type
end

#source_account_type_detailsString

Type of account that is being used when the value for the override_payment_method field is line of credit (LI) or prepaid card (PP). Possible values for line of credit:

  • AGRC: Visa Agro Custeio
  • AGRE: Visa Agro Electron
  • AGRI: Visa Agro Investimento
  • AGRO: Visa Agro Possible values for prepaid card:
  • VVA: Visa Vale Alimentacao
  • VVF: Visa Vale Flex
  • VVR: Visa Vale Refeicao This field is supported only for combo card transactions in Brazil on Visa Acceptance through VisaNet.

Returns:

  • (String)


302
303
304
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 302

def 
  @source_account_type_details
end

#start_monthString

Month of the start of the Maestro (UK Domestic) card validity period. Do not include the field, even with a blank value, if the card is not a Maestro (UK Domestic) card. Format: MM. Possible values: 01 through 12. Note The start date is not required for Maestro (UK Domestic) transactions.

Returns:

  • (String)


360
361
362
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 360

def start_month
  @start_month
end

#start_yearString

Year of the start of the Maestro (UK Domestic) card validity period. Do not include the field, even with a blank value, if the card is not a Maestro (UK Domestic) card. Format: YYYY. Note The start date is not required for Maestro (UK Domestic) transactions.

Returns:

  • (String)


368
369
370
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 368

def start_year
  @start_year
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)


220
221
222
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 220

def type
  @type
end

#type_selection_indicatorString

Flag that identifies how the card type was selected. Possible values:

  • 0: Card type was selected based on default acquirer settings.
  • 1: Customer selected the card type.

Returns:

  • (String)


408
409
410
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 408

def type_selection_indicator
  @type_selection_indicator
end

#use_asString

Flag that specifies the type of account associated with the card. This field is available only for China UnionPay, Cielo, Comercio Latino and Visa Platform Connect. The cardholder provides this information during the payment process. This field is required for:

  • Debit transactions on Cielo and Comercio Latino.
  • Transactions with Brazilian-issued cards on Visa Acceptance through VisaNet. China UnionPayCard Transactions on China UnionPay: Possible values:
  • C: Domestic credit card
  • D: Domestic debit card
  • F: International credit card
  • I: International debit card When the value is D, the e-commerce indicator and CAVV fields must be included in the authorization request. When the value is C, F or I the card verification number, expiration month and expiration year fields must in included in the authorization request. Cielo and Comercio Latino Credit Card Transactions: On these processors, this field is supported only for authorizations. Possible values:
  • CR: Credit card
  • DB: Debit card
    Visa Platform Connect Credit Card Transactions: This field is supported for all card types on Visa Platform Connect. For combo card present transactions with Mastercard on Brazilian-issued cards, possible values:
  • CR: Credit card
  • DB: Debit Card For combo card not present transactions with Mastercard on Brazilian-issued cards, possible values:
  • C: Credit card
  • D: Debit card A value of CR or DB in the useAs field takes precedence over any value in the Source Account Type field.

Returns:

  • (String)


258
259
260
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 258

def use_as
  @use_as
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 492

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  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
  use_as = hash.key?('useAs') ? hash['useAs'] : SKIP
   =
    hash.key?('sourceAccountType') ? hash['sourceAccountType'] : SKIP
   =
    hash.key?('sourceAccountTypeDetails') ? hash['sourceAccountTypeDetails'] : SKIP
  security_code = hash.key?('securityCode') ? hash['securityCode'] : SKIP
  security_code_indicator =
    hash.key?('securityCodeIndicator') ? hash['securityCodeIndicator'] : SKIP
   =
    hash.key?('accountEncoderId') ? hash['accountEncoderId'] : SKIP
  issue_number = hash.key?('issueNumber') ? hash['issueNumber'] : SKIP
  start_month = hash.key?('startMonth') ? hash['startMonth'] : SKIP
  start_year = hash.key?('startYear') ? hash['startYear'] : SKIP
  product_name = hash.key?('productName') ? hash['productName'] : SKIP
  product_subtype =
    hash.key?('productSubtype') ? hash['productSubtype'] : SKIP
  type_selection_indicator =
    hash.key?('typeSelectionIndicator') ? hash['typeSelectionIndicator'] : 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.
  Card.new(number: number,
           expiration_month: expiration_month,
           expiration_year: expiration_year,
           type: type,
           use_as: use_as,
           source_account_type: ,
           source_account_type_details: ,
           security_code: security_code,
           security_code_indicator: security_code_indicator,
           account_encoder_id: ,
           issue_number: issue_number,
           start_month: start_month,
           start_year: start_year,
           product_name: product_name,
           product_subtype: product_subtype,
           type_selection_indicator: type_selection_indicator,
           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 411

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['number'] = 'number'
  @_hash['expiration_month'] = 'expirationMonth'
  @_hash['expiration_year'] = 'expirationYear'
  @_hash['type'] = 'type'
  @_hash['use_as'] = 'useAs'
  @_hash['source_account_type'] = 'sourceAccountType'
  @_hash['source_account_type_details'] = 'sourceAccountTypeDetails'
  @_hash['security_code'] = 'securityCode'
  @_hash['security_code_indicator'] = 'securityCodeIndicator'
  @_hash['account_encoder_id'] = 'accountEncoderId'
  @_hash['issue_number'] = 'issueNumber'
  @_hash['start_month'] = 'startMonth'
  @_hash['start_year'] = 'startYear'
  @_hash['product_name'] = 'productName'
  @_hash['product_subtype'] = 'productSubtype'
  @_hash['type_selection_indicator'] = 'typeSelectionIndicator'
  @_hash
end

.nullablesObject

An array for nullable fields



455
456
457
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 455

def self.nullables
  []
end

.optionalsObject

An array for optional fields



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 433

def self.optionals
  %w[
    number
    expiration_month
    expiration_year
    type
    use_as
    source_account_type
    source_account_type_details
    security_code
    security_code_indicator
    account_encoder_id
    issue_number
    start_month
    start_year
    product_name
    product_subtype
    type_selection_indicator
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



563
564
565
566
567
568
569
570
571
572
573
574
575
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 563

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} number: #{@number.inspect}, expiration_month: #{@expiration_month.inspect},"\
  " expiration_year: #{@expiration_year.inspect}, type: #{@type.inspect}, use_as:"\
  " #{@use_as.inspect}, source_account_type: #{@source_account_type.inspect},"\
  " source_account_type_details: #{@source_account_type_details.inspect}, security_code:"\
  " #{@security_code.inspect}, security_code_indicator: #{@security_code_indicator.inspect},"\
  " account_encoder_id: #{@account_encoder_id.inspect}, issue_number:"\
  " #{@issue_number.inspect}, start_month: #{@start_month.inspect}, start_year:"\
  " #{@start_year.inspect}, product_name: #{@product_name.inspect}, product_subtype:"\
  " #{@product_subtype.inspect}, type_selection_indicator:"\
  " #{@type_selection_indicator.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



549
550
551
552
553
554
555
556
557
558
559
560
# File 'lib/visa_acceptance_merged_spec/models/card.rb', line 549

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} number: #{@number}, expiration_month: #{@expiration_month},"\
  " expiration_year: #{@expiration_year}, type: #{@type}, use_as: #{@use_as},"\
  " source_account_type: #{@source_account_type}, source_account_type_details:"\
  " #{@source_account_type_details}, security_code: #{@security_code},"\
  " security_code_indicator: #{@security_code_indicator}, account_encoder_id:"\
  " #{@account_encoder_id}, issue_number: #{@issue_number}, start_month: #{@start_month},"\
  " start_year: #{@start_year}, product_name: #{@product_name}, product_subtype:"\
  " #{@product_subtype}, type_selection_indicator: #{@type_selection_indicator},"\
  " additional_properties: #{@additional_properties}>"
end