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.



8197
8198
8199
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8197

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8195
8196
8197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8195

def value
  @value
end

Class Method Details

.ALLObject



8217
8218
8219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8217

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



8202
8203
8204
8205
8206
8207
8208
8209
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8202

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

Authorization was successful



8235
8236
8237
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8235

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

.declinedObject

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



8248
8249
8250
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8248

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

.expiredObject

Authorization has expired.



8230
8231
8232
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8230

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



8212
8213
8214
8215
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8212

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

.pendingObject

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.



8225
8226
8227
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8225

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

.reversedObject

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.



8255
8256
8257
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8255

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

.reviewObject

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)



8242
8243
8244
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8242

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

Instance Method Details

#to_hashObject



8259
8260
8261
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8259

def to_hash
  value
end