Class: VisaAcceptanceMergedSpec::SubMerchant

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

Overview

SubMerchant 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(card_acceptor_id: SKIP, id: SKIP, name: SKIP, address1: SKIP, locality: SKIP, administrative_area: SKIP, region: SKIP, postal_code: SKIP, country: SKIP, email: SKIP, phone_number: SKIP, additional_properties: nil) ⇒ SubMerchant

Returns a new instance of SubMerchant.



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 188

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

  @card_acceptor_id = card_acceptor_id unless card_acceptor_id == SKIP
  @id = id unless id == SKIP
  @name = name unless name == SKIP
  @address1 = address1 unless address1 == SKIP
  @locality = locality unless locality == SKIP
  @administrative_area = administrative_area unless administrative_area == SKIP
  @region = region unless region == 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
  @additional_properties = additional_properties
end

Instance Attribute Details

#address1String

First line of the sub-merchant’s street address.

Visa Acceptance 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.

Returns:

  • (String)


69
70
71
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 69

def address1
  @address1
end

#administrative_areaString

Sub-merchant’s state or province.

Visa Acceptance 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.

Returns:

  • (String)


85
86
87
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 85

def administrative_area
  @administrative_area
end

#card_acceptor_idString

Unique identifier assigned by the payment card company to the sub-merchant.

Returns:

  • (String)


15
16
17
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 15

def card_acceptor_id
  @card_acceptor_id
end

#countryString

Sub-merchant’s country. Use the [ISO Standard Country Codes](

Visa Acceptance 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.

Returns:

  • (String)


107
108
109
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 107

def country
  @country
end

#emailString

Sub-merchant’s email address. Maximum length for processors

  • American Express Direct: 40
  • Visa Acceptance through VisaNet: 40
  • FDC Compass: 40
  • FDC Nashville Global: 19

Visa Acceptance 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 Visa Acceptance. Visa Acceptance 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.

Returns:

  • (String)


127
128
129
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 127

def email
  @email
end

#idString

The ID you assigned to your sub-merchant. Visa Acceptance 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) Visa Acceptance through VisaNet with American Express: String (20) Visa Acceptance through VisaNet with Visa,Mastercard and Discover: String (15) FDC Compass: String (20) FDC Nashville Global: String (14)

Returns:

  • (String)


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

def id
  @id
end

#localityString

Sub-merchant’s city.

Visa Acceptance 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.

Returns:

  • (String)


77
78
79
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 77

def locality
  @locality
end

#nameString

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.

Visa Acceptance 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.

Returns:

  • (String)


61
62
63
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 61

def name
  @name
end

#phone_numberString

Sub-merchant’s telephone number. Maximum length for procesors

  • American Express Direct: 20
  • Visa Acceptance through VisaNet: 20
  • FDC Compass: 13
  • FDC Nashville Global: 10

Visa Acceptance 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

Returns:

  • (String)


147
148
149
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 147

def phone_number
  @phone_number
end

#postal_codeString

Partial postal code for the sub-merchant’s address.

Visa Acceptance 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.

Returns:

  • (String)


99
100
101
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 99

def postal_code
  @postal_code
end

#regionString

Sub-merchant’s region. Example
NE indicates that the sub-merchant is in the northeast region.

Returns:

  • (String)


91
92
93
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 91

def region
  @region
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



210
211
212
213
214
215
216
217
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
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 210

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  card_acceptor_id =
    hash.key?('cardAcceptorId') ? hash['cardAcceptorId'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  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
  region = hash.key?('region') ? hash['region'] : 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

  # 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.
  SubMerchant.new(card_acceptor_id: card_acceptor_id,
                  id: id,
                  name: name,
                  address1: address1,
                  locality: locality,
                  administrative_area: administrative_area,
                  region: region,
                  postal_code: postal_code,
                  country: country,
                  email: email,
                  phone_number: phone_number,
                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 150

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['card_acceptor_id'] = 'cardAcceptorId'
  @_hash['id'] = 'id'
  @_hash['name'] = 'name'
  @_hash['address1'] = 'address1'
  @_hash['locality'] = 'locality'
  @_hash['administrative_area'] = 'administrativeArea'
  @_hash['region'] = 'region'
  @_hash['postal_code'] = 'postalCode'
  @_hash['country'] = 'country'
  @_hash['email'] = 'email'
  @_hash['phone_number'] = 'phoneNumber'
  @_hash
end

.nullablesObject

An array for nullable fields



184
185
186
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 184

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    card_acceptor_id
    id
    name
    address1
    locality
    administrative_area
    region
    postal_code
    country
    email
    phone_number
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



261
262
263
264
265
266
267
268
269
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 261

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

#to_sObject

Provides a human-readable string representation of the object.



251
252
253
254
255
256
257
258
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant.rb', line 251

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