Class: VisaAcceptanceMergedSpec::ServiceFeeDescriptor

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

Overview

ServiceFeeDescriptor 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, contact: SKIP, state: SKIP, additional_properties: nil) ⇒ ServiceFeeDescriptor

Returns a new instance of ServiceFeeDescriptor.



76
77
78
79
80
81
82
83
84
85
# File 'lib/visa_acceptance_merged_spec/models/service_fee_descriptor.rb', line 76

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

  @name = name unless name == SKIP
  @contact = contact unless contact == SKIP
  @state = state unless state == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#contactString

Contact information for the service provider that is collecting the service fee. when you include more than one consecutive space, extra spaces are removed. When you do not include this value in your request, Visa Acceptance uses the value that is in your Visa Acceptance account. This value might be displayed on the cardholder’s statement.

Returns:

  • (String)


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

def contact
  @contact
end

#nameString

Name of the service provider that is collecting the service fee. The service provider name must consist of 3, 7, or 12 characters followed by an asterisk (*). This value must also include the words “Service Fee.” When you include more than one consecutive space, extra spaces are removed. Use one of the following formats for this value:

  • <3-character name>*Service Fee
  • <7-character name>*Service Fee
  • <12-character name>*Service Fee When payments are made in installments, this value must also include installment information such as “1 of 5” or “3 of 7.” For installment payments, use one of the following formats for this value:
  • <3-character name>Service Fee of
  • <7-character name>Service Fee of
  • <12-character name>Service Fee of where is the payment number and is the total number of payments. When you do not include this value in your request, Visa Acceptance uses the value that is in your Visa Acceptance account. This value might be displayed on the cardholder’s statement.

Returns:

  • (String)


35
36
37
# File 'lib/visa_acceptance_merged_spec/models/service_fee_descriptor.rb', line 35

def name
  @name
end

#stateString

State or territory in which the service provider is located. When you do not include this value in your request, Visa Acceptance uses the value that is in your Visa Acceptance account. This value might be displayed on the cardholder’s statement.

Returns:

  • (String)


51
52
53
# File 'lib/visa_acceptance_merged_spec/models/service_fee_descriptor.rb', line 51

def state
  @state
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/visa_acceptance_merged_spec/models/service_fee_descriptor.rb', line 88

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



54
55
56
57
58
59
60
# File 'lib/visa_acceptance_merged_spec/models/service_fee_descriptor.rb', line 54

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

.nullablesObject

An array for nullable fields



72
73
74
# File 'lib/visa_acceptance_merged_spec/models/service_fee_descriptor.rb', line 72

def self.nullables
  []
end

.optionalsObject

An array for optional fields



63
64
65
66
67
68
69
# File 'lib/visa_acceptance_merged_spec/models/service_fee_descriptor.rb', line 63

def self.optionals
  %w[
    name
    contact
    state
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



118
119
120
121
122
# File 'lib/visa_acceptance_merged_spec/models/service_fee_descriptor.rb', line 118

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

#to_sObject

Provides a human-readable string representation of the object.



111
112
113
114
115
# File 'lib/visa_acceptance_merged_spec/models/service_fee_descriptor.rb', line 111

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