Class: Io::Flow::V0::Models::CaptureDeclineCode

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) ⇒ CaptureDeclineCode

Returns a new instance of CaptureDeclineCode.



7857
7858
7859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7857

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7855
7856
7857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7855

def value
  @value
end

Class Method Details

.ALLObject



7877
7878
7879
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7877

def CaptureDeclineCode.ALL
  @@all ||= [CaptureDeclineCode.expired, CaptureDeclineCode.insufficient_funds, CaptureDeclineCode.unknown]
end

.apply(value) ⇒ Object

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



7862
7863
7864
7865
7866
7867
7868
7869
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7862

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

.expiredObject

Payment authorization has expired



7882
7883
7884
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7882

def CaptureDeclineCode.expired
  @@_expired ||= CaptureDeclineCode.new('expired')
end

.from_string(value) ⇒ Object

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



7872
7873
7874
7875
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7872

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

.insufficient_fundsObject

The amount to capture exceeded the amount authorized and not yet captured



7887
7888
7889
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7887

def CaptureDeclineCode.insufficient_funds
  @@_insufficient_funds ||= CaptureDeclineCode.new('insufficient_funds')
end

.unknownObject

Failed due to another reason (details not known)



7892
7893
7894
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7892

def CaptureDeclineCode.unknown
  @@_unknown ||= CaptureDeclineCode.new('unknown')
end

Instance Method Details

#to_hashObject



7896
7897
7898
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7896

def to_hash
  value
end