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



10075
10076
10077
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10075

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10073
10074
10075
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10073

def value
  @value
end

Class Method Details

.ALLObject



10095
10096
10097
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10095

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



10080
10081
10082
10083
10084
10085
10086
10087
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10080

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



10100
10101
10102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10100

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



10090
10091
10092
10093
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10090

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



10105
10106
10107
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10105

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

.unknownObject

Failed due to another reason (details not known)



10110
10111
10112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10110

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

Instance Method Details

#to_hashObject



10114
10115
10116
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10114

def to_hash
  value
end