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.



18365
18366
18367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18365

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18363
18364
18365
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18363

def value
  @value
end

Class Method Details

.ALLObject



18385
18386
18387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18385

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



18370
18371
18372
18373
18374
18375
18376
18377
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18370

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



18390
18391
18392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18390

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



18380
18381
18382
18383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18380

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



18395
18396
18397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18395

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

.unknownObject

Failed due to another reason (details not known)



18400
18401
18402
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18400

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

Instance Method Details

#to_hashObject



18404
18405
18406
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18404

def to_hash
  value
end