class Io::Flow::V0::Models::PaymentStatus

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# 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.authorized, PaymentStatus.reversed, PaymentStatus.captured, PaymentStatus.refunded, PaymentStatus.in_dispute, PaymentStatus.charged_back]
end
apply(value) click to toggle source

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

# 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() click to toggle source

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`.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24764
def PaymentStatus.authorized
  @@_authorized ||= PaymentStatus.new('authorized')
end
cancelled() click to toggle source

The payment request was cancelled before any transaction was authorized. The consumer will not be charged for any transactions that were in progress.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24748
def PaymentStatus.cancelled
  @@_cancelled ||= PaymentStatus.new('cancelled')
end
captured() click to toggle source

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.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24780
def PaymentStatus.captured
  @@_captured ||= PaymentStatus.new('captured')
end
charged_back() click to toggle source

The payment provider has decided that the merchant breached terms of service will claim back all captured funds for the consumer.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24800
def PaymentStatus.charged_back
  @@_charged_back ||= PaymentStatus.new('charged_back')
end
expired() click to toggle source

The payment request expired due to inactivity before any transaction was authorized.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24754
def PaymentStatus.expired
  @@_expired ||= PaymentStatus.new('expired')
end
from_string(value) click to toggle source

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

# 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() click to toggle source

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.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24794
def PaymentStatus.in_dispute
  @@_in_dispute ||= PaymentStatus.new('in_dispute')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 24697
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
processing() click to toggle source

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.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24742
def PaymentStatus.processing
  @@_processing ||= PaymentStatus.new('processing')
end
refunded() click to toggle source

The entire balance of the payment request has been refunded back to the consumer. No further actions can be taken with this payment request.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24786
def PaymentStatus.refunded
  @@_refunded ||= PaymentStatus.new('refunded')
end
requires_action() click to toggle source

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`.

# 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() click to toggle source

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`.

# 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() click to toggle source

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.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24771
def PaymentStatus.reversed
  @@_reversed ||= PaymentStatus.new('reversed')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 24804
def to_hash
  value
end