Class: PaypalServerSdk::PaypalPaymentTokenCustomerType

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

Overview

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

Constant Summary collapse

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

  # The customer vaulting the PayPal 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



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/paypal_server_sdk/models/paypal_payment_token_customer_type.rb', line 29

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



23
24
25
26
27
# File 'lib/paypal_server_sdk/models/paypal_payment_token_customer_type.rb', line 23

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

  true
end