Class: PaypalServerSdk::PaypalExperienceLandingPage

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

Overview

The type of landing page to show on the PayPal site for customer checkout.

Constant Summary collapse

PAYPAL_EXPERIENCE_LANDING_PAGE =
[
  # When the customer clicks PayPal Checkout, the customer is redirected to
  # a page to log in to PayPal and approve the payment.
  LOGIN = 'LOGIN'.freeze,

  # When the customer clicks PayPal Checkout, the customer is redirected to
  # a page to enter credit or debit card and other relevant billing
  # information required to complete the purchase. This option has
  # previously been also called as 'BILLING'
  GUEST_CHECKOUT = 'GUEST_CHECKOUT'.freeze,

  # When the customer clicks PayPal Checkout, the customer is redirected to
  # either a page to log in to PayPal and approve the payment or to a page
  # to enter credit or debit card and other relevant billing information
  # required to complete the purchase, depending on their previous
  # interaction with PayPal.
  NO_PREFERENCE = 'NO_PREFERENCE'.freeze,

  # DEPRECATED - please use GUEST_CHECKOUT. All implementations of 'BILLING'
  # will be routed to 'GUEST_CHECKOUT'. When the customer clicks PayPal
  # Checkout, the customer is redirected to a page to enter credit or debit
  # card and other relevant billing information required to complete the
  # purchase.
  BILLING = 'BILLING'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = LOGIN) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/paypal_server_sdk/models/paypal_experience_landing_page.rb', line 41

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

  str = value.to_s.strip

  case str.downcase
  when 'login' then LOGIN
  when 'guest_checkout' then GUEST_CHECKOUT
  when 'no_preference' then NO_PREFERENCE
  when 'billing' then BILLING
  else
    default_value
  end
end

.validate(value) ⇒ Object



35
36
37
38
39
# File 'lib/paypal_server_sdk/models/paypal_experience_landing_page.rb', line 35

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

  true
end