Class: VisaAcceptanceMergedSpec::Card3

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

Overview

Card3 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(source_account_type: SKIP, source_account_type_details: SKIP, additional_properties: nil) ⇒ Card3

Returns a new instance of Card3.



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/visa_acceptance_merged_spec/models/card3.rb', line 77

def initialize(source_account_type: SKIP, source_account_type_details: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @source_account_type =  unless  == SKIP
  unless  == SKIP
    @source_account_type_details =
      
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#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)


38
39
40
# File 'lib/visa_acceptance_merged_spec/models/card3.rb', line 38

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)


54
55
56
# File 'lib/visa_acceptance_merged_spec/models/card3.rb', line 54

def 
  @source_account_type_details
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/visa_acceptance_merged_spec/models/card3.rb', line 91

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   =
    hash.key?('sourceAccountType') ? hash['sourceAccountType'] : SKIP
   =
    hash.key?('sourceAccountTypeDetails') ? hash['sourceAccountTypeDetails'] : 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.
  Card3.new(source_account_type: ,
            source_account_type_details: ,
            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
# File 'lib/visa_acceptance_merged_spec/models/card3.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['source_account_type'] = 'sourceAccountType'
  @_hash['source_account_type_details'] = 'sourceAccountTypeDetails'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/visa_acceptance_merged_spec/models/card3.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



65
66
67
68
69
70
# File 'lib/visa_acceptance_merged_spec/models/card3.rb', line 65

def self.optionals
  %w[
    source_account_type
    source_account_type_details
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



121
122
123
124
125
126
# File 'lib/visa_acceptance_merged_spec/models/card3.rb', line 121

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} source_account_type: #{@source_account_type.inspect},"\
  " source_account_type_details: #{@source_account_type_details.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



114
115
116
117
118
# File 'lib/visa_acceptance_merged_spec/models/card3.rb', line 114

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} source_account_type: #{@source_account_type}, source_account_type_details:"\
  " #{@source_account_type_details}, additional_properties: #{@additional_properties}>"
end