Class: PaypalServerSdk::VenmoPaymentTokenUsageType

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

Overview

The usage type associated with the Venmo payment token.

Constant Summary collapse

VENMO_PAYMENT_TOKEN_USAGE_TYPE =
[
  # The Venmo Payment Token will be used for future transaction directly
  # with a merchant.
  MERCHANT = 'MERCHANT'.freeze,

  # The Venmo Payment Token will be used for future transaction on a
  # platform. A platform is typically a marketplace or a channel that a
  # payer can purchase goods and services from multiple merchants.
  PLATFORM = 'PLATFORM'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = MERCHANT) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb', line 26

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

  str = value.to_s.strip

  case str.downcase
  when 'merchant' then MERCHANT
  when 'platform' then PLATFORM
  else
    default_value
  end
end

.validate(value) ⇒ Object



20
21
22
23
24
# File 'lib/paypal_server_sdk/models/venmo_payment_token_usage_type.rb', line 20

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

  true
end