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.



16165
16166
16167
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16165

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16163
16164
16165
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16163

def value
  @value
end

Class Method Details

.ALLObject



16185
16186
16187
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16185

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



16170
16171
16172
16173
16174
16175
16176
16177
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16170

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.



16195
16196
16197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16195

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

.declinedObject

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



16200
16201
16202
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16200

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



16180
16181
16182
16183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16180

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



16190
16191
16192
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16190

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

.reviewObject

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



16206
16207
16208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16206

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

Instance Method Details

#to_hashObject



16210
16211
16212
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16210

def to_hash
  value
end