Class: CyberSourceMergedSpec::AggregatorInformation8
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::AggregatorInformation8
- Defined in:
- lib/cyber_source_merged_spec/models/aggregator_information8.rb
Overview
AggregatorInformation8 Model.
Instance Attribute Summary collapse
-
#aggregator_id ⇒ String
Visa Direct(11 characters) Value that identifies you as a payment aggregator.
-
#city ⇒ String
Aggregator city.
-
#country ⇒ String
Aggregator country.
-
#name ⇒ String
Visa Direct(25 characters) Your payment aggregator business name.
-
#postal_code ⇒ String
Aggregator postal code.
-
#state ⇒ String
Aggregator state.
-
#street_address ⇒ String
Aggregator street name.
-
#sub_merchant ⇒ SubMerchant8
Visa Direct(25 characters) Your payment aggregator business 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(aggregator_id: SKIP, name: SKIP, sub_merchant: SKIP, city: SKIP, country: SKIP, postal_code: SKIP, state: SKIP, street_address: SKIP, additional_properties: nil) ⇒ AggregatorInformation8
constructor
A new instance of AggregatorInformation8.
-
#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(aggregator_id: SKIP, name: SKIP, sub_merchant: SKIP, city: SKIP, country: SKIP, postal_code: SKIP, state: SKIP, street_address: SKIP, additional_properties: nil) ⇒ AggregatorInformation8
Returns a new instance of AggregatorInformation8.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 83 def initialize(aggregator_id: SKIP, name: SKIP, sub_merchant: SKIP, city: SKIP, country: SKIP, postal_code: SKIP, state: SKIP, street_address: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @aggregator_id = aggregator_id unless aggregator_id == SKIP @name = name unless name == SKIP @sub_merchant = sub_merchant unless sub_merchant == SKIP @city = city unless city == SKIP @country = country unless country == SKIP @postal_code = postal_code unless postal_code == SKIP @state = state unless state == SKIP @street_address = street_address unless street_address == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#aggregator_id ⇒ String
Visa Direct(11 characters)
Value that identifies you as a payment aggregator. Get this value from the
processor.
16 17 18 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 16 def aggregator_id @aggregator_id end |
#city ⇒ String
Aggregator city.
32 33 34 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 32 def city @city end |
#country ⇒ String
Aggregator country.
36 37 38 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 36 def country @country end |
#name ⇒ String
Visa Direct(25 characters)
Your payment aggregator business name. This field is conditionally
required when aggregator id is present.
22 23 24 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 22 def name @name end |
#postal_code ⇒ String
Aggregator postal code.
40 41 42 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 40 def postal_code @postal_code end |
#state ⇒ String
Aggregator state.
44 45 46 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 44 def state @state end |
#street_address ⇒ String
Aggregator street name.
48 49 50 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 48 def street_address @street_address end |
#sub_merchant ⇒ SubMerchant8
Visa Direct(25 characters)
Your payment aggregator business name. This field is conditionally
required when aggregator id is present.
28 29 30 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 28 def sub_merchant @sub_merchant end |
Class Method Details
.from_element(root) ⇒ Object
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 133 def self.from_element(root) aggregator_id = XmlUtilities.from_element(root, 'aggregatorId', String) name = XmlUtilities.from_element(root, 'name', String) sub_merchant = XmlUtilities.from_element(root, 'SubMerchant8', SubMerchant8) city = XmlUtilities.from_element(root, 'city', String) country = XmlUtilities.from_element(root, 'country', String) postal_code = XmlUtilities.from_element(root, 'postalCode', String) state = XmlUtilities.from_element(root, 'state', String) street_address = XmlUtilities.from_element(root, 'streetAddress', String) new(aggregator_id: aggregator_id, name: name, sub_merchant: sub_merchant, city: city, country: country, postal_code: postal_code, state: state, street_address: street_address, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
101 102 103 104 105 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 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 101 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. aggregator_id = hash.key?('aggregatorId') ? hash['aggregatorId'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP sub_merchant = SubMerchant8.from_hash(hash['subMerchant']) if hash['subMerchant'] city = hash.key?('city') ? hash['city'] : SKIP country = hash.key?('country') ? hash['country'] : SKIP postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP state = hash.key?('state') ? hash['state'] : SKIP street_address = hash.key?('streetAddress') ? hash['streetAddress'] : 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. AggregatorInformation8.new(aggregator_id: aggregator_id, name: name, sub_merchant: sub_merchant, city: city, country: country, postal_code: postal_code, state: state, street_address: street_address, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 51 def self.names @_hash = {} if @_hash.nil? @_hash['aggregator_id'] = 'aggregatorId' @_hash['name'] = 'name' @_hash['sub_merchant'] = 'subMerchant' @_hash['city'] = 'city' @_hash['country'] = 'country' @_hash['postal_code'] = 'postalCode' @_hash['state'] = 'state' @_hash['street_address'] = 'streetAddress' @_hash end |
.nullables ⇒ Object
An array for nullable fields
79 80 81 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 79 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 65 def self.optionals %w[ aggregator_id name sub_merchant city country postal_code state street_address ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
182 183 184 185 186 187 188 189 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 182 def inspect class_name = self.class.name.split('::').last "<#{class_name} aggregator_id: #{@aggregator_id.inspect}, name: #{@name.inspect},"\ " sub_merchant: #{@sub_merchant.inspect}, city: #{@city.inspect}, country:"\ " #{@country.inspect}, postal_code: #{@postal_code.inspect}, state: #{@state.inspect},"\ " street_address: #{@street_address.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
173 174 175 176 177 178 179 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 173 def to_s class_name = self.class.name.split('::').last "<#{class_name} aggregator_id: #{@aggregator_id}, name: #{@name}, sub_merchant:"\ " #{@sub_merchant}, city: #{@city}, country: #{@country}, postal_code: #{@postal_code},"\ " state: #{@state}, street_address: #{@street_address}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/cyber_source_merged_spec/models/aggregator_information8.rb', line 155 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'aggregatorId', aggregator_id) XmlUtilities.add_as_subelement(doc, root, 'name', name) XmlUtilities.add_as_subelement(doc, root, 'SubMerchant8', sub_merchant) XmlUtilities.add_as_subelement(doc, root, 'city', city) XmlUtilities.add_as_subelement(doc, root, 'country', country) XmlUtilities.add_as_subelement(doc, root, 'postalCode', postal_code) XmlUtilities.add_as_subelement(doc, root, 'state', state) XmlUtilities.add_as_subelement(doc, root, 'streetAddress', street_address) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |