Class: VisaAcceptanceMergedSpec::MerchantDescriptor

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb

Overview

MerchantDescriptor 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, alternate_name: SKIP, contact: SKIP, address1: SKIP, locality: SKIP, country: SKIP, postal_code: SKIP, administrative_area: SKIP, phone: SKIP, url: SKIP, country_of_origin: SKIP, store_id: SKIP, store_name: SKIP, customer_service_phone_number: SKIP, additional_properties: nil) ⇒ MerchantDescriptor

Returns a new instance of MerchantDescriptor.



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 189

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

  @name = name unless name == SKIP
  @alternate_name = alternate_name unless alternate_name == SKIP
  @contact = contact unless contact == SKIP
  @address1 = address1 unless address1 == SKIP
  @locality = locality unless locality == SKIP
  @country = country unless country == SKIP
  @postal_code = postal_code unless postal_code == SKIP
  @administrative_area = administrative_area unless administrative_area == SKIP
  @phone = phone unless phone == SKIP
  @url = url unless url == SKIP
  @country_of_origin = country_of_origin unless country_of_origin == SKIP
  @store_id = store_id unless store_id == SKIP
  @store_name = store_name unless store_name == SKIP
  unless customer_service_phone_number == SKIP
    @customer_service_phone_number =
      customer_service_phone_number
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#address1String

First line of merchant's address.

Returns:

  • (String)


49
50
51
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 49

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]( 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)


116
117
118
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 116

def administrative_area
  @administrative_area
end

#alternate_nameString

An alternate name for the merchant.

Returns:

  • (String)


37
38
39
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 37

def alternate_name
  @alternate_name
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)


45
46
47
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 45

def contact
  @contact
end

#countryString

Merchant's country.

PIN debit

Country code for your business location. Use the [ISO Standard Country Codes]( 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)


76
77
78
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 76

def country
  @country
end

#country_of_originString

Visa Platform Connect

This field will indicate merchant country of origin

Returns:

  • (String)


129
130
131
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 129

def country_of_origin
  @country_of_origin
end

#customer_service_phone_numberString

Visa Platform Connect

Indicates customer service phone number of Merchant.

Returns:

  • (String)


142
143
144
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 142

def customer_service_phone_number
  @customer_service_phone_number
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)


60
61
62
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 60

def locality
  @locality
end

#nameString

Your merchant name. Note For Paymentech processor using Visa Acceptance 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/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 33

def name
  @name
end

#phoneString

Merchant phone as contact information for CNP transactions

Returns:

  • (String)


120
121
122
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 120

def phone
  @phone
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)


102
103
104
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 102

def postal_code
  @postal_code
end

#store_idString

The identifier of the store.

Returns:

  • (String)


133
134
135
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 133

def store_id
  @store_id
end

#store_nameString

The name of the store.

Returns:

  • (String)


137
138
139
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 137

def store_name
  @store_name
end

#urlString

Address of company's website provided by merchant

Returns:

  • (String)


124
125
126
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 124

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
255
256
257
258
259
260
261
262
263
264
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 219

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  alternate_name = hash.key?('alternateName') ? hash['alternateName'] : SKIP
  contact = hash.key?('contact') ? hash['contact'] : SKIP
  address1 = hash.key?('address1') ? hash['address1'] : SKIP
  locality = hash.key?('locality') ? hash['locality'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP
  administrative_area =
    hash.key?('administrativeArea') ? hash['administrativeArea'] : SKIP
  phone = hash.key?('phone') ? hash['phone'] : SKIP
  url = hash.key?('url') ? hash['url'] : SKIP
  country_of_origin =
    hash.key?('countryOfOrigin') ? hash['countryOfOrigin'] : SKIP
  store_id = hash.key?('storeId') ? hash['storeId'] : SKIP
  store_name = hash.key?('storeName') ? hash['storeName'] : SKIP
  customer_service_phone_number =
    hash.key?('customerServicePhoneNumber') ? hash['customerServicePhoneNumber'] : 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.
  MerchantDescriptor.new(name: name,
                         alternate_name: alternate_name,
                         contact: contact,
                         address1: address1,
                         locality: locality,
                         country: country,
                         postal_code: postal_code,
                         administrative_area: administrative_area,
                         phone: phone,
                         url: url,
                         country_of_origin: country_of_origin,
                         store_id: store_id,
                         store_name: store_name,
                         customer_service_phone_number: customer_service_phone_number,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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/merchant_descriptor.rb', line 145

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['alternate_name'] = 'alternateName'
  @_hash['contact'] = 'contact'
  @_hash['address1'] = 'address1'
  @_hash['locality'] = 'locality'
  @_hash['country'] = 'country'
  @_hash['postal_code'] = 'postalCode'
  @_hash['administrative_area'] = 'administrativeArea'
  @_hash['phone'] = 'phone'
  @_hash['url'] = 'url'
  @_hash['country_of_origin'] = 'countryOfOrigin'
  @_hash['store_id'] = 'storeId'
  @_hash['store_name'] = 'storeName'
  @_hash['customer_service_phone_number'] = 'customerServicePhoneNumber'
  @_hash
end

.nullablesObject

An array for nullable fields



185
186
187
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 185

def self.nullables
  []
end

.optionalsObject

An array for optional fields



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 165

def self.optionals
  %w[
    name
    alternate_name
    contact
    address1
    locality
    country
    postal_code
    administrative_area
    phone
    url
    country_of_origin
    store_id
    store_name
    customer_service_phone_number
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



278
279
280
281
282
283
284
285
286
287
288
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 278

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

#to_sObject

Provides a human-readable string representation of the object.



267
268
269
270
271
272
273
274
275
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor.rb', line 267

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