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.



4580
4581
4582
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4580

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



4578
4579
4580
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4578

def value
  @value
end

Class Method Details

.ALLObject



4600
4601
4602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4600

def CaptureDeclineCode.ALL
  @@all ||= [CaptureDeclineCode.expired, CaptureDeclineCode.unknown]
end

.apply(value) ⇒ Object

Returns the instance of CaptureDeclineCode for this value, creating a new instance for an unknown value



4585
4586
4587
4588
4589
4590
4591
4592
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4585

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



4605
4606
4607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4605

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



4595
4596
4597
4598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4595

def CaptureDeclineCode.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  CaptureDeclineCode.ALL.find { |v| v.value == value }
end

.unknownObject

Failed due to another reason (details not known)



4610
4611
4612
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4610

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

Instance Method Details

#to_hashObject



4614
4615
4616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4614

def to_hash
  value
end