Class: Io::Flow::V0::Models::PaymentFailureCode

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) ⇒ PaymentFailureCode

Returns a new instance of PaymentFailureCode.



22383
22384
22385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22383

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



22381
22382
22383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22381

def value
  @value
end

Class Method Details

.action_cancelledObject

The previous action was cancelled by the customer.



22413
22414
22415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22413

def PaymentFailureCode.action_cancelled
  @@_action_cancelled ||= PaymentFailureCode.new('action_cancelled')
end

.action_expiredObject

The previous action was not completed and expired.



22408
22409
22410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22408

def PaymentFailureCode.action_expired
  @@_action_expired ||= PaymentFailureCode.new('action_expired')
end

.action_failedObject

The previous action could not be completed due to a failure returned by the payment processor.



22419
22420
22421
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22419

def PaymentFailureCode.action_failed
  @@_action_failed ||= PaymentFailureCode.new('action_failed')
end

.ALLObject



22403
22404
22405
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22403

def PaymentFailureCode.ALL
  @@all ||= [PaymentFailureCode.action_expired, PaymentFailureCode.action_cancelled, PaymentFailureCode.action_failed, PaymentFailureCode.authorization_declined, PaymentFailureCode.not_supported, PaymentFailureCode.fraudulent, PaymentFailureCode.error, PaymentFailureCode.payment_checks_declined]
end

.apply(value) ⇒ Object

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



22388
22389
22390
22391
22392
22393
22394
22395
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22388

def PaymentFailureCode.apply(value)
  if value.instance_of?(PaymentFailureCode)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PaymentFailureCode.new(value))
  end
end

.authorization_declinedObject

The previous authorization was declined by the payment provider. The consumer should contact their payment provider.



22425
22426
22427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22425

def PaymentFailureCode.authorization_declined
  @@_authorization_declined ||= PaymentFailureCode.new('authorization_declined')
end

.errorObject

An unexpected error occurred during the payment process.



22441
22442
22443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22441

def PaymentFailureCode.error
  @@_error ||= PaymentFailureCode.new('error')
end

.fraudulentObject

The payment could not be completed because it appeared to be fraudulent.



22436
22437
22438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22436

def PaymentFailureCode.fraudulent
  @@_fraudulent ||= PaymentFailureCode.new('fraudulent')
end

.from_string(value) ⇒ Object

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



22398
22399
22400
22401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22398

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

.not_supportedObject

The payment request cannot be processed using this payment method due to an unsupported combination of currency, country, amount, or merchant of record.



22431
22432
22433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22431

def PaymentFailureCode.not_supported
  @@_not_supported ||= PaymentFailureCode.new('not_supported')
end

.payment_checks_declinedObject

Payment checks declined.



22446
22447
22448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22446

def PaymentFailureCode.payment_checks_declined
  @@_payment_checks_declined ||= PaymentFailureCode.new('payment_checks_declined')
end

Instance Method Details

#to_hashObject



22450
22451
22452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22450

def to_hash
  value
end