Class: Io::Flow::V0::Models::CreditPaymentErrorCode

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

Returns a new instance of CreditPaymentErrorCode.



13641
13642
13643
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13641

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13639
13640
13641
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13639

def value
  @value
end

Class Method Details

.ALLObject



13661
13662
13663
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13661

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_balanceObject

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



13696
13697
13698
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13696

def CreditPaymentErrorCode.amount_exceeds_balance
  @@_amount_exceeds_balance ||= CreditPaymentErrorCode.new('amount_exceeds_balance')
end

.amount_must_be_positiveObject

Indicates the provided credit amount was <= 0



13690
13691
13692
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13690

def CreditPaymentErrorCode.amount_must_be_positive
  @@_amount_must_be_positive ||= CreditPaymentErrorCode.new('amount_must_be_positive')
end

.apply(value) ⇒ Object

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



13646
13647
13648
13649
13650
13651
13652
13653
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13646

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

.duplicateObject

Indicates that a credit payment with the specified key already exists



13685
13686
13687
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13685

def CreditPaymentErrorCode.duplicate
  @@_duplicate ||= CreditPaymentErrorCode.new('duplicate')
end

.from_string(value) ⇒ Object

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



13656
13657
13658
13659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13656

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

.generic_errorObject



13665
13666
13667
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13665

def CreditPaymentErrorCode.generic_error
  @@_generic_error ||= CreditPaymentErrorCode.new('generic_error')
end

.insufficient_amountObject

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



13702
13703
13704
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13702

def CreditPaymentErrorCode.insufficient_amount
  @@_insufficient_amount ||= CreditPaymentErrorCode.new('insufficient_amount')
end

.invalid_currencyObject

Indicates that the specified currency code is not valid



13675
13676
13677
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13675

def CreditPaymentErrorCode.invalid_currency
  @@_invalid_currency ||= CreditPaymentErrorCode.new('invalid_currency')
end

.invalid_descriptionObject

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



13680
13681
13682
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13680

def CreditPaymentErrorCode.invalid_description
  @@_invalid_description ||= CreditPaymentErrorCode.new('invalid_description')
end

.invalid_order_numberObject

Indicates the specified order does not exist



13670
13671
13672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13670

def CreditPaymentErrorCode.invalid_order_number
  @@_invalid_order_number ||= CreditPaymentErrorCode.new('invalid_order_number')
end

Instance Method Details

#to_hashObject



13706
13707
13708
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13706

def to_hash
  value
end