Class: Io::Flow::V0::Models::AuthorizationStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AuthorizationStatus
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of AuthorizationStatus for this value, creating a new instance for an unknown value.
-
.authorized ⇒ Object
Authorization was successful.
-
.declined ⇒ Object
Indicates the authorization has been declined by the issuing bank.
-
.from_string(value) ⇒ Object
Returns the instance of AuthorizationStatus for this value, or nil if not found.
-
.pending ⇒ Object
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).
-
.pending_call_bank ⇒ Object
Bank is requesting consumer contact them directly to authorize the transaction.
-
.voided ⇒ Object
Indicates the authorization has been voided.
Instance Method Summary collapse
-
#initialize(value) ⇒ AuthorizationStatus
constructor
A new instance of AuthorizationStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ AuthorizationStatus
Returns a new instance of AuthorizationStatus.
7115 7116 7117 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7115 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7113 7114 7115 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7113 def value @value end |
Class Method Details
.ALL ⇒ Object
7135 7136 7137 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7135 def AuthorizationStatus.ALL @@all ||= [AuthorizationStatus.pending, AuthorizationStatus.pending_call_bank, AuthorizationStatus., AuthorizationStatus.declined, AuthorizationStatus.voided] end |
.apply(value) ⇒ Object
Returns the instance of AuthorizationStatus for this value, creating a new instance for an unknown value
7120 7121 7122 7123 7124 7125 7126 7127 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7120 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 |
.authorized ⇒ Object
Authorization was successful
7152 7153 7154 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7152 def AuthorizationStatus. ||= AuthorizationStatus.new('authorized') end |
.declined ⇒ Object
Indicates the authorization has been declined by the issuing bank. See the authorization decline code for more details as to the reason for decline.
7158 7159 7160 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7158 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
7130 7131 7132 7133 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7130 def AuthorizationStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AuthorizationStatus.ALL.find { |v| v.value == value } end |
.pending ⇒ Object
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)
7142 7143 7144 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7142 def AuthorizationStatus.pending @@_pending ||= AuthorizationStatus.new('pending') end |
.pending_call_bank ⇒ Object
Bank is requesting consumer contact them directly to authorize the transaction
7147 7148 7149 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7147 def AuthorizationStatus.pending_call_bank @@_pending_call_bank ||= AuthorizationStatus.new('pending_call_bank') end |
.voided ⇒ Object
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.
7165 7166 7167 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7165 def AuthorizationStatus.voided @@_voided ||= AuthorizationStatus.new('voided') end |
Instance Method Details
#to_hash ⇒ Object
7169 7170 7171 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7169 def to_hash value end |