Class: PaypalServerSdk::ExperienceStatus

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

Overview

This field indicates the status of PayPal’s Checkout experience throughout the order lifecycle. The values reflect the current stage of the checkout process.

Constant Summary collapse

EXPERIENCE_STATUS =
[
  # PayPal checkout process has not yet begun.

  NOT_STARTED = 'NOT_STARTED'.freeze,

  # PayPal checkout initiated. User is on the checkout page for order review

  # before approval.

  IN_PROGRESS = 'IN_PROGRESS'.freeze,

  # PayPal checkout is canceled (by closing the checkout window or clicking

  # cancel) before the order approval.

  CANCELED = 'CANCELED'.freeze,

  # Order is approved. User has completed the checkout process.

  APPROVED = 'APPROVED'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = NOT_STARTED) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/paypal_server_sdk/models/experience_status.rb', line 33

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

  str = value.to_s.strip

  case str.downcase
  when 'not_started' then NOT_STARTED
  when 'in_progress' then IN_PROGRESS
  when 'canceled' then CANCELED
  when 'approved' then APPROVED
  else
    default_value
  end
end

.validate(value) ⇒ Object



27
28
29
30
31
# File 'lib/paypal_server_sdk/models/experience_status.rb', line 27

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

  true
end