Class: VisaAcceptanceMergedSpec::SubMerchant1

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

Overview

SubMerchant1 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, address1: SKIP, locality: SKIP, administrative_area: SKIP, postal_code: SKIP, country: SKIP, email: SKIP, phone_number: SKIP, id: SKIP, additional_properties: nil) ⇒ SubMerchant1

Returns a new instance of SubMerchant1.



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 173

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

  @name = name unless name == SKIP
  @address1 = address1 unless address1 == SKIP
  @locality = locality unless locality == SKIP
  @administrative_area = administrative_area unless administrative_area == 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
  @id = id unless id == 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)


42
43
44
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 42

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)


58
59
60
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 58

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


74
75
76
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 74

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)


94
95
96
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 94

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)


136
137
138
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 136

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)


50
51
52
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 50

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)


34
35
36
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 34

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)


114
115
116
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 114

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)


66
67
68
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 66

def postal_code
  @postal_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 193

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  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
  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
  id = hash.key?('id') ? hash['id'] : 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.
  SubMerchant1.new(name: name,
                   address1: address1,
                   locality: locality,
                   administrative_area: administrative_area,
                   postal_code: postal_code,
                   country: country,
                   email: email,
                   phone_number: phone_number,
                   id: id,
                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 139

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

.nullablesObject

An array for nullable fields



169
170
171
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 169

def self.nullables
  []
end

.optionalsObject

An array for optional fields



154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 154

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



238
239
240
241
242
243
244
245
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 238

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

#to_sObject

Provides a human-readable string representation of the object.



229
230
231
232
233
234
235
# File 'lib/visa_acceptance_merged_spec/models/sub_merchant1.rb', line 229

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