Class: UnivapayClientSdk::RecurringCvvConfirmation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::RecurringCvvConfirmation
- Defined in:
- lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb
Overview
CVV re-confirmation policy applied to recurring card charges (subscriptions and tokens with recurring privilege).
Instance Attribute Summary collapse
-
#enabled ⇒ TrueClass | FalseClass
Whether CVV re-confirmation is required for recurring card charges.
-
#threshold ⇒ Array[CheckoutMoneyAmount]
Amount thresholds above which CVV re-confirmation is required.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(enabled: SKIP, threshold: SKIP, additional_properties: nil) ⇒ RecurringCvvConfirmation
constructor
A new instance of RecurringCvvConfirmation.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(enabled: SKIP, threshold: SKIP, additional_properties: nil) ⇒ RecurringCvvConfirmation
Returns a new instance of RecurringCvvConfirmation.
46 47 48 49 50 51 52 53 |
# File 'lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb', line 46 def initialize(enabled: SKIP, threshold: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @enabled = enabled unless enabled == SKIP @threshold = threshold unless threshold == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#enabled ⇒ TrueClass | FalseClass
Whether CVV re-confirmation is required for recurring card charges.
Resolves to false when not configured.
16 17 18 |
# File 'lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb', line 16 def enabled @enabled end |
#threshold ⇒ Array[CheckoutMoneyAmount]
Amount thresholds above which CVV re-confirmation is required. null when
no threshold is configured.
21 22 23 |
# File 'lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb', line 21 def threshold @threshold end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. enabled = hash.key?('enabled') ? hash['enabled'] : SKIP # Parameter is an array, so we need to iterate through it threshold = nil unless hash['threshold'].nil? threshold = [] hash['threshold'].each do |structure| threshold << (CheckoutMoneyAmount.from_hash(structure) if structure) end end threshold = SKIP unless hash.key?('threshold') # 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. RecurringCvvConfirmation.new(enabled: enabled, threshold: threshold, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
24 25 26 27 28 29 |
# File 'lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb', line 24 def self.names @_hash = {} if @_hash.nil? @_hash['enabled'] = 'enabled' @_hash['threshold'] = 'threshold' @_hash end |
.nullables ⇒ Object
An array for nullable fields
40 41 42 43 44 |
# File 'lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb', line 40 def self.nullables %w[ threshold ] end |
.optionals ⇒ Object
An array for optional fields
32 33 34 35 36 37 |
# File 'lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb', line 32 def self.optionals %w[ enabled threshold ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
93 94 95 96 97 |
# File 'lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb', line 93 def inspect class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled.inspect}, threshold: #{@threshold.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
86 87 88 89 90 |
# File 'lib/univapay_client_sdk/models/recurring_cvv_confirmation.rb', line 86 def to_s class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled}, threshold: #{@threshold}, additional_properties:"\ " #{@additional_properties}>" end |