Class: Io::Flow::V0::Models::PaymentStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentStatus
- 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 PaymentStatus for this value, creating a new instance for an unknown value.
-
.authorized ⇒ Object
A hold has been placed on the consumer’s payment method for the amount of the payment request.
-
.cancelled ⇒ Object
The payment request was cancelled before any transaction was authorized.
-
.captured ⇒ Object
The entire balance of the payment request has been captured.
-
.charged_back ⇒ Object
The payment provider has decided that the merchant breached terms of service will claim back all captured funds for the consumer.
-
.expired ⇒ Object
The payment request expired due to inactivity before any transaction was authorized.
-
.from_string(value) ⇒ Object
Returns the instance of PaymentStatus for this value, or nil if not found.
-
.in_dispute ⇒ Object
The consumer has placed a dispute with their payment provider to reclaim any captured funds due to breach of service with the merchant.
-
.processing ⇒ Object
The payment attempt is processing.
-
.refunded ⇒ Object
The entire balance of the payment request has been refunded back to the consumer.
-
.requires_action ⇒ Object
In order to process a payment for a given payment method, an action needs to be rendered on the consumer’s device so that they can interact with the payment provider or authenticate themselves.
-
.requires_payment_method ⇒ Object
The initial state of payment request if no ‘payment_method_data` is provided, if an authorization couldn’t be completed, or if the payment request details are changed beyond certain thesholds (e.g. currency changed).
-
.reversed ⇒ Object
The entire balance of the payment request was reversed without being captured.
Instance Method Summary collapse
-
#initialize(value) ⇒ PaymentStatus
constructor
A new instance of PaymentStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ PaymentStatus
Returns a new instance of PaymentStatus.
24697 24698 24699 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24697 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
24695 24696 24697 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24695 def value @value end |
Class Method Details
.ALL ⇒ Object
24717 24718 24719 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24717 def PaymentStatus.ALL @@all ||= [PaymentStatus.requires_payment_method, PaymentStatus.requires_action, PaymentStatus.processing, PaymentStatus.cancelled, PaymentStatus.expired, PaymentStatus., PaymentStatus.reversed, PaymentStatus.captured, PaymentStatus.refunded, PaymentStatus.in_dispute, PaymentStatus.charged_back] end |
.apply(value) ⇒ Object
Returns the instance of PaymentStatus for this value, creating a new instance for an unknown value
24702 24703 24704 24705 24706 24707 24708 24709 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24702 def PaymentStatus.apply(value) if value.instance_of?(PaymentStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || PaymentStatus.new(value)) end end |
.authorized ⇒ Object
A hold has been placed on the consumer’s payment method for the amount of the payment request. The funds have not yet been withdrawn - they must be captured separately. The full balance of the payment request must be captured in order to update the status to ‘captured`. Any outstanding balance that is not captured will eventually be reversed. If an order is found to be fraudulent, the payment request can be cancelled and the status will change to `reversed`.
24764 24765 24766 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24764 def PaymentStatus. @@_authorized ||= PaymentStatus.new('authorized') end |
.cancelled ⇒ Object
The payment request was cancelled before any transaction was authorized. The consumer will not be charged for any transactions that were in progress.
24748 24749 24750 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24748 def PaymentStatus.cancelled @@_cancelled ||= PaymentStatus.new('cancelled') end |
.captured ⇒ Object
The entire balance of the payment request has been captured. The funds have been withdrawn from the consumer and will be transferred to the merchant. With some payment methods, this occurs automatically after authorization without taking steps to capture. Any funds captured can be returned to the customer by refunding them. The consumer can issue a dispute for any captured funds.
24780 24781 24782 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24780 def PaymentStatus.captured @@_captured ||= PaymentStatus.new('captured') end |
.charged_back ⇒ Object
The payment provider has decided that the merchant breached terms of service will claim back all captured funds for the consumer.
24800 24801 24802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24800 def PaymentStatus.charged_back @@_charged_back ||= PaymentStatus.new('charged_back') end |
.expired ⇒ Object
The payment request expired due to inactivity before any transaction was authorized.
24754 24755 24756 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24754 def PaymentStatus.expired @@_expired ||= PaymentStatus.new('expired') end |
.from_string(value) ⇒ Object
Returns the instance of PaymentStatus for this value, or nil if not found
24712 24713 24714 24715 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24712 def PaymentStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PaymentStatus.ALL.find { |v| v.value == value } end |
.in_dispute ⇒ Object
The consumer has placed a dispute with their payment provider to reclaim any captured funds due to breach of service with the merchant. The status of the payment request will update to ‘charged_back` or `dispute_won` after the payment provider makes a decision.
24794 24795 24796 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24794 def PaymentStatus.in_dispute @@_in_dispute ||= PaymentStatus.new('in_dispute') end |
.processing ⇒ Object
The payment attempt is processing. Eventually it will update with the results of the transaction. Sometimes, this may take hours or days to finish processing - if that is the case, the consumer can have their order reserved provisionally until the payment is processed.
24742 24743 24744 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24742 def PaymentStatus.processing @@_processing ||= PaymentStatus.new('processing') end |
.refunded ⇒ Object
The entire balance of the payment request has been refunded back to the consumer. No further actions can be taken with this payment request.
24786 24787 24788 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24786 def PaymentStatus.refunded @@_refunded ||= PaymentStatus.new('refunded') end |
.requires_action ⇒ Object
In order to process a payment for a given payment method, an action needs to be rendered on the consumer’s device so that they can interact with the payment provider or authenticate themselves. If the action is not completed, the action will expire and the payment request will change to ‘requires_payment_method`.
24734 24735 24736 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24734 def PaymentStatus.requires_action @@_requires_action ||= PaymentStatus.new('requires_action') end |
.requires_payment_method ⇒ Object
The initial state of payment request if no ‘payment_method_data` is provided, if an authorization couldn’t be completed, or if the payment request details are changed beyond certain thesholds (e.g. currency changed). If a payment method is not added, this payment request will change to ‘expired`.
24725 24726 24727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24725 def PaymentStatus.requires_payment_method @@_requires_payment_method ||= PaymentStatus.new('requires_payment_method') end |
.reversed ⇒ Object
The entire balance of the payment request was reversed without being captured. The consumer has not had any funds withdrawn and any authorization hold has been removed.
24771 24772 24773 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24771 def PaymentStatus.reversed @@_reversed ||= PaymentStatus.new('reversed') end |
Instance Method Details
#to_hash ⇒ Object
24804 24805 24806 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24804 def to_hash value end |