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.



6658
6659
6660
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6658

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6656
6657
6658
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6656

def value
  @value
end

Class Method Details

.ALLObject



6678
6679
6680
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6678

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



6663
6664
6665
6666
6667
6668
6669
6670
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6663

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



6683
6684
6685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6683

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



6673
6674
6675
6676
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6673

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



6688
6689
6690
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6688

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

.unknownObject

Failed due to another reason (details not known)



6693
6694
6695
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6693

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

Instance Method Details

#to_hashObject



6697
6698
6699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6697

def to_hash
  value
end