Class: Io::Flow::V0::Models::CreditPaymentErrorCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CreditPaymentErrorCode
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.amount_exceeds_balance ⇒ Object
Indicates the provided credit amount exceeds the remaining balance on the order.
-
.amount_must_be_positive ⇒ Object
Indicates the provided credit amount was <= 0.
-
.apply(value) ⇒ Object
Returns the instance of CreditPaymentErrorCode for this value, creating a new instance for an unknown value.
-
.duplicate ⇒ Object
Indicates that a credit payment with the specified key already exists.
-
.from_string(value) ⇒ Object
Returns the instance of CreditPaymentErrorCode for this value, or nil if not found.
- .generic_error ⇒ Object
-
.insufficient_amount ⇒ Object
Indicates the provided credit amount exceeds the maximum amount of applicable credit.
-
.invalid_currency ⇒ Object
Indicates that the specified currency code is not valid.
-
.invalid_description ⇒ Object
Indicates that the description is invalid (must be non-empty).
-
.invalid_order_number ⇒ Object
Indicates the specified order does not exist.
Instance Method Summary collapse
-
#initialize(value) ⇒ CreditPaymentErrorCode
constructor
A new instance of CreditPaymentErrorCode.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CreditPaymentErrorCode
Returns a new instance of CreditPaymentErrorCode.
14308 14309 14310 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14308 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14306 14307 14308 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14306 def value @value end |
Class Method Details
.ALL ⇒ Object
14328 14329 14330 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14328 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 ⇒ Object
Indicates the provided credit amount exceeds the remaining balance on the order
14363 14364 14365 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14363 def CreditPaymentErrorCode.amount_exceeds_balance @@_amount_exceeds_balance ||= CreditPaymentErrorCode.new('amount_exceeds_balance') end |
.amount_must_be_positive ⇒ Object
Indicates the provided credit amount was <= 0
14357 14358 14359 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14357 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
14313 14314 14315 14316 14317 14318 14319 14320 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14313 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 ⇒ Object
Indicates that a credit payment with the specified key already exists
14352 14353 14354 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14352 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
14323 14324 14325 14326 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14323 def CreditPaymentErrorCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CreditPaymentErrorCode.ALL.find { |v| v.value == value } end |
.generic_error ⇒ Object
14332 14333 14334 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14332 def CreditPaymentErrorCode.generic_error @@_generic_error ||= CreditPaymentErrorCode.new('generic_error') end |
.insufficient_amount ⇒ Object
Indicates the provided credit amount exceeds the maximum amount of applicable credit
14369 14370 14371 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14369 def CreditPaymentErrorCode.insufficient_amount @@_insufficient_amount ||= CreditPaymentErrorCode.new('insufficient_amount') end |
.invalid_currency ⇒ Object
Indicates that the specified currency code is not valid
14342 14343 14344 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14342 def CreditPaymentErrorCode.invalid_currency @@_invalid_currency ||= CreditPaymentErrorCode.new('invalid_currency') end |
.invalid_description ⇒ Object
Indicates that the description is invalid (must be non-empty)
14347 14348 14349 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14347 def CreditPaymentErrorCode.invalid_description @@_invalid_description ||= CreditPaymentErrorCode.new('invalid_description') end |
.invalid_order_number ⇒ Object
Indicates the specified order does not exist
14337 14338 14339 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14337 def CreditPaymentErrorCode.invalid_order_number @@_invalid_order_number ||= CreditPaymentErrorCode.new('invalid_order_number') end |
Instance Method Details
#to_hash ⇒ Object
14373 14374 14375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14373 def to_hash value end |