Class: CyberSourceMergedSpec::BuyerInformation2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::BuyerInformation2
- Defined in:
- lib/cyber_source_merged_spec/models/buyer_information2.rb
Overview
BuyerInformation2 Model.
Instance Attribute Summary collapse
-
#date_of_birth ⇒ String
Recipient’s date of birth.
-
#gender ⇒ String
Customer's gender.
-
#language ⇒ String
language setting of the user.
-
#merchant_customer_id ⇒ String
Your identifier for the customer.
-
#personal_identification ⇒ Array[PersonalIdentification2]
language setting of the user.
-
#vat_registration_number ⇒ String
Customer’s government-assigned tax identification number.
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(merchant_customer_id: SKIP, vat_registration_number: SKIP, date_of_birth: SKIP, gender: SKIP, language: SKIP, personal_identification: SKIP, additional_properties: nil) ⇒ BuyerInformation2
constructor
A new instance of BuyerInformation2.
-
#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(merchant_customer_id: SKIP, vat_registration_number: SKIP, date_of_birth: SKIP, gender: SKIP, language: SKIP, personal_identification: SKIP, additional_properties: nil) ⇒ BuyerInformation2
Returns a new instance of BuyerInformation2.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 97 def initialize(merchant_customer_id: SKIP, vat_registration_number: SKIP, date_of_birth: SKIP, gender: SKIP, language: SKIP, personal_identification: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @merchant_customer_id = merchant_customer_id unless merchant_customer_id == SKIP @vat_registration_number = vat_registration_number unless vat_registration_number == SKIP @date_of_birth = date_of_birth unless date_of_birth == SKIP @gender = gender unless gender == SKIP @language = language unless language == SKIP @personal_identification = personal_identification unless personal_identification == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#date_of_birth ⇒ String
Recipient’s date of birth. Format: YYYYMMDD.
This field is a pass-through, which means that CyberSource ensures that
the value is eight numeric characters
but otherwise does not verify the value or modify it in any way before
sending it to the processor. If the field
is not required for the transaction, CyberSource does not forward it to
the processor.
50 51 52 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 50 def date_of_birth @date_of_birth end |
#gender ⇒ String
Customer's gender. Possible values are F (female), M (male),O (other).
54 55 56 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 54 def gender @gender end |
#language ⇒ String
language setting of the user. Supports 2-character language codes (e.g., en, fr) and 5-character locale values (e.g., en-US, fr-CA).
60 61 62 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 60 def language @language end |
#merchant_customer_id ⇒ String
Your identifier for the customer. When a subscription or customer profile is being created, the maximum length for this field for most processors is 30. Otherwise, the maximum length is 100.
Comercio Latino
For recurring payments in Mexico, the value is the customer’s contract number. Note Before you request the authorization, you must inform the issuer of the customer contract numbers that will be used for recurring transactions.
Worldpay VAP
For a follow-on credit with Worldpay VAP, CyberSource checks the following locations, in the order given, for a customer account ID value and uses the first value it finds:
customer_account_idvalue in the follow-on credit request- Customer account ID value that was used for the capture that is being credited
- Customer account ID value that was used for the original authorization If a customer account ID value cannot be found in any of these locations, then no value is used.
33 34 35 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 33 def merchant_customer_id @merchant_customer_id end |
#personal_identification ⇒ Array[PersonalIdentification2]
language setting of the user. Supports 2-character language codes (e.g., en, fr) and 5-character locale values (e.g., en-US, fr-CA).
66 67 68 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 66 def personal_identification @personal_identification end |
#vat_registration_number ⇒ String
Customer’s government-assigned tax identification number.
Tax Calculation
Optional for international and value added taxes only. Not applicable to U.S. and Canadian taxes.
40 41 42 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 40 def vat_registration_number @vat_registration_number end |
Class Method Details
.from_element(root) ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 152 def self.from_element(root) merchant_customer_id = XmlUtilities.from_element(root, 'merchantCustomerId', String) vat_registration_number = XmlUtilities.from_element( root, 'vatRegistrationNumber', String ) date_of_birth = XmlUtilities.from_element(root, 'dateOfBirth', String) gender = XmlUtilities.from_element(root, 'gender', String) language = XmlUtilities.from_element(root, 'language', String) personal_identification = XmlUtilities.from_element_to_array( root, 'PersonalIdentification2', PersonalIdentification2 ) new(merchant_customer_id: merchant_customer_id, vat_registration_number: vat_registration_number, date_of_birth: date_of_birth, gender: gender, language: language, personal_identification: personal_identification, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 113 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. merchant_customer_id = hash.key?('merchantCustomerId') ? hash['merchantCustomerId'] : SKIP vat_registration_number = hash.key?('vatRegistrationNumber') ? hash['vatRegistrationNumber'] : SKIP date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : SKIP gender = hash.key?('gender') ? hash['gender'] : SKIP language = hash.key?('language') ? hash['language'] : SKIP # Parameter is an array, so we need to iterate through it personal_identification = nil unless hash['personalIdentification'].nil? personal_identification = [] hash['personalIdentification'].each do |structure| personal_identification << (PersonalIdentification2.from_hash(structure) if structure) end end personal_identification = SKIP unless hash.key?('personalIdentification') # 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. BuyerInformation2.new(merchant_customer_id: merchant_customer_id, vat_registration_number: vat_registration_number, date_of_birth: date_of_birth, gender: gender, language: language, personal_identification: personal_identification, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 69 def self.names @_hash = {} if @_hash.nil? @_hash['merchant_customer_id'] = 'merchantCustomerId' @_hash['vat_registration_number'] = 'vatRegistrationNumber' @_hash['date_of_birth'] = 'dateOfBirth' @_hash['gender'] = 'gender' @_hash['language'] = 'language' @_hash['personal_identification'] = 'personalIdentification' @_hash end |
.nullables ⇒ Object
An array for nullable fields
93 94 95 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 93 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 81 def self.optionals %w[ merchant_customer_id vat_registration_number date_of_birth gender language personal_identification ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
203 204 205 206 207 208 209 210 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 203 def inspect class_name = self.class.name.split('::').last "<#{class_name} merchant_customer_id: #{@merchant_customer_id.inspect},"\ " vat_registration_number: #{@vat_registration_number.inspect}, date_of_birth:"\ " #{@date_of_birth.inspect}, gender: #{@gender.inspect}, language: #{@language.inspect},"\ " personal_identification: #{@personal_identification.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
194 195 196 197 198 199 200 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 194 def to_s class_name = self.class.name.split('::').last "<#{class_name} merchant_customer_id: #{@merchant_customer_id}, vat_registration_number:"\ " #{@vat_registration_number}, date_of_birth: #{@date_of_birth}, gender: #{@gender},"\ " language: #{@language}, personal_identification: #{@personal_identification},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/cyber_source_merged_spec/models/buyer_information2.rb', line 175 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'merchantCustomerId', merchant_customer_id) XmlUtilities.add_as_subelement(doc, root, 'vatRegistrationNumber', vat_registration_number) XmlUtilities.add_as_subelement(doc, root, 'dateOfBirth', date_of_birth) XmlUtilities.add_as_subelement(doc, root, 'gender', gender) XmlUtilities.add_as_subelement(doc, root, 'language', language) XmlUtilities.add_array_as_subelement(doc, root, 'PersonalIdentification2', personal_identification) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |