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.



6102
6103
6104
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6102

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6100
6101
6102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6100

def value
  @value
end

Class Method Details

.ALLObject



6122
6123
6124
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6122

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



6107
6108
6109
6110
6111
6112
6113
6114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6107

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



6127
6128
6129
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6127

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



6117
6118
6119
6120
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6117

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



6132
6133
6134
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6132

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

.unknownObject

Failed due to another reason (details not known)



6137
6138
6139
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6137

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

Instance Method Details

#to_hashObject



6141
6142
6143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6141

def to_hash
  value
end