Class: VisaAcceptanceMergedSpec::Routing

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

Overview

Routing 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(network: SKIP, network_name: SKIP, customer_signature_required: SKIP, additional_properties: nil) ⇒ Routing

Returns a new instance of Routing.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/visa_acceptance_merged_spec/models/routing.rb', line 83

def initialize(network: SKIP, network_name: SKIP,
               customer_signature_required: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @network = network unless network == SKIP
  @network_name = network_name unless network_name == SKIP
  unless customer_signature_required == SKIP
    @customer_signature_required =
      customer_signature_required
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#customer_signature_requiredString

Indicates whether you need to obtain the cardholder's signature. Possible values:

  • Y: You need to obtain the cardholder's signature.
  • N: You do not need to obtain the cardholder's signature.

Returns:

  • (String)


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

def customer_signature_required
  @customer_signature_required
end

#networkString

PIN Debit Services: Contains the ID of the debit network to which the transaction was routed.

Code Network
0000 Priority Routing or Generic File Update
0002 Visa programs, Private Label and non-Visa Authorization Gateway
Services
0003 Interlink
0004 Plus
0008 Star
0009 Pulse
0010 Star
0011 Star
0012 Star (primary network ID)
0013 AFFN
0015 Star
0016 Maestro
0017 Pulse (primary network ID)
0018 NYCE (primary network ID)
0019 Pulse
0020 Accel
0023 NETS
0024 CU24
0025 Alaska Option
0027 NYCE
0028 Shazam
0029 EBT POS

FDC Nashville Global authorization service: Indicates whether the transaction was routed to a credit network, a debit network, or the STAR signature debit network.

  • C: Credit network
  • D: Debit network (without signature)
  • S: STAR signature debit network

Returns:

  • (String)


47
48
49
# File 'lib/visa_acceptance_merged_spec/models/routing.rb', line 47

def network
  @network
end

#network_nameString

Name of the network to which the transaction was routed.

Returns:

  • (String)


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

def network_name
  @network_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/visa_acceptance_merged_spec/models/routing.rb', line 99

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  network = hash.key?('network') ? hash['network'] : SKIP
  network_name = hash.key?('networkName') ? hash['networkName'] : SKIP
  customer_signature_required =
    hash.key?('customerSignatureRequired') ? hash['customerSignatureRequired'] : 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.
  Routing.new(network: network,
              network_name: network_name,
              customer_signature_required: customer_signature_required,
              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
# File 'lib/visa_acceptance_merged_spec/models/routing.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['network'] = 'network'
  @_hash['network_name'] = 'networkName'
  @_hash['customer_signature_required'] = 'customerSignatureRequired'
  @_hash
end

.nullablesObject

An array for nullable fields



79
80
81
# File 'lib/visa_acceptance_merged_spec/models/routing.rb', line 79

def self.nullables
  []
end

.optionalsObject

An array for optional fields



70
71
72
73
74
75
76
# File 'lib/visa_acceptance_merged_spec/models/routing.rb', line 70

def self.optionals
  %w[
    network
    network_name
    customer_signature_required
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



131
132
133
134
135
136
# File 'lib/visa_acceptance_merged_spec/models/routing.rb', line 131

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

#to_sObject

Provides a human-readable string representation of the object.



123
124
125
126
127
128
# File 'lib/visa_acceptance_merged_spec/models/routing.rb', line 123

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