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.



16264
16265
16266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16264

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16262
16263
16264
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16262

def value
  @value
end

Class Method Details

.ALLObject



16284
16285
16286
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16284

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



16269
16270
16271
16272
16273
16274
16275
16276
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16269

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.



16294
16295
16296
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16294

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

.declinedObject

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



16299
16300
16301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16299

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



16279
16280
16281
16282
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16279

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



16289
16290
16291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16289

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

.reviewObject

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



16305
16306
16307
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16305

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

Instance Method Details

#to_hashObject



16309
16310
16311
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16309

def to_hash
  value
end