Class: VisaAcceptanceMergedSpec::StrongAuthentication2

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

Overview

StrongAuthentication2 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(low_value_exemption_indicator: SKIP, risk_analysis_exemption_indicator: SKIP, trusted_merchant_exemption_indicator: SKIP, secure_corporate_payment_indicator: SKIP, delegated_authentication_exemption_indicator: SKIP, additional_properties: nil) ⇒ StrongAuthentication2

Returns a new instance of StrongAuthentication2.



87
88
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
114
115
116
117
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 87

def initialize(low_value_exemption_indicator: SKIP,
               risk_analysis_exemption_indicator: SKIP,
               trusted_merchant_exemption_indicator: SKIP,
               secure_corporate_payment_indicator: SKIP,
               delegated_authentication_exemption_indicator: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  unless low_value_exemption_indicator == SKIP
    @low_value_exemption_indicator =
      low_value_exemption_indicator
  end
  unless risk_analysis_exemption_indicator == SKIP
    @risk_analysis_exemption_indicator =
      risk_analysis_exemption_indicator
  end
  unless trusted_merchant_exemption_indicator == SKIP
    @trusted_merchant_exemption_indicator =
      trusted_merchant_exemption_indicator
  end
  unless secure_corporate_payment_indicator == SKIP
    @secure_corporate_payment_indicator =
      secure_corporate_payment_indicator
  end
  unless delegated_authentication_exemption_indicator == SKIP
    @delegated_authentication_exemption_indicator =
      delegated_authentication_exemption_indicator
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#delegated_authentication_exemption_indicatorString

This field will contain the delegated authentication exemption indicator with one of the following values: Possible values:

  • 0 (delegated Authentication exemption does not apply to the transaction)
  • 1 (Transaction exempt from SCA as authentication has been delegated to other provider (PSP,Acquirer))

Returns:

  • (String)


54
55
56
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 54

def delegated_authentication_exemption_indicator
  @delegated_authentication_exemption_indicator
end

#low_value_exemption_indicatorString

This field will contain the low value exemption indicator with one of the following values: Possible values:

  • 0 ( low value exemption does not apply to the transaction)
  • 1 (Transaction exempt from SCA as the merchant/acquirer has determined it to be a low value payment)

Returns:

  • (String)


19
20
21
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 19

def low_value_exemption_indicator
  @low_value_exemption_indicator
end

#risk_analysis_exemption_indicatorString

This field will contain the transaction risk analysis exemption indicator with one of the following values: Possible values:

  • 0 (TRA exemption does not apply to the transaction)
  • 1 (Transaction exempt from SCA as the merchant/acquirer has determined it to be low risk in accordance with the criteria defined by PSD2/RTS)

Returns:

  • (String)


28
29
30
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 28

def risk_analysis_exemption_indicator
  @risk_analysis_exemption_indicator
end

#secure_corporate_payment_indicatorString

This field will contain the secure corporate payment exemption indicator with one of the following values: Possible values:

  • 0 (SCA exemption does not apply to the transaction)
  • 1 (Transaction exempt from SCA as the merchant/acquirer has determined it as a secure corporate payment)

Returns:

  • (String)


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

def secure_corporate_payment_indicator
  @secure_corporate_payment_indicator
end

#trusted_merchant_exemption_indicatorString

Possible values:

  • 0 (Trusted merchant exemption does not apply to the transaction)
  • 1 (Transaction exempt from SCA as it originated at a merchant trusted by the cardholder)

Returns:

  • (String)


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

def trusted_merchant_exemption_indicator
  @trusted_merchant_exemption_indicator
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 120

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  low_value_exemption_indicator =
    hash.key?('lowValueExemptionIndicator') ? hash['lowValueExemptionIndicator'] : SKIP
  risk_analysis_exemption_indicator =
    hash.key?('riskAnalysisExemptionIndicator') ? hash['riskAnalysisExemptionIndicator'] : SKIP
  trusted_merchant_exemption_indicator =
    hash.key?('trustedMerchantExemptionIndicator') ? hash['trustedMerchantExemptionIndicator'] : SKIP
  secure_corporate_payment_indicator =
    hash.key?('secureCorporatePaymentIndicator') ? hash['secureCorporatePaymentIndicator'] : SKIP
  delegated_authentication_exemption_indicator =
    hash.key?('delegatedAuthenticationExemptionIndicator') ? hash['delegatedAuthenticationExemptionIndicator'] : 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.
  StrongAuthentication2.new(low_value_exemption_indicator: low_value_exemption_indicator,
                            risk_analysis_exemption_indicator: risk_analysis_exemption_indicator,
                            trusted_merchant_exemption_indicator: trusted_merchant_exemption_indicator,
                            secure_corporate_payment_indicator: secure_corporate_payment_indicator,
                            delegated_authentication_exemption_indicator: delegated_authentication_exemption_indicator,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['low_value_exemption_indicator'] = 'lowValueExemptionIndicator'
  @_hash['risk_analysis_exemption_indicator'] =
    'riskAnalysisExemptionIndicator'
  @_hash['trusted_merchant_exemption_indicator'] =
    'trustedMerchantExemptionIndicator'
  @_hash['secure_corporate_payment_indicator'] =
    'secureCorporatePaymentIndicator'
  @_hash['delegated_authentication_exemption_indicator'] =
    'delegatedAuthenticationExemptionIndicator'
  @_hash
end

.nullablesObject

An array for nullable fields



83
84
85
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 83

def self.nullables
  []
end

.optionalsObject

An array for optional fields



72
73
74
75
76
77
78
79
80
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 72

def self.optionals
  %w[
    low_value_exemption_indicator
    risk_analysis_exemption_indicator
    trusted_merchant_exemption_indicator
    secure_corporate_payment_indicator
    delegated_authentication_exemption_indicator
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



164
165
166
167
168
169
170
171
172
173
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 164

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} low_value_exemption_indicator: #{@low_value_exemption_indicator.inspect},"\
  " risk_analysis_exemption_indicator: #{@risk_analysis_exemption_indicator.inspect},"\
  " trusted_merchant_exemption_indicator: #{@trusted_merchant_exemption_indicator.inspect},"\
  " secure_corporate_payment_indicator: #{@secure_corporate_payment_indicator.inspect},"\
  ' delegated_authentication_exemption_indicator:'\
  " #{@delegated_authentication_exemption_indicator.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



152
153
154
155
156
157
158
159
160
161
# File 'lib/visa_acceptance_merged_spec/models/strong_authentication2.rb', line 152

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} low_value_exemption_indicator: #{@low_value_exemption_indicator},"\
  " risk_analysis_exemption_indicator: #{@risk_analysis_exemption_indicator},"\
  " trusted_merchant_exemption_indicator: #{@trusted_merchant_exemption_indicator},"\
  " secure_corporate_payment_indicator: #{@secure_corporate_payment_indicator},"\
  ' delegated_authentication_exemption_indicator:'\
  " #{@delegated_authentication_exemption_indicator}, additional_properties:"\
  " #{@additional_properties}>"
end