Sha256: 773f988d3f51d0e0f35fd2cb7781168f13d74209372816349ad9c383203bc96c

Contents?: true

Size: 1.42 KB

Versions: 1

Compression:

Stored size: 1.42 KB

Contents

# -----------------------------------------------------------------------
#  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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
App42_RUBY_SDK-0.8.3 lib/shopping/PaymentStatus.rb