Class: PaypalServerSdk::PayeePaymentMethodPreference

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

Overview

The merchant-preferred payment methods.

Constant Summary collapse

PAYEE_PAYMENT_METHOD_PREFERENCE =
[
  # Accepts any type of payment from the customer.
  UNRESTRICTED = 'UNRESTRICTED'.freeze,

  # Accepts only immediate payment from the customer. For example, credit
  # card, PayPal balance, or instant ACH. Ensures that at the time of
  # capture, the payment does not have the `pending` status.
  IMMEDIATE_PAYMENT_REQUIRED = 'IMMEDIATE_PAYMENT_REQUIRED'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = UNRESTRICTED) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'unrestricted' then UNRESTRICTED
  when 'immediate_payment_required' then IMMEDIATE_PAYMENT_REQUIRED
  else
    default_value
  end
end

.validate(value) ⇒ Object



19
20
21
22
23
# File 'lib/paypal_server_sdk/models/payee_payment_method_preference.rb', line 19

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

  true
end