Class: PaypalServerSdk::DisbursementMode

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

Overview

The funds that are held on behalf of the merchant.

Constant Summary collapse

DISBURSEMENT_MODE =
[
  # The funds are released to the merchant immediately.

  INSTANT = 'INSTANT'.freeze,

  # The funds are held for a finite number of days. The actual duration

  # depends on the region and type of integration. You can release the funds

  # through a referenced payout. Otherwise, the funds disbursed

  # automatically after the specified duration.

  DELAYED = 'DELAYED'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = INSTANT) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'instant' then INSTANT
  when 'delayed' then DELAYED
  else
    default_value
  end
end

.validate(value) ⇒ Object



20
21
22
23
24
# File 'lib/paypal_server_sdk/models/disbursement_mode.rb', line 20

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

  true
end