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.



15307
15308
15309
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15307

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

Instance Attribute Details

#value ⇒ Object (readonly)

Returns the value of attribute value.



15305
15306
15307
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15305

def value
  @value
end

Class Method Details

.ALL ⇒ Object



15327
15328
15329
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15327

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



15312
15313
15314
15315
15316
15317
15318
15319
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15312

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

.approved ⇒ Object

Fraud check has passed and the order is approved.



15337
15338
15339
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15337

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

.declined ⇒ Object

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



15342
15343
15344
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15342

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



15322
15323
15324
15325
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15322

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

.pending ⇒ Object

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



15332
15333
15334
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15332

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

.review ⇒ Object

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



15348
15349
15350
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15348

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

Instance Method Details

#to_hash ⇒ Object



15352
15353
15354
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15352

def to_hash
  value
end