Class: CyberSourceMergedSpec::MerchantDescriptor36

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

Overview

MerchantDescriptor36 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(name: SKIP, locality: SKIP, country: SKIP, administrative_area: SKIP, postal_code: SKIP, contact: SKIP, address1: SKIP, additional_properties: nil) ⇒ MerchantDescriptor36

Returns a new instance of MerchantDescriptor36.



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 148

def initialize(name: SKIP, locality: SKIP, country: SKIP,
               administrative_area: SKIP, postal_code: SKIP, contact: SKIP,
               address1: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name unless name == SKIP
  @locality = locality unless locality == SKIP
  @country = country unless country == SKIP
  @administrative_area = administrative_area unless administrative_area == SKIP
  @postal_code = postal_code unless postal_code == SKIP
  @contact = contact unless contact == SKIP
  @address1 = address1 unless address1 == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#address1String

First line of merchant's address.

Returns:

  • (String)


115
116
117
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 115

def address1
  @address1
end

#administrative_areaString

The state where the merchant is located.

PIN debit

State code or region code for your business. Use the Use the [State, Province, and Territory Codes for the United States and Canada](https://developer.cybersource.com/library/documentation/sbc/quickr ef/states_and_provinces.pdf) This value might be displayed on the cardholder’s statement. When you do not include this value in your PIN debit request, the merchant name from your account is used. Important This value must consist of English characters. Note This field is supported only for businesses located in the U.S. or Canada. Optional field for PIN debit credit or PIN debit purchase.

Returns:

  • (String)


77
78
79
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 77

def administrative_area
  @administrative_area
end

#contactString

Contact information for the merchant. Note These are the maximum data lengths for the following payment processors:

  • FDCCompass (13)
  • Paymentech (13)

Returns:

  • (String)


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

def contact
  @contact
end

#countryString

Merchant's country.

PIN debit

Country code for your business location. Use the [ISO Standard Country Codes](https://developer.cybersource.com/library/documentation/sbc/quickre f/countries_alpha_list.pdf) This value might be displayed on the cardholder’s statement. When you do not include this value in your PIN debit request, the merchant name from your account is used. Important This value must consist of English characters. Note If your business is located in the U.S. or Canada and you include this field in a request, you must also include merchantInformation.merchantDescriptor.administrativeArea. Optional field for PIN debit credit or PIN debit purchase.

Returns:

  • (String)


61
62
63
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 61

def country
  @country
end

#localityString

Merchant's City.

PIN debit

City for your business location. This value might be displayed on the cardholder’s statement. When you do not include this value in your PIN debit request, the merchant name from your account is used. Important This value must consist of English characters. Optional field for PIN debit credit or PIN debit purchase requests.

Returns:

  • (String)


44
45
46
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 44

def locality
  @locality
end

#nameString

Your merchant name. Note For Paymentech processor using Cybersource Payouts, the maximum data length is 22.

PIN debit

Your business name. This name is displayed on the cardholder’s statement. When you include more than one consecutive space, extra spaces are removed. When you do not include this value in your PIN debit request, the merchant name from your account is used. Important This value must consist of English characters. Optional field for PIN debit credit or PIN debit purchase requests.

Airline processing

Your merchant name. This name is displayed on the cardholder’s statement. When you include more than one consecutive space, extra spaces are removed. Note Some airline fee programs may require the original ticket number (ticket identifier) or the ancillary service description in positions 13 through 23 of this field. Important This value must consist of English characters. Required for captures and credits.

Returns:

  • (String)


33
34
35
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 33

def name
  @name
end

#postal_codeString

Merchant's postal code.

PIN debit

Postal code for your business location. This value might be displayed on the cardholder’s statement. If your business is domiciled in the U.S., you can use a 5-digit or 9-digit postal code. A 9-digit postal code must follow this format: [5 digits][dash][4 digits] Example: 12345-6789 If your business is domiciled in Canada, you can use a 6-digit or 9-digit postal code. A 6-digit postal code must follow this format: [alpha][numeric][alpha][space] [numeric][alpha][numeric] Example: A1B 2C3 When you do not include this value in your PIN debit request, the merchant name from your account is used. Important This value must consist of English characters. Note This field is supported only for businesses located in the U.S. or Canada. Important Mastercard requires a postal code for any country that uses postal codes. You can provide the postal code in your account or you can include this field in your request. Optional field for PIN debit credit or PIN debit purchase.

Returns:

  • (String)


103
104
105
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 103

def postal_code
  @postal_code
end

Class Method Details

.from_element(root) ⇒ Object



196
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/merchant_descriptor36.rb', line 196

def self.from_element(root)
  name = XmlUtilities.from_element(root, 'name', String)
  locality = XmlUtilities.from_element(root, 'locality', String)
  country = XmlUtilities.from_element(root, 'country', String)
  administrative_area = XmlUtilities.from_element(root,
                                                  'administrativeArea',
                                                  String)
  postal_code = XmlUtilities.from_element(root, 'postalCode', String)
  contact = XmlUtilities.from_element(root, 'contact', String)
  address1 = XmlUtilities.from_element(root, 'address1', String)

  new(name: name,
      locality: locality,
      country: country,
      administrative_area: administrative_area,
      postal_code: postal_code,
      contact: contact,
      address1: address1,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 165

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  locality = hash.key?('locality') ? hash['locality'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  administrative_area =
    hash.key?('administrativeArea') ? hash['administrativeArea'] : SKIP
  postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP
  contact = hash.key?('contact') ? hash['contact'] : SKIP
  address1 = hash.key?('address1') ? hash['address1'] : 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.
  MerchantDescriptor36.new(name: name,
                           locality: locality,
                           country: country,
                           administrative_area: administrative_area,
                           postal_code: postal_code,
                           contact: contact,
                           address1: address1,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



118
119
120
121
122
123
124
125
126
127
128
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 118

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['locality'] = 'locality'
  @_hash['country'] = 'country'
  @_hash['administrative_area'] = 'administrativeArea'
  @_hash['postal_code'] = 'postalCode'
  @_hash['contact'] = 'contact'
  @_hash['address1'] = 'address1'
  @_hash
end

.nullablesObject

An array for nullable fields



144
145
146
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 144

def self.nullables
  []
end

.optionalsObject

An array for optional fields



131
132
133
134
135
136
137
138
139
140
141
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 131

def self.optionals
  %w[
    name
    locality
    country
    administrative_area
    postal_code
    contact
    address1
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



243
244
245
246
247
248
249
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 243

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, locality: #{@locality.inspect}, country:"\
  " #{@country.inspect}, administrative_area: #{@administrative_area.inspect}, postal_code:"\
  " #{@postal_code.inspect}, contact: #{@contact.inspect}, address1: #{@address1.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



235
236
237
238
239
240
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 235

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name}, locality: #{@locality}, country: #{@country},"\
  " administrative_area: #{@administrative_area}, postal_code: #{@postal_code}, contact:"\
  " #{@contact}, address1: #{@address1}, additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/cyber_source_merged_spec/models/merchant_descriptor36.rb', line 217

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, 'locality', locality)
  XmlUtilities.add_as_subelement(doc, root, 'country', country)
  XmlUtilities.add_as_subelement(doc, root, 'administrativeArea',
                                 administrative_area)
  XmlUtilities.add_as_subelement(doc, root, 'postalCode', postal_code)
  XmlUtilities.add_as_subelement(doc, root, 'contact', contact)
  XmlUtilities.add_as_subelement(doc, root, 'address1', address1)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end