Class: FdxV660Api::PaymentStatus3

Inherits:
Object
  • Object
show all
Defined in:
lib/fdx_v660_api/models/payment_status3.rb

Overview

Defines the status of the payment

Constant Summary collapse

PAYMENT_STATUS3 =
[
  # TODO: Write general description for CANCELLED
  CANCELLED = 'CANCELLED'.freeze,

  # TODO: Write general description for FAILED
  FAILED = 'FAILED'.freeze,

  # TODO: Write general description for NOFUNDS
  NOFUNDS = 'NOFUNDS'.freeze,

  # TODO: Write general description for PROCESSED
  PROCESSED = 'PROCESSED'.freeze,

  # TODO: Write general description for PROCESSING
  PROCESSING = 'PROCESSING'.freeze,

  # TODO: Write general description for SCHEDULED
  SCHEDULED = 'SCHEDULED'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CANCELLED) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/fdx_v660_api/models/payment_status3.rb', line 35

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

  str = value.to_s.strip

  case str.downcase
  when 'cancelled' then CANCELLED
  when 'failed' then FAILED
  when 'nofunds' then NOFUNDS
  when 'processed' then PROCESSED
  when 'processing' then PROCESSING
  when 'scheduled' then SCHEDULED
  else
    default_value
  end
end

.validate(value) ⇒ Object



29
30
31
32
33
# File 'lib/fdx_v660_api/models/payment_status3.rb', line 29

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

  true
end