Class: ThePlaidApi::PaymentInitiationConsentConstraints
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::PaymentInitiationConsentConstraints
- Defined in:
- lib/the_plaid_api/models/payment_initiation_consent_constraints.rb
Overview
Limitations that will be applied to payments initiated using the payment consent.
Instance Attribute Summary collapse
-
#max_payment_amount ⇒ PaymentAmount
Maximum amount of a single payment initiated using the payment consent.
-
#periodic_amounts ⇒ Array[PaymentConsentPeriodicAmount]
A list of amount limitations per period of time.
-
#valid_date_time ⇒ PaymentConsentValidDateTime
Life span for the payment consent.
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(max_payment_amount:, periodic_amounts:, valid_date_time: SKIP, additional_properties: nil) ⇒ PaymentInitiationConsentConstraints
constructor
A new instance of PaymentInitiationConsentConstraints.
-
#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(max_payment_amount:, periodic_amounts:, valid_date_time: SKIP, additional_properties: nil) ⇒ PaymentInitiationConsentConstraints
Returns a new instance of PaymentInitiationConsentConstraints.
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 49 def initialize(max_payment_amount:, periodic_amounts:, valid_date_time: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @valid_date_time = valid_date_time unless valid_date_time == SKIP @max_payment_amount = max_payment_amount @periodic_amounts = periodic_amounts @additional_properties = additional_properties end |
Instance Attribute Details
#max_payment_amount ⇒ PaymentAmount
Maximum amount of a single payment initiated using the payment consent.
20 21 22 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 20 def max_payment_amount @max_payment_amount end |
#periodic_amounts ⇒ Array[PaymentConsentPeriodicAmount]
A list of amount limitations per period of time.
24 25 26 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 24 def periodic_amounts @periodic_amounts end |
#valid_date_time ⇒ PaymentConsentValidDateTime
Life span for the payment consent. After the ‘to` date the payment consent expires and can no longer be used for payment initiation.
16 17 18 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 16 def valid_date_time @valid_date_time end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. max_payment_amount = PaymentAmount.from_hash(hash['max_payment_amount']) if hash['max_payment_amount'] # Parameter is an array, so we need to iterate through it periodic_amounts = nil unless hash['periodic_amounts'].nil? periodic_amounts = [] hash['periodic_amounts'].each do |structure| periodic_amounts << (PaymentConsentPeriodicAmount.from_hash(structure) if structure) end end periodic_amounts = nil unless hash.key?('periodic_amounts') valid_date_time = PaymentConsentValidDateTime.from_hash(hash['valid_date_time']) if hash['valid_date_time'] # 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. PaymentInitiationConsentConstraints.new(max_payment_amount: max_payment_amount, periodic_amounts: periodic_amounts, valid_date_time: valid_date_time, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 33 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['valid_date_time'] = 'valid_date_time' @_hash['max_payment_amount'] = 'max_payment_amount' @_hash['periodic_amounts'] = 'periodic_amounts' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 46 47 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 43 def self.nullables %w[ valid_date_time ] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 39 40 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 36 def self.optionals %w[ valid_date_time ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
103 104 105 106 107 108 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 103 def inspect class_name = self.class.name.split('::').last "<#{class_name} valid_date_time: #{@valid_date_time.inspect}, max_payment_amount:"\ " #{@max_payment_amount.inspect}, periodic_amounts: #{@periodic_amounts.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 100 |
# File 'lib/the_plaid_api/models/payment_initiation_consent_constraints.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} valid_date_time: #{@valid_date_time}, max_payment_amount:"\ " #{@max_payment_amount}, periodic_amounts: #{@periodic_amounts}, additional_properties:"\ " #{@additional_properties}>" end |