class Io::Flow::V0::Models::MerchantGiftCardErrorCode
Attributes
value[R]
Public Class Methods
ALL()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22432 def MerchantGiftCardErrorCode.ALL @@all ||= [MerchantGiftCardErrorCode.invalid, MerchantGiftCardErrorCode.expired, MerchantGiftCardErrorCode.empty, MerchantGiftCardErrorCode.insufficient_funds, MerchantGiftCardErrorCode.unsupported_currency] end
apply(value)
click to toggle source
Returns the instance of MerchantGiftCardErrorCode
for this value, creating a new instance for an unknown value
# File lib/flow_commerce/flow_api_v0_client.rb, line 22417 def MerchantGiftCardErrorCode.apply(value) if value.instance_of?(MerchantGiftCardErrorCode) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || MerchantGiftCardErrorCode.new(value)) end end
empty()
click to toggle source
Balance is 0
# File lib/flow_commerce/flow_api_v0_client.rb, line 22446 def MerchantGiftCardErrorCode.empty @@_empty ||= MerchantGiftCardErrorCode.new('empty') end
expired()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22441 def MerchantGiftCardErrorCode.expired @@_expired ||= MerchantGiftCardErrorCode.new('expired') end
from_string(value)
click to toggle source
Returns the instance of MerchantGiftCardErrorCode
for this value, or nil if not found
# File lib/flow_commerce/flow_api_v0_client.rb, line 22427 def MerchantGiftCardErrorCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) MerchantGiftCardErrorCode.ALL.find { |v| v.value == value } end
insufficient_funds()
click to toggle source
Redemption amount greater than balance
# File lib/flow_commerce/flow_api_v0_client.rb, line 22451 def MerchantGiftCardErrorCode.insufficient_funds @@_insufficient_funds ||= MerchantGiftCardErrorCode.new('insufficient_funds') end
invalid()
click to toggle source
Generic error type
# File lib/flow_commerce/flow_api_v0_client.rb, line 22437 def MerchantGiftCardErrorCode.invalid @@_invalid ||= MerchantGiftCardErrorCode.new('invalid') end
new(value)
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22412 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end
unsupported_currency()
click to toggle source
Redemption or reversal currency is not supported
# File lib/flow_commerce/flow_api_v0_client.rb, line 22456 def MerchantGiftCardErrorCode.unsupported_currency @@_unsupported_currency ||= MerchantGiftCardErrorCode.new('unsupported_currency') end
Public Instance Methods
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22460 def to_hash value end