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



6691
6692
6693
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6691

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6689
6690
6691
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6689

def value
  @value
end

Class Method Details

.ALLObject



6711
6712
6713
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6711

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



6696
6697
6698
6699
6700
6701
6702
6703
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6696

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



6728
6729
6730
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6728

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.



6734
6735
6736
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6734

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



6706
6707
6708
6709
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6706

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)



6718
6719
6720
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6718

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

.pending_call_bankObject

Bank is requesting consumer contact them directly to authorize the transaction



6723
6724
6725
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6723

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.



6741
6742
6743
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6741

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

Instance Method Details

#to_hashObject



6745
6746
6747
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6745

def to_hash
  value
end