Class: CyberSourceMergedSpec::Card3
- Defined in:
- lib/cyber_source_merged_spec/models/card3.rb
Overview
Card3 Model.
Instance Attribute Summary collapse
-
#source_account_type ⇒ String
Flag that specifies the type of account associated with the card.
-
#source_account_type_details ⇒ String
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).
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(source_account_type: SKIP, source_account_type_details: SKIP, additional_properties: nil) ⇒ Card3
constructor
A new instance of Card3.
-
#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(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/cyber_source_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 = source_account_type unless source_account_type == SKIP unless source_account_type_details == SKIP @source_account_type_details = source_account_type_details end @additional_properties = additional_properties end |
Instance Attribute Details
#source_account_type ⇒ String
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 CyberSource through
VisaNet.
- Applicable only for CyberSource 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. CyberSource strongly recommends that you include this field for combo card transactions. Possible values include the following.
CH: Checking accountCR: Credit card accountSA: Saving accountLI: Line of credit or credit portion of combo cardPP: Prepaid card account or prepaid portion of combo cardUA: 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.
38 39 40 |
# File 'lib/cyber_source_merged_spec/models/card3.rb', line 38 def source_account_type @source_account_type end |
#source_account_type_details ⇒ String
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 CusteioAGRE: Visa Agro ElectronAGRI: Visa Agro InvestimentoAGRO: Visa Agro Possible values for prepaid card:VVA: Visa Vale AlimentacaoVVF: Visa Vale FlexVVR: Visa Vale Refeicao This field is supported only for combo card transactions in Brazil on CyberSource through VisaNet.
54 55 56 |
# File 'lib/cyber_source_merged_spec/models/card3.rb', line 54 def source_account_type_details @source_account_type_details end |
Class Method Details
.from_element(root) ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/cyber_source_merged_spec/models/card3.rb', line 113 def self.from_element(root) source_account_type = XmlUtilities.from_element(root, 'sourceAccountType', String) source_account_type_details = XmlUtilities.from_element( root, 'sourceAccountTypeDetails', String ) new(source_account_type: source_account_type, source_account_type_details: source_account_type_details, additional_properties: additional_properties) end |
.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/cyber_source_merged_spec/models/card3.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. source_account_type = hash.key?('sourceAccountType') ? hash['sourceAccountType'] : SKIP source_account_type_details = 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, source_account_type_details: source_account_type_details, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
57 58 59 60 61 62 |
# File 'lib/cyber_source_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 |
.nullables ⇒ Object
An array for nullable fields
73 74 75 |
# File 'lib/cyber_source_merged_spec/models/card3.rb', line 73 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
65 66 67 68 69 70 |
# File 'lib/cyber_source_merged_spec/models/card3.rb', line 65 def self.optionals %w[ source_account_type source_account_type_details ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
146 147 148 149 150 151 |
# File 'lib/cyber_source_merged_spec/models/card3.rb', line 146 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_s ⇒ Object
Provides a human-readable string representation of the object.
139 140 141 142 143 |
# File 'lib/cyber_source_merged_spec/models/card3.rb', line 139 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 |
#to_xml_element(doc, root_name) ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/cyber_source_merged_spec/models/card3.rb', line 125 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'sourceAccountType', source_account_type) XmlUtilities.add_as_subelement(doc, root, 'sourceAccountTypeDetails', source_account_type_details) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |