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.



6285
6286
6287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6285

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6283
6284
6285
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6283

def value
  @value
end

Class Method Details

.ALLObject



6305
6306
6307
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6305

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



6290
6291
6292
6293
6294
6295
6296
6297
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6290

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



6310
6311
6312
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6310

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



6300
6301
6302
6303
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6300

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



6315
6316
6317
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6315

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

.unknownObject

Failed due to another reason (details not known)



6320
6321
6322
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6320

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

Instance Method Details

#to_hashObject



6324
6325
6326
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6324

def to_hash
  value
end