Class: PaypalServerSdk::PaypalWalletVaultStatus

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

Overview

The vault status.

Constant Summary collapse

PAYPAL_WALLET_VAULT_STATUS =
[
  # The payment source has been saved in your customer's vault. This vault
  # status reflects `/v3/vault` status.
  VAULTED = 'VAULTED'.freeze,

  # DEPRECATED. The payment source has been saved in your customer's vault.
  # This status applies to deprecated integration patterns and will not be
  # returned for v3/vault integrations.
  CREATED = 'CREATED'.freeze,

  # Customer has approved the action of saving the specified payment_source
  # into their vault. Use v3/vault/payment-tokens with given setup_token to
  # save the payment source in the vault
  APPROVED = 'APPROVED'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = VAULTED) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_status.rb', line 31

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

  str = value.to_s.strip

  case str.downcase
  when 'vaulted' then VAULTED
  when 'created' then CREATED
  when 'approved' then APPROVED
  else
    default_value
  end
end

.validate(value) ⇒ Object



25
26
27
28
29
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_status.rb', line 25

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

  true
end