class Io::Flow::V0::Models::CreditPaymentErrorCode

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18181
def CreditPaymentErrorCode.ALL
  @@all ||= [CreditPaymentErrorCode.generic_error, CreditPaymentErrorCode.invalid_order_number, CreditPaymentErrorCode.invalid_currency, CreditPaymentErrorCode.invalid_description, CreditPaymentErrorCode.duplicate, CreditPaymentErrorCode.amount_must_be_positive, CreditPaymentErrorCode.amount_exceeds_balance, CreditPaymentErrorCode.insufficient_amount]
end
amount_exceeds_balance() click to toggle source

Indicates the provided credit amount exceeds the remaining balance on the order

# File lib/flow_commerce/flow_api_v0_client.rb, line 18216
def CreditPaymentErrorCode.amount_exceeds_balance
  @@_amount_exceeds_balance ||= CreditPaymentErrorCode.new('amount_exceeds_balance')
end
amount_must_be_positive() click to toggle source

Indicates the provided credit amount was <= 0

# File lib/flow_commerce/flow_api_v0_client.rb, line 18210
def CreditPaymentErrorCode.amount_must_be_positive
  @@_amount_must_be_positive ||= CreditPaymentErrorCode.new('amount_must_be_positive')
end
apply(value) click to toggle source

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

# File lib/flow_commerce/flow_api_v0_client.rb, line 18166
def CreditPaymentErrorCode.apply(value)
  if value.instance_of?(CreditPaymentErrorCode)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || CreditPaymentErrorCode.new(value))
  end
end
duplicate() click to toggle source

Indicates that a credit payment with the specified key already exists

# File lib/flow_commerce/flow_api_v0_client.rb, line 18205
def CreditPaymentErrorCode.duplicate
  @@_duplicate ||= CreditPaymentErrorCode.new('duplicate')
end
from_string(value) click to toggle source

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

# File lib/flow_commerce/flow_api_v0_client.rb, line 18176
def CreditPaymentErrorCode.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  CreditPaymentErrorCode.ALL.find { |v| v.value == value }
end
generic_error() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18185
def CreditPaymentErrorCode.generic_error
  @@_generic_error ||= CreditPaymentErrorCode.new('generic_error')
end
insufficient_amount() click to toggle source

Indicates the provided credit amount exceeds the maximum amount of applicable credit

# File lib/flow_commerce/flow_api_v0_client.rb, line 18222
def CreditPaymentErrorCode.insufficient_amount
  @@_insufficient_amount ||= CreditPaymentErrorCode.new('insufficient_amount')
end
invalid_currency() click to toggle source

Indicates that the specified currency code is not valid

# File lib/flow_commerce/flow_api_v0_client.rb, line 18195
def CreditPaymentErrorCode.invalid_currency
  @@_invalid_currency ||= CreditPaymentErrorCode.new('invalid_currency')
end
invalid_description() click to toggle source

Indicates that the description is invalid (must be non-empty)

# File lib/flow_commerce/flow_api_v0_client.rb, line 18200
def CreditPaymentErrorCode.invalid_description
  @@_invalid_description ||= CreditPaymentErrorCode.new('invalid_description')
end
invalid_order_number() click to toggle source

Indicates the specified order does not exist

# File lib/flow_commerce/flow_api_v0_client.rb, line 18190
def CreditPaymentErrorCode.invalid_order_number
  @@_invalid_order_number ||= CreditPaymentErrorCode.new('invalid_order_number')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18161
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Public Instance Methods

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