Class: Io::Flow::V0::Models::AuthorizationStatus

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) ⇒ AuthorizationStatus

Returns a new instance of AuthorizationStatus.



4379
4380
4381
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4379

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



4377
4378
4379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4377

def value
  @value
end

Class Method Details

.ALLObject



4399
4400
4401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4399

def AuthorizationStatus.ALL
  @@all ||= [AuthorizationStatus.pending, AuthorizationStatus.pending_call_bank, AuthorizationStatus.authorized, AuthorizationStatus.declined, AuthorizationStatus.voided]
end

.apply(value) ⇒ Object

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



4384
4385
4386
4387
4388
4389
4390
4391
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4384

def AuthorizationStatus.apply(value)
  if value.instance_of?(AuthorizationStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || AuthorizationStatus.new(value))
  end
end

.authorizedObject

Authorization was successful



4416
4417
4418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4416

def AuthorizationStatus.authorized
  @@_authorized ||= AuthorizationStatus.new('authorized')
end

.declinedObject

Indicates the authorization has been declined by the issuing bank. See the authorization decline code for more details as to the reason for decline.



4422
4423
4424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4422

def AuthorizationStatus.declined
  @@_declined ||= AuthorizationStatus.new('declined')
end

.from_string(value) ⇒ Object

Returns the instance of AuthorizationStatus for this value, or nil if not found



4394
4395
4396
4397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4394

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

.pendingObject

If an immediate response is not available, the state will be ‘pending’ - this usually indicates fraud review requires additional time / verification (or a potential network issue with the issuing bank)



4406
4407
4408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4406

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

.pending_call_bankObject

Bank is requesting consumer contact them directly to authorize the transaction



4411
4412
4413
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4411

def AuthorizationStatus.pending_call_bank
  @@_pending_call_bank ||= AuthorizationStatus.new('pending_call_bank')
end

.voidedObject

Indicates the authorization has been voided. You can void an authorization up until the moment you capture funds; once you have captured funds you must create refunds.



4429
4430
4431
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4429

def AuthorizationStatus.voided
  @@_voided ||= AuthorizationStatus.new('voided')
end

Instance Method Details

#to_hashObject



4433
4434
4435
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4433

def to_hash
  value
end