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.



14328
14329
14330
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14328

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14326
14327
14328
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14326

def value
  @value
end

Class Method Details

.ALLObject



14348
14349
14350
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14348

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



14333
14334
14335
14336
14337
14338
14339
14340
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14333

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



14353
14354
14355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14353

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



14343
14344
14345
14346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14343

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



14358
14359
14360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14358

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

.unknownObject

Failed due to another reason (details not known)



14363
14364
14365
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14363

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

Instance Method Details

#to_hashObject



14367
14368
14369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14367

def to_hash
  value
end