Class: PaypalServerSdk::SubscriptionPricingModel

Inherits:
Object
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/subscription_pricing_model.rb

Overview

The pricing model for tiered plan. The ‘tiers` parameter is required.

Constant Summary collapse

SUBSCRIPTION_PRICING_MODEL =
[
  # A volume pricing model.
  VOLUME = 'VOLUME'.freeze,

  # A tiered pricing model.
  TIERED = 'TIERED'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = VOLUME) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/paypal_server_sdk/models/subscription_pricing_model.rb', line 23

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

  str = value.to_s.strip

  case str.downcase
  when 'volume' then VOLUME
  when 'tiered' then TIERED
  else
    default_value
  end
end

.validate(value) ⇒ Object



17
18
19
20
21
# File 'lib/paypal_server_sdk/models/subscription_pricing_model.rb', line 17

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

  true
end