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.
-
.expired ⇒ Object
Authorization has expired.
-
.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’.
-
.reversed ⇒ Object
Indicates the authorization has been fully reversed.
-
.review ⇒ Object
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).
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.
7557 7558 7559 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7557 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7555 7556 7557 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7555 def value @value end |
Class Method Details
.ALL ⇒ Object
7577 7578 7579 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7577 def AuthorizationStatus.ALL @@all ||= [AuthorizationStatus.pending, AuthorizationStatus.expired, AuthorizationStatus., 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
7562 7563 7564 7565 7566 7567 7568 7569 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7562 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
7595 7596 7597 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7595 def AuthorizationStatus. @@_authorized ||= 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.
7608 7609 7610 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7608 def AuthorizationStatus.declined @@_declined ||= AuthorizationStatus.new('declined') end |
.expired ⇒ Object
Authorization has expired.
7590 7591 7592 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7590 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
7572 7573 7574 7575 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7572 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’. 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.
7585 7586 7587 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7585 def AuthorizationStatus.pending @@_pending ||= AuthorizationStatus.new('pending') end |
.reversed ⇒ Object
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.
7615 7616 7617 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7615 def AuthorizationStatus.reversed @@_reversed ||= AuthorizationStatus.new('reversed') end |
.review ⇒ Object
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)
7602 7603 7604 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7602 def AuthorizationStatus.review @@_review ||= AuthorizationStatus.new('review') end |
Instance Method Details
#to_hash ⇒ Object
7619 7620 7621 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7619 def to_hash value end |