Class: VisaAcceptanceMergedSpec::MerchantDescriptor6

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

Overview

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

Returns a new instance of MerchantDescriptor6.



105
106
107
108
109
110
111
112
113
114
115
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 105

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

  @postal_code = postal_code unless postal_code == SKIP
  @contact = contact unless contact == SKIP
  @locality = locality unless locality == SKIP
  @name = name unless name == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#contactString

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

  • FDCCompass (13)
  • Paymentech (13)

Returns:

  • (String)


44
45
46
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 44

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


55
56
57
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 55

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)


78
79
80
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 78

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)


36
37
38
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 36

def postal_code
  @postal_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 118

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



81
82
83
84
85
86
87
88
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 81

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

.nullablesObject

An array for nullable fields



101
102
103
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 101

def self.nullables
  []
end

.optionalsObject

An array for optional fields



91
92
93
94
95
96
97
98
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 91

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



150
151
152
153
154
155
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 150

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

#to_sObject

Provides a human-readable string representation of the object.



143
144
145
146
147
# File 'lib/visa_acceptance_merged_spec/models/merchant_descriptor6.rb', line 143

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