Class: VisaAcceptanceMergedSpec::WatchlistScreeningInformation

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

Overview

WatchlistScreeningInformation 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(address_operator: SKIP, weights: SKIP, sanction_lists: SKIP, proceed_on_match: SKIP, additional_properties: nil) ⇒ WatchlistScreeningInformation

Returns a new instance of WatchlistScreeningInformation.



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

def initialize(address_operator: SKIP, weights: SKIP, sanction_lists: SKIP,
               proceed_on_match: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @address_operator = address_operator unless address_operator == SKIP
  @weights = weights unless weights == SKIP
  @sanction_lists = sanction_lists unless sanction_lists == SKIP
  @proceed_on_match = proceed_on_match unless proceed_on_match == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#address_operatorString

Parts of the customer’s information that must match with an entry in the DPL (denied parties list) before a match occurs. This field can contain one of the following values:

  • AND: (default) The customer’s name or company and the customer’s address must appear in the database.
  • OR: The customer’s name must appear in the database.
  • IGNORE: You want the service to detect a match only of the customer’s name or company but not of the address.

Returns:

  • (String)


21
22
23
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information.rb', line 21

def address_operator
  @address_operator
end

#proceed_on_matchTrueClass | FalseClass

Indicates whether the transaction should proceed if there is a match. Possible values:

  • true: Transaction proceeds even when match is found in the Denied Parties List. The match is noted in the response.
  • false: Normal watchlist screening behavior occurs. (Transaction stops if a match to DPL occurs. Transaction proceeds if no match.)

Returns:

  • (TrueClass | FalseClass)


49
50
51
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information.rb', line 49

def proceed_on_match
  @proceed_on_match
end

#sanction_listsArray[String]

Use this field to specify which list(s) you want checked with the request. The reply will include the list name as well as the response data. To check against multiple lists, enter multiple list codes separated by a caret (^). For more information, see "Restricted and Denied Parties List," page 68.

Returns:

  • (Array[String])


40
41
42
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information.rb', line 40

def sanction_lists
  @sanction_lists
end

#weightsWeights

Parts of the customer’s information that must match with an entry in the DPL (denied parties list) before a match occurs. This field can contain one of the following values:

  • AND: (default) The customer’s name or company and the customer’s address must appear in the database.
  • OR: The customer’s name must appear in the database.
  • IGNORE: You want the service to detect a match only of the customer’s name or company but not of the address.

Returns:



32
33
34
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information.rb', line 32

def weights
  @weights
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information.rb', line 89

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address_operator =
    hash.key?('addressOperator') ? hash['addressOperator'] : SKIP
  weights = Weights.from_hash(hash['weights']) if hash['weights']
  sanction_lists = hash.key?('sanctionLists') ? hash['sanctionLists'] : SKIP
  proceed_on_match =
    hash.key?('proceedOnMatch') ? hash['proceedOnMatch'] : 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.
  WatchlistScreeningInformation.new(address_operator: address_operator,
                                    weights: weights,
                                    sanction_lists: sanction_lists,
                                    proceed_on_match: proceed_on_match,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



52
53
54
55
56
57
58
59
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information.rb', line 52

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address_operator'] = 'addressOperator'
  @_hash['weights'] = 'weights'
  @_hash['sanction_lists'] = 'sanctionLists'
  @_hash['proceed_on_match'] = 'proceedOnMatch'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    address_operator
    weights
    sanction_lists
    proceed_on_match
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_sObject

Provides a human-readable string representation of the object.



116
117
118
119
120
121
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information.rb', line 116

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