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.



12739
12740
12741
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12739

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12737
12738
12739
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12737

def value
  @value
end

Class Method Details

.ALLObject



12759
12760
12761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12759

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



12744
12745
12746
12747
12748
12749
12750
12751
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12744

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



12764
12765
12766
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12764

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



12754
12755
12756
12757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12754

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



12769
12770
12771
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12769

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

.unknownObject

Failed due to another reason (details not known)



12774
12775
12776
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12774

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

Instance Method Details

#to_hashObject



12778
12779
12780
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12778

def to_hash
  value
end