Class: FdxV660Api::RequestForPaymentStatus

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

Overview

Defines the Request For Payment lifecycle. * ACCEPTED: The RFP was authorized and payment transaction is complete or processing * BLOCKED: The RFP was authorized but payment requested was blocked * CANCELLED: The RFP was authorized but payment requested was cancelled * EXPIRED: The Request for Payment has expired before action * PARTIALLY_ACCEPTED: The RFP was authorized and payment requested is partially accepted / processing * PENDING: The RFP was authorized and payment requested is now pending * PRESENTED: Request for Payment has been presented to the Debtor and awaits authorization * RECEIVED: The RFP was authorized and payment instruction has been received by Debtor * REJECTED: The RFP was authorized but payment transaction has been rejected

Constant Summary collapse

REQUEST_FOR_PAYMENT_STATUS =
[
  # TODO: Write general description for ACCEPTED
  ACCEPTED = 'ACCEPTED'.freeze,

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

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

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

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

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ACCEPTED) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/fdx_v660_api/models/request_for_payment_status.rb', line 54

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

  str = value.to_s.strip

  case str.downcase
  when 'accepted' then ACCEPTED
  when 'blocked' then BLOCKED
  when 'cancelled' then CANCELLED
  when 'expired' then EXPIRED
  when 'partially_accepted' then PARTIALLY_ACCEPTED
  when 'pending' then PENDING
  when 'presented' then PRESENTED
  when 'received' then RECEIVED
  when 'rejected' then REJECTED
  else
    default_value
  end
end

.validate(value) ⇒ Object



48
49
50
51
52
# File 'lib/fdx_v660_api/models/request_for_payment_status.rb', line 48

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

  true
end