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.



17100
17101
17102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17100

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17098
17099
17100
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17098

def value
  @value
end

Class Method Details

.ALLObject



17120
17121
17122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17120

def AuthorizationStatus.ALL
  @@all ||= [AuthorizationStatus.initiated, 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



17105
17106
17107
17108
17109
17110
17111
17112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17105

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

The authorization was successful. This means that the authorization hold has been placed on the customer’s account or the the customer has fully paid for the transaction.



17156
17157
17158
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17156

def AuthorizationStatus.authorized
  @@_authorized ||= AuthorizationStatus.new('authorized')
end

.declinedObject

The authorization has been declined by the issuing bank. See the authorization decline code for more details as to the reason for decline.



17169
17170
17171
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17169

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

.expiredObject

The authorization has expired or was explicitly cancelled by the customer.



17149
17150
17151
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17149

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



17115
17116
17117
17118
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17115

def AuthorizationStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  AuthorizationStatus.ALL.find { |v| v.value == value }
end

.initiatedObject

When the customer has selected a type of payment method to attempt a transaction, e.g. by clicking a payment method button, an authorization is created in the ‘initiated` status. This will transition to another status once the user’s exact method of payment is determined (a specific card or bank account). Often, the checkout experience will need to take additional action to enable this transition, like redirecting to a payment provider’s page; consult ‘result_action` to understand what to do next.



17131
17132
17133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17131

def AuthorizationStatus.initiated
  @@_initiated ||= AuthorizationStatus.new('initiated')
end

.pendingObject

After the customer has filled in their payment information, like their card or their bank account, the payment provider may need additional verification like cardholder authentication or may need more time to complete processing. The checkout experience may need to take additional actions expressed in ‘result_action` to complete the transaction. If no `result_action` is present, the authorization will update asynchronously based on payment processor notifications. In this case, the payment should be considered provisional; you can display a Thank You page to the customer, but the order should not be fulfilled until the authorization updates to a final status.



17144
17145
17146
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17144

def AuthorizationStatus.pending
  @@_pending ||= AuthorizationStatus.new('pending')
end

.reversedObject

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.



17176
17177
17178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17176

def AuthorizationStatus.reversed
  @@_reversed ||= AuthorizationStatus.new('reversed')
end

.reviewObject

The authorization has been completed, but it needs to go through a fraud review process. You can show a Thank You page to the customer, but you should not fulfill the order until the status has updated to ‘authorized`.



17163
17164
17165
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17163

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

Instance Method Details

#to_hashObject



17180
17181
17182
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17180

def to_hash
  value
end