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.



5318
5319
5320
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5318

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



5316
5317
5318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5316

def value
  @value
end

Class Method Details

.ALLObject



5338
5339
5340
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5338

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



5323
5324
5325
5326
5327
5328
5329
5330
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5323

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



5343
5344
5345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5343

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



5333
5334
5335
5336
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5333

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



5348
5349
5350
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5348

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

.unknownObject

Failed due to another reason (details not known)



5353
5354
5355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5353

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

Instance Method Details

#to_hashObject



5357
5358
5359
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5357

def to_hash
  value
end