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.



14663
14664
14665
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14663

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14661
14662
14663
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14661

def value
  @value
end

Class Method Details

.ALLObject



14683
14684
14685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14683

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



14668
14669
14670
14671
14672
14673
14674
14675
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14668

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.



14693
14694
14695
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14693

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

.declinedObject

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



14698
14699
14700
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14698

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



14678
14679
14680
14681
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14678

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



14688
14689
14690
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14688

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

.reviewObject

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



14704
14705
14706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14704

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

Instance Method Details

#to_hashObject



14708
14709
14710
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14708

def to_hash
  value
end