# ----------------------------------------------------------------------- # Copyright © 2012 ShepHertz Technologies Pvt Ltd. All rights reserved. # ----------------------------------------------------------------------- require 'App42Response.rb' # # An enum that contains 3 types of the Payment Status either DECLINED or # AUTHORIZED or PENDING. # # module App42 module Shopping class PaymentStatus < App42Response unless (const_defined?(:DECLINED)) DECLINED = "DECLINED" end unless (const_defined?(:AUTHORIZED)) AUTHORIZED = "AUTHORIZED" end unless (const_defined?(:PENDING)) PENDING = "PENDING" end # # Sets the value of the PaymentStatus. DECLINED or AUTHORIZED or PENDING. # # @param string # - the string of PaymentStatus either DECLINED or AUTHORIZED or # PENDING. # # def enum(string) return PaymentStatus.const_get(string) end # # Returns the value of the PaymentStatus. DECLINED or AUTHORIZED or # PENDING. # # @return the value of PaymentStatus. # # def isAvailable(string) if(string == "DECLINED") return "DECLINED" elsif(string == "AUTHORIZED") return "AUTHORIZED" elsif(string == "PENDING") return "PENDING"; else return nil end end end end end