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.



8995
8996
8997
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8995

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8993
8994
8995
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8993

def value
  @value
end

Class Method Details

.ALLObject



9015
9016
9017
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9015

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

.apply(value) ⇒ Object

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



9000
9001
9002
9003
9004
9005
9006
9007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9000

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.



9025
9026
9027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9025

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

.declinedObject

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



9030
9031
9032
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9030

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



9010
9011
9012
9013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9010

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’.



9020
9021
9022
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9020

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

Instance Method Details

#to_hashObject



9034
9035
9036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9034

def to_hash
  value
end