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.



7044
7045
7046
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7044

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7042
7043
7044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7042

def value
  @value
end

Class Method Details

.ALLObject



7064
7065
7066
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7064

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



7049
7050
7051
7052
7053
7054
7055
7056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7049

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



7069
7070
7071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7069

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



7059
7060
7061
7062
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7059

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



7074
7075
7076
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7074

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

.unknownObject

Failed due to another reason (details not known)



7079
7080
7081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7079

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

Instance Method Details

#to_hashObject



7083
7084
7085
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7083

def to_hash
  value
end