Class: CyberSourceMergedSpec::SenderInformation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::SenderInformation
- Defined in:
- lib/cyber_source_merged_spec/models/sender_information.rb
Overview
SenderInformation Model.
Instance Attribute Summary collapse
-
#account ⇒ Account1
This field is applicable for AFT transactions.
-
#address1 ⇒ String
The street address of the sender.
-
#administrative_area ⇒ String
The state or province of the sender.
-
#alias_name ⇒ String
Sender's alias name.
-
#country_code ⇒ String
The country associated with the address of the sender.
-
#first_name ⇒ String
First name of the sender.
-
#last_name ⇒ String
Last name of the sender.
-
#locality ⇒ String
The city or locality of the sender.
-
#middle_name ⇒ String
Middle name of the sender.
-
#postal_code ⇒ String
Postal code of sender.
-
#reference_number ⇒ String
This field is applicable for AFT transactions.
-
#tax_id_number ⇒ Float
CPF or CNPJ of the cash-in recipient.
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(first_name: SKIP, middle_name: SKIP, last_name: SKIP, address1: SKIP, locality: SKIP, administrative_area: SKIP, country_code: SKIP, alias_name: SKIP, reference_number: SKIP, account: SKIP, postal_code: SKIP, tax_id_number: SKIP, additional_properties: nil) ⇒ SenderInformation
constructor
A new instance of SenderInformation.
-
#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(first_name: SKIP, middle_name: SKIP, last_name: SKIP, address1: SKIP, locality: SKIP, administrative_area: SKIP, country_code: SKIP, alias_name: SKIP, reference_number: SKIP, account: SKIP, postal_code: SKIP, tax_id_number: SKIP, additional_properties: nil) ⇒ SenderInformation
Returns a new instance of SenderInformation.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 138 def initialize(first_name: SKIP, middle_name: SKIP, last_name: SKIP, address1: SKIP, locality: SKIP, administrative_area: SKIP, country_code: SKIP, alias_name: SKIP, reference_number: SKIP, account: SKIP, postal_code: SKIP, tax_id_number: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @first_name = first_name unless first_name == SKIP @middle_name = middle_name unless middle_name == SKIP @last_name = last_name unless last_name == SKIP @address1 = address1 unless address1 == SKIP @locality = locality unless locality == SKIP @administrative_area = administrative_area unless administrative_area == SKIP @country_code = country_code unless country_code == SKIP @alias_name = alias_name unless alias_name == SKIP @reference_number = reference_number unless reference_number == SKIP @account = account unless account == SKIP @postal_code = postal_code unless postal_code == SKIP @tax_id_number = tax_id_number unless tax_id_number == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account ⇒ Account1
This field is applicable for AFT transactions. Contains a transaction reference number provided by the Merchant. Only alpha numeric values are supported.
83 84 85 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 83 def account @account end |
#address1 ⇒ String
The street address of the sender. This field is applicable for AFT transactions.
Only alpha numeric values are supported. Special characters not in the standard ASCII character set are not supported and will be stripped before being sent to sent to the processor.
43 44 45 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 43 def address1 @address1 end |
#administrative_area ⇒ String
The state or province of the sender. This field is applicable for AFT transactions when the sender country is US or CA. Else it is optional. Must be a two character value
58 59 60 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 58 def administrative_area @administrative_area end |
#alias_name ⇒ String
Sender's alias name.
71 72 73 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 71 def alias_name @alias_name end |
#country_code ⇒ String
The country associated with the address of the sender. This field is applicable for AFT transactions. Must be a two character ISO country code. For example, see [ISO Country Code](https://developer.cybersource.com/docs/cybs/en-us/country-codes/refe rence/all/na/country-codes/country-codes.html)
67 68 69 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 67 def country_code @country_code end |
#first_name ⇒ String
First name of the sender. This field is applicable for AFT and OCT transactions. Only alpha numeric values are supported.Special characters not in the standard ASCII character set, are not supported and will be stripped before being sent to the processor.
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 18 def first_name @first_name end |
#last_name ⇒ String
Last name of the sender. This field is applicable for AFT and OCT transactions. Only alpha numeric values are supported. Special characters not in the standard ASCII character set, are not supported and will be stripped before being sent to sent to the processor.
34 35 36 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 34 def last_name @last_name end |
#locality ⇒ String
The city or locality of the sender. This field is applicable for AFT transactions. Only alpha numeric values are supported. Special characters not in the standard ASCII character set are not supported and will be stripped before being sent to sent to the processor.
51 52 53 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 51 def locality @locality end |
#middle_name ⇒ String
Middle name of the sender. This field is applicable for AFT and OCT transactions. Only alpha numeric values are supported. Special characters not in the standard ASCII character set, are not supported and will be stripped before being sent to sent to the processor.
26 27 28 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 26 def middle_name @middle_name end |
#postal_code ⇒ String
Postal code of sender.
87 88 89 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 87 def postal_code @postal_code end |
#reference_number ⇒ String
This field is applicable for AFT transactions. Contains a transaction reference number provided by the Merchant. Only alpha numeric values are supported.
77 78 79 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 77 def reference_number @reference_number end |
#tax_id_number ⇒ Float
CPF or CNPJ of the cash-in recipient. "Cadastro de Pessoas FĂsicas", which translates to the "Natural Persons Register." It is the individual taxpayer registry identification number in Brazil, similar to a Social Security Number (SSN) in the United States or a National Insurance Number in the UK.
95 96 97 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 95 def tax_id_number @tax_id_number end |
Class Method Details
.from_element(root) ⇒ Object
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 204 def self.from_element(root) first_name = XmlUtilities.from_element(root, 'firstName', String) middle_name = XmlUtilities.from_element(root, 'middleName', String) last_name = XmlUtilities.from_element(root, 'lastName', String) address1 = XmlUtilities.from_element(root, 'address1', String) locality = XmlUtilities.from_element(root, 'locality', String) administrative_area = XmlUtilities.from_element(root, 'administrativeArea', String) country_code = XmlUtilities.from_element(root, 'countryCode', String) alias_name = XmlUtilities.from_element(root, 'aliasName', String) reference_number = XmlUtilities.from_element(root, 'referenceNumber', String) account = XmlUtilities.from_element(root, 'Account1', Account1) postal_code = XmlUtilities.from_element(root, 'postalCode', String) tax_id_number = XmlUtilities.from_element(root, 'taxIdNumber', Float) new(first_name: first_name, middle_name: middle_name, last_name: last_name, address1: address1, locality: locality, administrative_area: administrative_area, country_code: country_code, alias_name: alias_name, reference_number: reference_number, account: account, postal_code: postal_code, tax_id_number: tax_id_number, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 162 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. first_name = hash.key?('firstName') ? hash['firstName'] : SKIP middle_name = hash.key?('middleName') ? hash['middleName'] : SKIP last_name = hash.key?('lastName') ? hash['lastName'] : SKIP address1 = hash.key?('address1') ? hash['address1'] : SKIP locality = hash.key?('locality') ? hash['locality'] : SKIP administrative_area = hash.key?('administrativeArea') ? hash['administrativeArea'] : SKIP country_code = hash.key?('countryCode') ? hash['countryCode'] : SKIP alias_name = hash.key?('aliasName') ? hash['aliasName'] : SKIP reference_number = hash.key?('referenceNumber') ? hash['referenceNumber'] : SKIP account = Account1.from_hash(hash['account']) if hash['account'] postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP tax_id_number = hash.key?('taxIdNumber') ? hash['taxIdNumber'] : 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. SenderInformation.new(first_name: first_name, middle_name: middle_name, last_name: last_name, address1: address1, locality: locality, administrative_area: administrative_area, country_code: country_code, alias_name: alias_name, reference_number: reference_number, account: account, postal_code: postal_code, tax_id_number: tax_id_number, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 98 def self.names @_hash = {} if @_hash.nil? @_hash['first_name'] = 'firstName' @_hash['middle_name'] = 'middleName' @_hash['last_name'] = 'lastName' @_hash['address1'] = 'address1' @_hash['locality'] = 'locality' @_hash['administrative_area'] = 'administrativeArea' @_hash['country_code'] = 'countryCode' @_hash['alias_name'] = 'aliasName' @_hash['reference_number'] = 'referenceNumber' @_hash['account'] = 'account' @_hash['postal_code'] = 'postalCode' @_hash['tax_id_number'] = 'taxIdNumber' @_hash end |
.nullables ⇒ Object
An array for nullable fields
134 135 136 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 134 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 116 def self.optionals %w[ first_name middle_name last_name address1 locality administrative_area country_code alias_name reference_number account postal_code tax_id_number ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
271 272 273 274 275 276 277 278 279 280 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 271 def inspect class_name = self.class.name.split('::').last "<#{class_name} first_name: #{@first_name.inspect}, middle_name: #{@middle_name.inspect},"\ " last_name: #{@last_name.inspect}, address1: #{@address1.inspect}, locality:"\ " #{@locality.inspect}, administrative_area: #{@administrative_area.inspect}, country_code:"\ " #{@country_code.inspect}, alias_name: #{@alias_name.inspect}, reference_number:"\ " #{@reference_number.inspect}, account: #{@account.inspect}, postal_code:"\ " #{@postal_code.inspect}, tax_id_number: #{@tax_id_number.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
260 261 262 263 264 265 266 267 268 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 260 def to_s class_name = self.class.name.split('::').last "<#{class_name} first_name: #{@first_name}, middle_name: #{@middle_name}, last_name:"\ " #{@last_name}, address1: #{@address1}, locality: #{@locality}, administrative_area:"\ " #{@administrative_area}, country_code: #{@country_code}, alias_name: #{@alias_name},"\ " reference_number: #{@reference_number}, account: #{@account}, postal_code:"\ " #{@postal_code}, tax_id_number: #{@tax_id_number}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/cyber_source_merged_spec/models/sender_information.rb', line 236 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'firstName', first_name) XmlUtilities.add_as_subelement(doc, root, 'middleName', middle_name) XmlUtilities.add_as_subelement(doc, root, 'lastName', last_name) XmlUtilities.add_as_subelement(doc, root, 'address1', address1) XmlUtilities.add_as_subelement(doc, root, 'locality', locality) XmlUtilities.add_as_subelement(doc, root, 'administrativeArea', administrative_area) XmlUtilities.add_as_subelement(doc, root, 'countryCode', country_code) XmlUtilities.add_as_subelement(doc, root, 'aliasName', alias_name) XmlUtilities.add_as_subelement(doc, root, 'referenceNumber', reference_number) XmlUtilities.add_as_subelement(doc, root, 'Account1', account) XmlUtilities.add_as_subelement(doc, root, 'postalCode', postal_code) XmlUtilities.add_as_subelement(doc, root, 'taxIdNumber', tax_id_number) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |