Sha256: 33d64bc760ac3de3497580c8b37082fe43749c958f2a2fa173c83d2ea7b803e6

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

# File: lib/forge/ecommerce.rb
# Adds configuration options for ecommerce
# eg.
#
# Forge.configure do |config|
#   config.ecommerce.payments = :hosted or :integrated
#   config.ecommerce.shippers = {
#     :one => One,
#     :two => Two
#   }
#
#   config.ecommerce.active_merchant = {
#     :gateway  => "gateway",
#     :login    => "login",
#     :password => "password"
#   }
#
#   config.ecommerce.email_receipt = true
#
#   config.ecommerce.currency = "CAD"
#
#   config.ecommerce.paypal_production = {
#     :account => {}
#   }
#
#   config.ecommerce.paypal_sandbox = {
#     :account => {}
#   }
# end

module Forge
  class Configuration
    def ecommerce
      @ecommerce ||= EcommerceConfiguration.new
    end

    class EcommerceConfiguration
      attr_accessor :payments, :flat_rate_shipping, :shippers,
                    :email_receipt, :active_merchant, :paypal_production,
                    :paypal_sandbox, :currency

      def initialize
        @payments = :hosted
        @shippers           = {}
        @active_merchant    = {}
        @paypal_production  = {}
        @paypal_sandbox     = {}
      end

      def payments
        @payments.to_sym
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
forge-cli-0.1.3 lib/forge/lib/forge/config/ecommerce.rb
forge-cli-0.1.2 lib/forge/lib/forge/config/ecommerce.rb
forge-cli-0.1.1 lib/forge/lib/forge/config/ecommerce.rb
forge-cli-0.1.0 lib/forge/lib/forge/config/ecommerce.rb