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.



9769
9770
9771
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9769

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9767
9768
9769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9767

def value
  @value
end

Class Method Details

.ALLObject



9789
9790
9791
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9789

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



9774
9775
9776
9777
9778
9779
9780
9781
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9774

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



9807
9808
9809
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9807

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.



9820
9821
9822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9820

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

.expiredObject

Authorization has expired.



9802
9803
9804
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9802

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



9784
9785
9786
9787
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9784

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.



9797
9798
9799
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9797

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.



9827
9828
9829
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9827

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)



9814
9815
9816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9814

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

Instance Method Details

#to_hashObject



9831
9832
9833
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9831

def to_hash
  value
end