Class: CyberSourceMergedSpec::SubMerchant1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::SubMerchant1
- Defined in:
- lib/cyber_source_merged_spec/models/sub_merchant1.rb
Overview
SubMerchant1 Model.
Instance Attribute Summary collapse
-
#address1 ⇒ String
First line of the sub-merchant’s street address.
-
#administrative_area ⇒ String
Sub-merchant’s state or province.
-
#country ⇒ String
Sub-merchant’s country.
-
#email ⇒ String
Sub-merchant’s email address.
-
#id ⇒ String
The ID you assigned to your sub-merchant.
-
#locality ⇒ String
Sub-merchant’s city.
-
#merchant_category_code ⇒ Float
The ID you assigned to your sub-merchant.
-
#name ⇒ String
Sub-merchant’s business name.
-
#phone_number ⇒ String
Sub-merchant’s telephone number.
-
#postal_code ⇒ String
Partial postal code for the sub-merchant’s address.
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(name: SKIP, address1: SKIP, locality: SKIP, administrative_area: SKIP, postal_code: SKIP, country: SKIP, email: SKIP, phone_number: SKIP, id: SKIP, merchant_category_code: SKIP, additional_properties: nil) ⇒ SubMerchant1
constructor
A new instance of SubMerchant1.
-
#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(name: SKIP, address1: SKIP, locality: SKIP, administrative_area: SKIP, postal_code: SKIP, country: SKIP, email: SKIP, phone_number: SKIP, id: SKIP, merchant_category_code: SKIP, additional_properties: nil) ⇒ SubMerchant1
Returns a new instance of SubMerchant1.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 197 def initialize(name: SKIP, address1: SKIP, locality: SKIP, administrative_area: SKIP, postal_code: SKIP, country: SKIP, email: SKIP, phone_number: SKIP, id: SKIP, merchant_category_code: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @name = name unless name == SKIP @address1 = address1 unless address1 == SKIP @locality = locality unless locality == SKIP @administrative_area = administrative_area unless administrative_area == SKIP @postal_code = postal_code unless postal_code == SKIP @country = country unless country == SKIP @email = email unless email == SKIP @phone_number = phone_number unless phone_number == SKIP @id = id unless id == SKIP @merchant_category_code = merchant_category_code unless merchant_category_code == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#address1 ⇒ String
First line of the sub-merchant’s street address.
CyberSource through VisaNet
The value for this field does not map to the TC 33 capture file5.
FDC Compass
This value must consist of uppercase characters.
42 43 44 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 42 def address1 @address1 end |
#administrative_area ⇒ String
Sub-merchant’s state or province.
CyberSource through VisaNet
The value for this field does not map to the TC 33 capture file5.
FDC Compass
This value must consist of uppercase characters.
58 59 60 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 58 def administrative_area @administrative_area end |
#country ⇒ String
Sub-merchant’s country. Use the [ISO Standard Country Codes](https://developer.cybersource.com/library/documentation/sbc/quickre f/countries_alpha_list.pdf).
CyberSource through VisaNet
The value for this field does not map to the TC 33 capture file.
FDC Compass
This value must consist of uppercase characters.
76 77 78 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 76 def country @country end |
#email ⇒ String
Sub-merchant’s email address. Maximum length for processors
- American Express Direct: 40
- CyberSource through VisaNet: 40
- FDC Compass: 40
- FDC Nashville Global: 19
CyberSource through VisaNet
With American Express, the value for this field corresponds to the following data in the TC 33 capture file:
- Record: CP01 TCRB
- Position: 25-64
- Field: American Express Seller E-mail Address Note The TC 33 Capture file contains information about the purchases and refunds that a merchant submits to CyberSource. CyberSource through VisaNet creates the TC 33 Capture file at the end of the day and sends it to the merchant’s acquirer, who uses this information to facilitate end-of-day clearing processing with payment card companies.
96 97 98 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 96 def email @email end |
#id ⇒ String
The ID you assigned to your sub-merchant. CyberSource through VisaNet: For American Express transaction, the value for this field corresponds to the following data in the TC 33 capture file:
- Record: CP01 TCRB
- Position: 65-84
- Field: American Express Seller ID For Mastercard transactions, the value for this field corresponds to the following data in the TC 33 capture file:
- Record: CP01 TCR6
- Position: 117-131
- Field: Sub-Merchant ID FDC Compass: This value must consist of uppercase characters. American Express Direct: String (20) CyberSource through VisaNet with American Express: String (20) CyberSource through VisaNet with Visa,Mastercard and Discover: String (15) FDC Compass: String (20) FDC Nashville Global: String (14)
137 138 139 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 137 def id @id end |
#locality ⇒ String
Sub-merchant’s city.
CyberSource through VisaNet
The value for this field does not map to the TC 33 capture file5.
FDC Compass
This value must consist of uppercase characters.
50 51 52 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 50 def locality @locality end |
#merchant_category_code ⇒ Float
The ID you assigned to your sub-merchant. CyberSource through VisaNet: For American Express transaction, the value for this field corresponds to the following data in the TC 33 capture file:
- Record: CP01 TCRB
- Position: 65-84
- Field: American Express Seller ID For Mastercard transactions, the value for this field corresponds to the following data in the TC 33 capture file:
- Record: CP01 TCR6
- Position: 117-131
- Field: Sub-Merchant ID FDC Compass: This value must consist of uppercase characters. American Express Direct: String (20) CyberSource through VisaNet with American Express: String (20) CyberSource through VisaNet with Visa,Mastercard and Discover: String (15) FDC Compass: String (20) FDC Nashville Global: String (14)
158 159 160 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 158 def merchant_category_code @merchant_category_code end |
#name ⇒ String
Sub-merchant’s business name.
American Express Direct
The maximum length of the sub-merchant name depends on the length of the aggregator name. The combined length for both values must not exceed 36 characters.
CyberSource through VisaNet
With American Express, the maximum length of the sub-merchant name depends on the length of the aggregator name. The combined length for both values must not exceed 36 characters. The value for this field does not map to the TC 33 capture file5.
FDC Compass
This value must consist of uppercase characters.
FDC Nashville Global
With Mastercard, the maximum length of the sub-merchant name depends on the length of the aggregator name:
- If aggregator name length is 1 through 3, maximum sub-merchant name length is 21.
- If aggregator name length is 4 through 7, maximum sub-merchant name length is 17.
- If aggregator name length is 8 through 12, maximum sub-merchant name length is 12.
34 35 36 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 34 def name @name end |
#phone_number ⇒ String
Sub-merchant’s telephone number. Maximum length for procesors
- American Express Direct: 20
- CyberSource through VisaNet: 20
- FDC Compass: 13
- FDC Nashville Global: 10
CyberSource through VisaNet
With American Express, the value for this field corresponds to the following data in the TC 33 capture file5:
- Record: CP01 TCRB
- Position: 5-24
- Field: American Express Seller Telephone Number
FDC Compass
This value must consist of uppercase characters. Use one of these recommended formats:
NNN-NNN-NNNN
NNN-AAAAAAA
116 117 118 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 116 def phone_number @phone_number end |
#postal_code ⇒ String
Partial postal code for the sub-merchant’s address.
CyberSource through VisaNet
The value for this field does not map to the TC 33 capture file5.
FDC Compass
This value must consist of uppercase characters.
66 67 68 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 66 def postal_code @postal_code end |
Class Method Details
.from_element(root) ⇒ Object
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 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 256 def self.from_element(root) name = XmlUtilities.from_element(root, 'name', String) address1 = XmlUtilities.from_element(root, 'address1', String) locality = XmlUtilities.from_element(root, 'locality', String) administrative_area = XmlUtilities.from_element(root, 'administrativeArea', String) postal_code = XmlUtilities.from_element(root, 'postalCode', String) country = XmlUtilities.from_element(root, 'country', String) email = XmlUtilities.from_element(root, 'email', String) phone_number = XmlUtilities.from_element(root, 'phoneNumber', String) id = XmlUtilities.from_element(root, 'id', String) merchant_category_code = XmlUtilities.from_element(root, 'merchantCategoryCode', Float) new(name: name, address1: address1, locality: locality, administrative_area: administrative_area, postal_code: postal_code, country: country, email: email, phone_number: phone_number, id: id, merchant_category_code: merchant_category_code, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
218 219 220 221 222 223 224 225 226 227 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 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 218 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP address1 = hash.key?('address1') ? hash['address1'] : SKIP locality = hash.key?('locality') ? hash['locality'] : SKIP administrative_area = hash.key?('administrativeArea') ? hash['administrativeArea'] : SKIP postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP country = hash.key?('country') ? hash['country'] : SKIP email = hash.key?('email') ? hash['email'] : SKIP phone_number = hash.key?('phoneNumber') ? hash['phoneNumber'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP merchant_category_code = hash.key?('merchantCategoryCode') ? hash['merchantCategoryCode'] : 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. SubMerchant1.new(name: name, address1: address1, locality: locality, administrative_area: administrative_area, postal_code: postal_code, country: country, email: email, phone_number: phone_number, id: id, merchant_category_code: merchant_category_code, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 161 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['address1'] = 'address1' @_hash['locality'] = 'locality' @_hash['administrative_area'] = 'administrativeArea' @_hash['postal_code'] = 'postalCode' @_hash['country'] = 'country' @_hash['email'] = 'email' @_hash['phone_number'] = 'phoneNumber' @_hash['id'] = 'id' @_hash['merchant_category_code'] = 'merchantCategoryCode' @_hash end |
.nullables ⇒ Object
An array for nullable fields
193 194 195 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 193 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 177 def self.optionals %w[ name address1 locality administrative_area postal_code country email phone_number id merchant_category_code ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
317 318 319 320 321 322 323 324 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 317 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, address1: #{@address1.inspect}, locality:"\ " #{@locality.inspect}, administrative_area: #{@administrative_area.inspect}, postal_code:"\ " #{@postal_code.inspect}, country: #{@country.inspect}, email: #{@email.inspect},"\ " phone_number: #{@phone_number.inspect}, id: #{@id.inspect}, merchant_category_code:"\ " #{@merchant_category_code.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
307 308 309 310 311 312 313 314 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 307 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, address1: #{@address1}, locality: #{@locality},"\ " administrative_area: #{@administrative_area}, postal_code: #{@postal_code}, country:"\ " #{@country}, email: #{@email}, phone_number: #{@phone_number}, id: #{@id},"\ " merchant_category_code: #{@merchant_category_code}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/cyber_source_merged_spec/models/sub_merchant1.rb', line 285 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'name', 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, 'postalCode', postal_code) XmlUtilities.add_as_subelement(doc, root, 'country', country) XmlUtilities.add_as_subelement(doc, root, 'email', email) XmlUtilities.add_as_subelement(doc, root, 'phoneNumber', phone_number) XmlUtilities.add_as_subelement(doc, root, 'id', id) XmlUtilities.add_as_subelement(doc, root, 'merchantCategoryCode', merchant_category_code) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |