Class: CyberSourceMergedSpec::BuyerInformation37
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::BuyerInformation37
- Defined in:
- lib/cyber_source_merged_spec/models/buyer_information37.rb
Overview
Contains information about the buyer.
Instance Attribute Summary collapse
-
#date_of_birth ⇒ String
Recipient’s date of birth.
-
#hashed_password ⇒ String
The merchant's password that CyberSource hashes and stores as a hashed password.
-
#merchant_customer_id ⇒ String
Your identifier for the customer.
-
#personal_identification ⇒ Array[PersonalIdentification]
Recipient’s date of birth.
-
#username ⇒ String
Specifies the customer account user name.
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, username: SKIP, hashed_password: SKIP, date_of_birth: SKIP, personal_identification: SKIP, additional_properties: nil) ⇒ BuyerInformation37
constructor
A new instance of BuyerInformation37.
-
#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, username: SKIP, hashed_password: SKIP, date_of_birth: SKIP, personal_identification: SKIP, additional_properties: nil) ⇒ BuyerInformation37
Returns a new instance of BuyerInformation37.
91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 91 def initialize(merchant_customer_id: SKIP, username: SKIP, hashed_password: SKIP, date_of_birth: 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 @username = username unless username == SKIP @hashed_password = hashed_password unless hashed_password == SKIP @date_of_birth = date_of_birth unless date_of_birth == 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.
52 53 54 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 52 def date_of_birth @date_of_birth end |
#hashed_password ⇒ String
The merchant's password that CyberSource hashes and stores as a hashed password.
42 43 44 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 42 def hashed_password @hashed_password 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_information37.rb', line 33 def merchant_customer_id @merchant_customer_id end |
#personal_identification ⇒ Array[PersonalIdentification]
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.
62 63 64 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 62 def personal_identification @personal_identification end |
#username ⇒ String
Specifies the customer account user name.
37 38 39 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 37 def username @username end |
Class Method Details
.from_element(root) ⇒ Object
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 143 def self.from_element(root) merchant_customer_id = XmlUtilities.from_element(root, 'merchantCustomerId', String) username = XmlUtilities.from_element(root, 'username', String) hashed_password = XmlUtilities.from_element(root, 'hashedPassword', String) date_of_birth = XmlUtilities.from_element(root, 'dateOfBirth', String) personal_identification = XmlUtilities.from_element_to_array( root, 'PersonalIdentification', PersonalIdentification ) new(merchant_customer_id: merchant_customer_id, username: username, hashed_password: hashed_password, date_of_birth: date_of_birth, personal_identification: personal_identification, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
106 107 108 109 110 111 112 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 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 106 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. merchant_customer_id = hash.key?('merchantCustomerId') ? hash['merchantCustomerId'] : SKIP username = hash.key?('username') ? hash['username'] : SKIP hashed_password = hash.key?('hashedPassword') ? hash['hashedPassword'] : SKIP date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : 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 << (PersonalIdentification.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. BuyerInformation37.new(merchant_customer_id: merchant_customer_id, username: username, hashed_password: hashed_password, date_of_birth: date_of_birth, personal_identification: personal_identification, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
65 66 67 68 69 70 71 72 73 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 65 def self.names @_hash = {} if @_hash.nil? @_hash['merchant_customer_id'] = 'merchantCustomerId' @_hash['username'] = 'username' @_hash['hashed_password'] = 'hashedPassword' @_hash['date_of_birth'] = 'dateOfBirth' @_hash['personal_identification'] = 'personalIdentification' @_hash end |
.nullables ⇒ Object
An array for nullable fields
87 88 89 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 87 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
76 77 78 79 80 81 82 83 84 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 76 def self.optionals %w[ merchant_customer_id username hashed_password date_of_birth personal_identification ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
190 191 192 193 194 195 196 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 190 def inspect class_name = self.class.name.split('::').last "<#{class_name} merchant_customer_id: #{@merchant_customer_id.inspect}, username:"\ " #{@username.inspect}, hashed_password: #{@hashed_password.inspect}, date_of_birth:"\ " #{@date_of_birth.inspect}, personal_identification: #{@personal_identification.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
181 182 183 184 185 186 187 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 181 def to_s class_name = self.class.name.split('::').last "<#{class_name} merchant_customer_id: #{@merchant_customer_id}, username: #{@username},"\ " hashed_password: #{@hashed_password}, date_of_birth: #{@date_of_birth},"\ " personal_identification: #{@personal_identification}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/cyber_source_merged_spec/models/buyer_information37.rb', line 163 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, 'username', username) XmlUtilities.add_as_subelement(doc, root, 'hashedPassword', hashed_password) XmlUtilities.add_as_subelement(doc, root, 'dateOfBirth', date_of_birth) XmlUtilities.add_array_as_subelement(doc, root, 'PersonalIdentification', personal_identification) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |