Class: Io::Flow::V0::Models::RefundDeclineCode

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) ⇒ RefundDeclineCode

Returns a new instance of RefundDeclineCode.



15017
15018
15019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15017

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15015
15016
15017
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15015

def value
  @value
end

Class Method Details

.ALLObject



15037
15038
15039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15037

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

.apply(value) ⇒ Object

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



15022
15023
15024
15025
15026
15027
15028
15029
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15022

def RefundDeclineCode.apply(value)
  if value.instance_of?(RefundDeclineCode)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || RefundDeclineCode.new(value))
  end
end

.expiredObject

All associated payment captures have expired; refunds can no longer be issued



15042
15043
15044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15042

def RefundDeclineCode.expired
  @@_expired ||= RefundDeclineCode.new('expired')
end

.from_string(value) ⇒ Object

Returns the instance of RefundDeclineCode for this value, or nil if not found



15032
15033
15034
15035
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15032

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

.insufficient_fundsObject

The requested refund amount exceeded the amount of remaining unrefunded funds



15047
15048
15049
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15047

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

.unknownObject

Failed due to another reason (details not known)



15052
15053
15054
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15052

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

Instance Method Details

#to_hashObject



15056
15057
15058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15056

def to_hash
  value
end