Class: VisaAcceptanceMergedSpec::WatchlistScreeningInformation1

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

Overview

WatchlistScreeningInformation1 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(ip_country_confidence: SKIP, info_codes: SKIP, watch_list: SKIP, additional_properties: nil) ⇒ WatchlistScreeningInformation1

Returns a new instance of WatchlistScreeningInformation1.



70
71
72
73
74
75
76
77
78
79
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information1.rb', line 70

def initialize(ip_country_confidence: SKIP, info_codes: SKIP,
               watch_list: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @ip_country_confidence = ip_country_confidence unless ip_country_confidence == SKIP
  @info_codes = info_codes unless info_codes == SKIP
  @watch_list = watch_list unless watch_list == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#info_codes ⇒ Array[String]

Returned when the Denied Parties List check (first two codes) or the export service (all others) would have declined the transaction. This field can contain one or more of these values:

  • MATCH-DPC: Denied Parties List match.
  • UNV-DPC: Denied Parties List unavailable.
  • MATCH-BCO: Billing country restricted.
  • MATCH-EMCO: Email country restricted.
  • MATCH-HCO: Host name country restricted.
  • MATCH-IPCO: IP country restricted.
  • MATCH-SCO: Shipping country restricted.

Returns:

  • (Array[String])


31
32
33
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information1.rb', line 31

def info_codes
  @info_codes
end

#ip_country_confidence ⇒ Integer

Likelihood that the country associated with the customer’s IP address was identified correctly. Returns a value from 1–100, where 100 indicates the highest likelihood. If the country cannot be determined, the value is –1.

Returns:

  • (Integer)


17
18
19
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information1.rb', line 17

def ip_country_confidence
  @ip_country_confidence
end

#watch_list ⇒ WatchList

Returned when the Denied Parties List check (first two codes) or the export service (all others) would have declined the transaction. This field can contain one or more of these values:

  • MATCH-DPC: Denied Parties List match.
  • UNV-DPC: Denied Parties List unavailable.
  • MATCH-BCO: Billing country restricted.
  • MATCH-EMCO: Email country restricted.
  • MATCH-HCO: Host name country restricted.
  • MATCH-IPCO: IP country restricted.
  • MATCH-SCO: Shipping country restricted.

Returns:



45
46
47
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information1.rb', line 45

def watch_list
  @watch_list
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information1.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ip_country_confidence =
    hash.key?('ipCountryConfidence') ? hash['ipCountryConfidence'] : SKIP
  info_codes = hash.key?('infoCodes') ? hash['infoCodes'] : SKIP
  watch_list = WatchList.from_hash(hash['watchList']) if hash['watchList']

  # 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.
  WatchlistScreeningInformation1.new(ip_country_confidence: ip_country_confidence,
                                     info_codes: info_codes,
                                     watch_list: watch_list,
                                     additional_properties: additional_properties)
end

.names ⇒ Object

A mapping from model property names to API property names.



48
49
50
51
52
53
54
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information1.rb', line 48

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ip_country_confidence'] = 'ipCountryConfidence'
  @_hash['info_codes'] = 'infoCodes'
  @_hash['watch_list'] = 'watchList'
  @_hash
end

.nullables ⇒ Object

An array for nullable fields



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

def self.nullables
  []
end

.optionals ⇒ Object

An array for optional fields



57
58
59
60
61
62
63
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information1.rb', line 57

def self.optionals
  %w[
    ip_country_confidence
    info_codes
    watch_list
  ]
end

Instance Method Details

#inspect ⇒ Object

Provides a debugging-friendly string with detailed object information.



114
115
116
117
118
119
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information1.rb', line 114

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

#to_s ⇒ Object

Provides a human-readable string representation of the object.



106
107
108
109
110
111
# File 'lib/visa_acceptance_merged_spec/models/watchlist_screening_information1.rb', line 106

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