Class: PaypalServerSdk::VenmoPaymentTokenCustomerType

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

Overview

The customer type associated with the Venmo payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

Constant Summary collapse

VENMO_PAYMENT_TOKEN_CUSTOMER_TYPE =
[
  # The customer vaulting the Venmo payment token is a consumer on the
  # merchant / platform.
  CONSUMER = 'CONSUMER'.freeze,

  # The customer vaulting the Venmo payment token is a business on merchant
  # / platform.
  BUSINESS = 'BUSINESS'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CONSUMER) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'consumer' then CONSUMER
  when 'business' then BUSINESS
  else
    default_value
  end
end

.validate(value) ⇒ Object



21
22
23
24
25
# File 'lib/paypal_server_sdk/models/venmo_payment_token_customer_type.rb', line 21

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

  true
end