Class: Io::Flow::V0::Models::ReversalErrorCode

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

Returns a new instance of ReversalErrorCode.



10470
10471
10472
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10470

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10468
10469
10470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10468

def value
  @value
end

Class Method Details

.ALLObject



10490
10491
10492
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10490

def ReversalErrorCode.ALL
  @@all ||= [ReversalErrorCode.authorization_declined, ReversalErrorCode.authorization_reversed, ReversalErrorCode.authorization_captured, ReversalErrorCode.unknown]
end

.apply(value) ⇒ Object

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



10475
10476
10477
10478
10479
10480
10481
10482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10475

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

.authorization_capturedObject

It’s too late to reverse the authorization, because it has already been captured. Create a refund instead.



10506
10507
10508
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10506

def ReversalErrorCode.authorization_captured
  @@_authorization_captured ||= ReversalErrorCode.new('authorization_captured')
end

.authorization_declinedObject

The authorization has been declined.



10495
10496
10497
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10495

def ReversalErrorCode.authorization_declined
  @@_authorization_declined ||= ReversalErrorCode.new('authorization_declined')
end

.authorization_reversedObject

The authorization has already been reversed.



10500
10501
10502
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10500

def ReversalErrorCode.authorization_reversed
  @@_authorization_reversed ||= ReversalErrorCode.new('authorization_reversed')
end

.from_string(value) ⇒ Object

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



10485
10486
10487
10488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10485

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

.unknownObject

Unknown or other



10511
10512
10513
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10511

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

Instance Method Details

#to_hashObject



10515
10516
10517
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10515

def to_hash
  value
end