Class: Io::Flow::V0::Models::CaptureStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ CaptureStatus

Returns a new instance of CaptureStatus.



17578
17579
17580
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17578

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17576
17577
17578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17576

def value
  @value
end

Class Method Details

.ALLObject



17598
17599
17600
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17598

def CaptureStatus.ALL
  @@all ||= [CaptureStatus.initiated, CaptureStatus.pending, CaptureStatus.succeeded, CaptureStatus.failed, CaptureStatus.canceled]
end

.apply(value) ⇒ Object

Returns the instance of CaptureStatus for this value, creating a new instance for an unknown value



17583
17584
17585
17586
17587
17588
17589
17590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17583

def CaptureStatus.apply(value)
  if value.instance_of?(CaptureStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || CaptureStatus.new(value))
  end
end

.canceledObject

The capture was canceled.



17623
17624
17625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17623

def CaptureStatus.canceled
  @@_canceled ||= CaptureStatus.new('canceled')
end

.failedObject

The capture failed to process.



17618
17619
17620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17618

def CaptureStatus.failed
  @@_failed ||= CaptureStatus.new('failed')
end

.from_string(value) ⇒ Object

Returns the instance of CaptureStatus for this value, or nil if not found



17593
17594
17595
17596
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17593

def CaptureStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  CaptureStatus.ALL.find { |v| v.value == value }
end

.initiatedObject

The capture has been initiated but the request to the psp has not been sent.



17603
17604
17605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17603

def CaptureStatus.initiated
  @@_initiated ||= CaptureStatus.new('initiated')
end

.pendingObject

The capture is pending and requires time to complete.



17608
17609
17610
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17608

def CaptureStatus.pending
  @@_pending ||= CaptureStatus.new('pending')
end

.succeededObject

The capture has been processed successfully.



17613
17614
17615
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17613

def CaptureStatus.succeeded
  @@_succeeded ||= CaptureStatus.new('succeeded')
end

Instance Method Details

#to_hashObject



17627
17628
17629
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17627

def to_hash
  value
end