Class: Io::Flow::V0::Models::FraudStatus

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

Returns a new instance of FraudStatus.



20803
20804
20805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20803

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20801
20802
20803
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20801

def value
  @value
end

Class Method Details

.ALLObject



20823
20824
20825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20823

def FraudStatus.ALL
  @@all ||= [FraudStatus.pending, FraudStatus.approved, FraudStatus.declined, FraudStatus.review]
end

.apply(value) ⇒ Object

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



20808
20809
20810
20811
20812
20813
20814
20815
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20808

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

.approvedObject

Fraud check has passed and the order is approved.



20833
20834
20835
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20833

def FraudStatus.approved
  @@_approved ||= FraudStatus.new('approved')
end

.declinedObject

Indicates the fraud check has been declined by the fraud providing service.



20838
20839
20840
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20838

def FraudStatus.declined
  @@_declined ||= FraudStatus.new('declined')
end

.from_string(value) ⇒ Object

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



20818
20819
20820
20821
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20818

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

.pendingObject

If an immediate response is not available, the state will be ‘pending’.



20828
20829
20830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20828

def FraudStatus.pending
  @@_pending ||= FraudStatus.new('pending')
end

.reviewObject

Indicates the fraud check decision from the fraud providing service is being reviewed.



20844
20845
20846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20844

def FraudStatus.review
  @@_review ||= FraudStatus.new('review')
end

Instance Method Details

#to_hashObject



20848
20849
20850
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20848

def to_hash
  value
end