Class: ThePlaidApi::PaymentConsentPeriodicAlignment

Inherits:
Object
  • Object
show all
Defined in:
lib/the_plaid_api/models/payment_consent_periodic_alignment.rb

Overview

Where the payment consent period should start. If the institution is Monzo, only ‘CONSENT` alignments are supported. `CALENDAR`: line up with a calendar. `CONSENT`: on the date of consent creation.

Constant Summary collapse

[
  # TODO: Write general description for CALENDAR
  CALENDAR = 'CALENDAR'.freeze,

  # TODO: Write general description for CONSENT
  CONSENT = 'CONSENT'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CALENDAR) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/the_plaid_api/models/payment_consent_periodic_alignment.rb', line 25

def self.from_value(value, default_value = CALENDAR)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'calendar' then CALENDAR
  when 'consent' then CONSENT
  else
    default_value
  end
end

.validate(value) ⇒ Object



19
20
21
22
23
# File 'lib/the_plaid_api/models/payment_consent_periodic_alignment.rb', line 19

def self.validate(value)
  return false if value.nil?

  PAYMENT_CONSENT_PERIODIC_ALIGNMENT.include?(value)
end