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.



8538
8539
8540
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8538

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8536
8537
8538
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8536

def value
  @value
end

Class Method Details

.ALLObject



8558
8559
8560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8558

def AuthorizationStatus.ALL
  @@all ||= [AuthorizationStatus.pending, AuthorizationStatus.expired, AuthorizationStatus.authorized, AuthorizationStatus.review, AuthorizationStatus.declined, AuthorizationStatus.reversed]
end

.apply(value) ⇒ Object

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



8543
8544
8545
8546
8547
8548
8549
8550
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8543

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



8576
8577
8578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8576

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.



8589
8590
8591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8589

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

.expiredObject

Authorization has expired.



8571
8572
8573
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8571

def AuthorizationStatus.expired
  @@_expired ||= AuthorizationStatus.new('expired')
end

.from_string(value) ⇒ Object

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



8553
8554
8555
8556
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8553

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’. For example, online payment methods like AliPay or PayPal will have a status of ‘pending’ until the user completes the payment. Pending authorizations expire if the user does not complete the payment in a timely fashion.



8566
8567
8568
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8566

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

.reversedObject

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



8596
8597
8598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8596

def AuthorizationStatus.reversed
  @@_reversed ||= AuthorizationStatus.new('reversed')
end

.reviewObject

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



8583
8584
8585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8583

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

Instance Method Details

#to_hashObject



8600
8601
8602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8600

def to_hash
  value
end