Class: CyberSourceMergedSpec::AggregatorInformation

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/aggregator_information.rb

Overview

AggregatorInformation Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, street_address: SKIP, city: SKIP, state: SKIP, postal_code: SKIP, country: SKIP, service_providername: SKIP, additional_properties: nil) ⇒ AggregatorInformation

Returns a new instance of AggregatorInformation.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 115

def initialize(aggregator_id: SKIP, name: SKIP, sub_merchant: SKIP,
               street_address: SKIP, city: SKIP, state: SKIP,
               postal_code: SKIP, country: SKIP, service_providername: 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
  @street_address = street_address unless street_address == SKIP
  @city = city unless city == SKIP
  @state = state unless state == SKIP
  @postal_code = postal_code unless postal_code == SKIP
  @country = country unless country == SKIP
  @service_providername = service_providername unless service_providername == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#aggregator_idString

Value that identifies you as a payment aggregator. Get this value from the processor.

CyberSource through VisaNet

The value for this field corresponds to the following data in the TC 33 capture file5:

  • Record: CP01 TCR6
  • Position: 95-105
  • Field: Payment Facilitator ID This field is supported for Visa, Mastercard and Discover Transactions. FDC Compass
    This value must consist of uppercase characters.

Returns:

  • (String)


24
25
26
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 24

def aggregator_id
  @aggregator_id
end

#cityString

Acquirer city.

Returns:

  • (String)


62
63
64
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 62

def city
  @city
end

#countryString

Acquirer country.

Returns:

  • (String)


74
75
76
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 74

def country
  @country
end

#nameString

Your payment aggregator business name. American Express Direct
The maximum length of the aggregator name depends on the length of the sub-merchant name. The combined length for both values must not exceed 36 characters.\

CyberSource through VisaNet

With American Express, the maximum length of the aggregator name depends on the length of the sub-merchant 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.

Returns:

  • (String)


39
40
41
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 39

def name
  @name
end

#postal_codeString

Acquirer postal code.

Returns:

  • (String)


70
71
72
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 70

def postal_code
  @postal_code
end

#service_providernameString

Contains transfer service provider name.

Returns:

  • (String)


78
79
80
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 78

def service_providername
  @service_providername
end

#stateString

Acquirer state.

Returns:

  • (String)


66
67
68
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 66

def state
  @state
end

#street_addressString

Acquirer street name.

Returns:

  • (String)


58
59
60
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 58

def street_address
  @street_address
end

#sub_merchantSubMerchant

Your payment aggregator business name. American Express Direct
The maximum length of the aggregator name depends on the length of the sub-merchant name. The combined length for both values must not exceed 36 characters.\

CyberSource through VisaNet

With American Express, the maximum length of the aggregator name depends on the length of the sub-merchant 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.

Returns:



54
55
56
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 54

def sub_merchant
  @sub_merchant
end

Class Method Details

.from_element(root) ⇒ Object



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 170

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, 'SubMerchant', SubMerchant)
  street_address = XmlUtilities.from_element(root, 'streetAddress', String)
  city = XmlUtilities.from_element(root, 'city', String)
  state = XmlUtilities.from_element(root, 'state', String)
  postal_code = XmlUtilities.from_element(root, 'postalCode', String)
  country = XmlUtilities.from_element(root, 'country', String)
  service_providername = XmlUtilities.from_element(root,
                                                   'serviceProvidername',
                                                   String)

  new(aggregator_id: aggregator_id,
      name: name,
      sub_merchant: sub_merchant,
      street_address: street_address,
      city: city,
      state: state,
      postal_code: postal_code,
      country: country,
      service_providername: service_providername,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 135

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 = SubMerchant.from_hash(hash['subMerchant']) if hash['subMerchant']
  street_address = hash.key?('streetAddress') ? hash['streetAddress'] : SKIP
  city = hash.key?('city') ? hash['city'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  service_providername =
    hash.key?('serviceProvidername') ? hash['serviceProvidername'] : 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.
  AggregatorInformation.new(aggregator_id: aggregator_id,
                            name: name,
                            sub_merchant: sub_merchant,
                            street_address: street_address,
                            city: city,
                            state: state,
                            postal_code: postal_code,
                            country: country,
                            service_providername: service_providername,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 81

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['aggregator_id'] = 'aggregatorId'
  @_hash['name'] = 'name'
  @_hash['sub_merchant'] = 'subMerchant'
  @_hash['street_address'] = 'streetAddress'
  @_hash['city'] = 'city'
  @_hash['state'] = 'state'
  @_hash['postal_code'] = 'postalCode'
  @_hash['country'] = 'country'
  @_hash['service_providername'] = 'serviceProvidername'
  @_hash
end

.nullablesObject

An array for nullable fields



111
112
113
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 111

def self.nullables
  []
end

.optionalsObject

An array for optional fields



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 96

def self.optionals
  %w[
    aggregator_id
    name
    sub_merchant
    street_address
    city
    state
    postal_code
    country
    service_providername
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



224
225
226
227
228
229
230
231
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 224

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} aggregator_id: #{@aggregator_id.inspect}, name: #{@name.inspect},"\
  " sub_merchant: #{@sub_merchant.inspect}, street_address: #{@street_address.inspect}, city:"\
  " #{@city.inspect}, state: #{@state.inspect}, postal_code: #{@postal_code.inspect}, country:"\
  " #{@country.inspect}, service_providername: #{@service_providername.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



215
216
217
218
219
220
221
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 215

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} aggregator_id: #{@aggregator_id}, name: #{@name}, sub_merchant:"\
  " #{@sub_merchant}, street_address: #{@street_address}, city: #{@city}, state: #{@state},"\
  " postal_code: #{@postal_code}, country: #{@country}, service_providername:"\
  " #{@service_providername}, additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/cyber_source_merged_spec/models/aggregator_information.rb', line 195

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, 'SubMerchant', sub_merchant)
  XmlUtilities.add_as_subelement(doc, root, 'streetAddress', street_address)
  XmlUtilities.add_as_subelement(doc, root, 'city', city)
  XmlUtilities.add_as_subelement(doc, root, 'state', state)
  XmlUtilities.add_as_subelement(doc, root, 'postalCode', postal_code)
  XmlUtilities.add_as_subelement(doc, root, 'country', country)
  XmlUtilities.add_as_subelement(doc, root, 'serviceProvidername',
                                 service_providername)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end