Class: VisaAcceptanceMergedSpec::RecipientInformation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::RecipientInformation
- Defined in:
- lib/visa_acceptance_merged_spec/models/recipient_information.rb
Overview
RecipientInformation Model.
Instance Attribute Summary collapse
-
#account_id ⇒ String
Identifier for the recipient’s account.
-
#account_type ⇒ String
Identifies the recipient’s account type.
-
#address1 ⇒ String
The street address of the recipient This field is applicable for AFT and OCT transactions.
-
#administrative_area ⇒ String
The state or province of the recipient.
-
#alias_name ⇒ String
Account owner alias name.
-
#beneficiary_address ⇒ String
Only for e-wallets: The ultimate beneficiary’s street address (street, zip code, city), excluding the country.
-
#beneficiary_id ⇒ String
Only for e-wallets: ID, username, hash or anything uniquely identifying the ultimate beneficiary.
-
#beneficiary_name ⇒ String
Only for e-wallets: The ultimate beneficiary’s full name.
-
#country ⇒ String
The country associated with the address of the recipient.
-
#country_of_birth ⇒ String
Account Owner Country of Birth.
-
#date_of_birth ⇒ String
Recipient’s date of birth.
-
#email ⇒ String
Account Owner email address.
-
#first_name ⇒ String
First name of the recipient.
-
#last_name ⇒ String
Last name of the recipient.
-
#locality ⇒ String
The city of the recipient.
-
#middle_name ⇒ String
Middle name of the recipient.
-
#nationality ⇒ String
Account Owner Nationality.
-
#occupation ⇒ String
Account Owner Occupation.
-
#postal_code ⇒ String
Partial postal code for the recipient’s address.
Class Method Summary collapse
-
.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(account_id: SKIP, account_type: SKIP, first_name: SKIP, middle_name: SKIP, last_name: SKIP, address1: SKIP, administrative_area: SKIP, postal_code: SKIP, country: SKIP, date_of_birth: SKIP, beneficiary_id: SKIP, beneficiary_name: SKIP, beneficiary_address: SKIP, alias_name: SKIP, nationality: SKIP, country_of_birth: SKIP, occupation: SKIP, email: SKIP, locality: SKIP, additional_properties: nil) ⇒ RecipientInformation
constructor
A new instance of RecipientInformation.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the 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(account_id: SKIP, account_type: SKIP, first_name: SKIP, middle_name: SKIP, last_name: SKIP, address1: SKIP, administrative_area: SKIP, postal_code: SKIP, country: SKIP, date_of_birth: SKIP, beneficiary_id: SKIP, beneficiary_name: SKIP, beneficiary_address: SKIP, alias_name: SKIP, nationality: SKIP, country_of_birth: SKIP, occupation: SKIP, email: SKIP, locality: SKIP, additional_properties: nil) ⇒ RecipientInformation
Returns a new instance of RecipientInformation.
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 194 def initialize(account_id: SKIP, account_type: SKIP, first_name: SKIP, middle_name: SKIP, last_name: SKIP, address1: SKIP, administrative_area: SKIP, postal_code: SKIP, country: SKIP, date_of_birth: SKIP, beneficiary_id: SKIP, beneficiary_name: SKIP, beneficiary_address: SKIP, alias_name: SKIP, nationality: SKIP, country_of_birth: SKIP, occupation: SKIP, email: SKIP, locality: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_id = account_id unless account_id == SKIP @account_type = account_type unless account_type == SKIP @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 @administrative_area = administrative_area unless administrative_area == SKIP @postal_code = postal_code unless postal_code == SKIP @country = country unless country == SKIP @date_of_birth = date_of_birth unless date_of_birth == SKIP @beneficiary_id = beneficiary_id unless beneficiary_id == SKIP @beneficiary_name = beneficiary_name unless beneficiary_name == SKIP @beneficiary_address = beneficiary_address unless beneficiary_address == SKIP @alias_name = alias_name unless alias_name == SKIP @nationality = nationality unless nationality == SKIP @country_of_birth = country_of_birth unless country_of_birth == SKIP @occupation = occupation unless occupation == SKIP @email = email unless email == SKIP @locality = locality unless locality == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
Identifier for the recipient’s account. This field is applicable for AFT transactions.
15 16 17 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 15 def account_id @account_id end |
#account_type ⇒ String
Identifies the recipient’s account type. This field is applicable for AFT transactions. Valid values are:
- `00` for Other
- `01` for Routing Transit Number (RTN) + Bank Account Number (BAN)
- `02` for International Bank Account Number (IBAN)
- `03` for Card Account
- `06` for Bank Account Number (BAN) + Bank Identification Code (BIC),
also known as a SWIFT code
27 28 29 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 27 def account_type @account_type end |
#address1 ⇒ String
The street address of the recipient 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.
59 60 61 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 59 def address1 @address1 end |
#administrative_area ⇒ String
The state or province of the recipient. This field is applicable for AFT transactions when the recipient country is US or CA. Else it is optional. Must be a two character value
66 67 68 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 66 def administrative_area @administrative_area end |
#alias_name ⇒ String
Account owner alias name.
113 114 115 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 113 def alias_name @alias_name end |
#beneficiary_address ⇒ String
Only for e-wallets: The ultimate beneficiary’s street address (street, zip code, city), excluding the country. Example: “Main street 1, 12345, Barcelona
109 110 111 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 109 def beneficiary_address @beneficiary_address end |
#beneficiary_id ⇒ String
Only for e-wallets: ID, username, hash or anything uniquely identifying the ultimate beneficiary.
99 100 101 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 99 def beneficiary_id @beneficiary_id end |
#beneficiary_name ⇒ String
Only for e-wallets: The ultimate beneficiary’s full name.
103 104 105 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 103 def beneficiary_name @beneficiary_name end |
#country ⇒ String
The country associated with the address of the recipient. This field is applicable for AFT and OCT transactions. Must be a two character ISO country code. For example, see [ISO Country Code](
84 85 86 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 84 def country @country end |
#country_of_birth ⇒ String
Account Owner Country of Birth
121 122 123 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 121 def country_of_birth @country_of_birth end |
#date_of_birth ⇒ String
Recipient’s date of birth. Format: YYYYMMDD.
This field is a pass-through, which means that Visa Acceptance 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, Visa Acceptance does not forward it
to the processor.
94 95 96 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 94 def date_of_birth @date_of_birth end |
#email ⇒ String
Account Owner email address
129 130 131 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 129 def email @email end |
#first_name ⇒ String
First name of the recipient.
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.
35 36 37 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 35 def first_name @first_name end |
#last_name ⇒ String
Last name of the recipient. 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/visa_acceptance_merged_spec/models/recipient_information.rb', line 51 def last_name @last_name end |
#locality ⇒ String
The city of the recipient. 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.
137 138 139 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 137 def locality @locality end |
#middle_name ⇒ String
Middle name of the recipient. 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/visa_acceptance_merged_spec/models/recipient_information.rb', line 43 def middle_name @middle_name end |
#nationality ⇒ String
Account Owner Nationality
117 118 119 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 117 def nationality @nationality end |
#occupation ⇒ String
Account Owner Occupation
125 126 127 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 125 def occupation @occupation end |
#postal_code ⇒ String
Partial postal code for the recipient’s address. For example, if the postal code is NN5 7SG, the value for this field should be the first part of the postal code: NN5. This field is a pass-through, which means that Visa Acceptance 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, Visa Acceptance does not forward it to the processor.
77 78 79 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 77 def postal_code @postal_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 228 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('accountId') ? hash['accountId'] : SKIP account_type = hash.key?('accountType') ? hash['accountType'] : SKIP 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 administrative_area = hash.key?('administrativeArea') ? hash['administrativeArea'] : SKIP postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP country = hash.key?('country') ? hash['country'] : SKIP date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : SKIP beneficiary_id = hash.key?('beneficiaryId') ? hash['beneficiaryId'] : SKIP beneficiary_name = hash.key?('beneficiaryName') ? hash['beneficiaryName'] : SKIP beneficiary_address = hash.key?('beneficiaryAddress') ? hash['beneficiaryAddress'] : SKIP alias_name = hash.key?('aliasName') ? hash['aliasName'] : SKIP nationality = hash.key?('nationality') ? hash['nationality'] : SKIP country_of_birth = hash.key?('countryOfBirth') ? hash['countryOfBirth'] : SKIP occupation = hash.key?('occupation') ? hash['occupation'] : SKIP email = hash.key?('email') ? hash['email'] : SKIP locality = hash.key?('locality') ? hash['locality'] : 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. RecipientInformation.new(account_id: account_id, account_type: account_type, first_name: first_name, middle_name: middle_name, last_name: last_name, address1: address1, administrative_area: administrative_area, postal_code: postal_code, country: country, date_of_birth: date_of_birth, beneficiary_id: beneficiary_id, beneficiary_name: beneficiary_name, beneficiary_address: beneficiary_address, alias_name: alias_name, nationality: nationality, country_of_birth: country_of_birth, occupation: occupation, email: email, locality: locality, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 140 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'accountId' @_hash['account_type'] = 'accountType' @_hash['first_name'] = 'firstName' @_hash['middle_name'] = 'middleName' @_hash['last_name'] = 'lastName' @_hash['address1'] = 'address1' @_hash['administrative_area'] = 'administrativeArea' @_hash['postal_code'] = 'postalCode' @_hash['country'] = 'country' @_hash['date_of_birth'] = 'dateOfBirth' @_hash['beneficiary_id'] = 'beneficiaryId' @_hash['beneficiary_name'] = 'beneficiaryName' @_hash['beneficiary_address'] = 'beneficiaryAddress' @_hash['alias_name'] = 'aliasName' @_hash['nationality'] = 'nationality' @_hash['country_of_birth'] = 'countryOfBirth' @_hash['occupation'] = 'occupation' @_hash['email'] = 'email' @_hash['locality'] = 'locality' @_hash end |
.nullables ⇒ Object
An array for nullable fields
190 191 192 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 190 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 165 def self.optionals %w[ account_id account_type first_name middle_name last_name address1 administrative_area postal_code country date_of_birth beneficiary_id beneficiary_name beneficiary_address alias_name nationality country_of_birth occupation email locality ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 300 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, account_type: #{@account_type.inspect},"\ " first_name: #{@first_name.inspect}, middle_name: #{@middle_name.inspect}, last_name:"\ " #{@last_name.inspect}, address1: #{@address1.inspect}, administrative_area:"\ " #{@administrative_area.inspect}, postal_code: #{@postal_code.inspect}, country:"\ " #{@country.inspect}, date_of_birth: #{@date_of_birth.inspect}, beneficiary_id:"\ " #{@beneficiary_id.inspect}, beneficiary_name: #{@beneficiary_name.inspect},"\ " beneficiary_address: #{@beneficiary_address.inspect}, alias_name: #{@alias_name.inspect},"\ " nationality: #{@nationality.inspect}, country_of_birth: #{@country_of_birth.inspect},"\ " occupation: #{@occupation.inspect}, email: #{@email.inspect}, locality:"\ " #{@locality.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/visa_acceptance_merged_spec/models/recipient_information.rb', line 287 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, account_type: #{@account_type}, first_name:"\ " #{@first_name}, middle_name: #{@middle_name}, last_name: #{@last_name}, address1:"\ " #{@address1}, administrative_area: #{@administrative_area}, postal_code: #{@postal_code},"\ " country: #{@country}, date_of_birth: #{@date_of_birth}, beneficiary_id:"\ " #{@beneficiary_id}, beneficiary_name: #{@beneficiary_name}, beneficiary_address:"\ " #{@beneficiary_address}, alias_name: #{@alias_name}, nationality: #{@nationality},"\ " country_of_birth: #{@country_of_birth}, occupation: #{@occupation}, email: #{@email},"\ " locality: #{@locality}, additional_properties: #{@additional_properties}>" end |