Class: UnivapayClientSdk::ChargeTransactionTokenType
- Inherits:
-
Object
- Object
- UnivapayClientSdk::ChargeTransactionTokenType
- Defined in:
- lib/univapay_client_sdk/models/charge_transaction_token_type.rb
Overview
Charge Transaction Token Type schema.
Constant Summary collapse
- CHARGE_TRANSACTION_TOKEN_TYPE =
[ # TODO: Write general description for ONE_TIME ONE_TIME = 'one_time'.freeze, # TODO: Write general description for SUBSCRIPTION SUBSCRIPTION = 'subscription'.freeze, # TODO: Write general description for RECURRING RECURRING = 'recurring'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ONE_TIME) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/univapay_client_sdk/models/charge_transaction_token_type.rb', line 26 def self.from_value(value, default_value = ONE_TIME) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'one_time' then ONE_TIME when 'subscription' then SUBSCRIPTION when 'recurring' then RECURRING else default_value end end |
.validate(value) ⇒ Object
20 21 22 23 24 |
# File 'lib/univapay_client_sdk/models/charge_transaction_token_type.rb', line 20 def self.validate(value) return false if value.nil? CHARGE_TRANSACTION_TOKEN_TYPE.include?(value) end |