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.



22576
22577
22578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22576

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



22574
22575
22576
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22574

def value
  @value
end

Class Method Details

.ALLObject



22596
22597
22598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22596

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



22581
22582
22583
22584
22585
22586
22587
22588
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22581

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



22601
22602
22603
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22601

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



22591
22592
22593
22594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22591

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



22606
22607
22608
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22606

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

.unknownObject

Failed due to another reason (details not known)



22611
22612
22613
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22611

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

Instance Method Details

#to_hashObject



22615
22616
22617
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22615

def to_hash
  value
end