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.



7559
7560
7561
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7559

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7557
7558
7559
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7557

def value
  @value
end

Class Method Details

.ALLObject



7579
7580
7581
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7579

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]
end

.amount_exceeds_balanceObject

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



7614
7615
7616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7614

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



7608
7609
7610
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7608

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



7564
7565
7566
7567
7568
7569
7570
7571
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7564

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



7603
7604
7605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7603

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



7574
7575
7576
7577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7574

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

.generic_errorObject



7583
7584
7585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7583

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

.invalid_currencyObject

Indicates that the specified currency code is not valid



7593
7594
7595
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7593

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

.invalid_descriptionObject

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



7598
7599
7600
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7598

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

.invalid_order_numberObject

Indicates the specified order does not exist



7588
7589
7590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7588

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

Instance Method Details

#to_hashObject



7618
7619
7620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7618

def to_hash
  value
end