Sha256: 6f3d11f2ca746e3a01ec58dbf69774992fd7de6b9936b2d63d47bc5d383cbf6c

Contents?: true

Size: 923 Bytes

Versions: 3

Compression:

Stored size: 923 Bytes

Contents

module Opay

  module Configuration
    extend ActiveSupport::Concern
    include ActiveSupport::Configurable

    included do
      config_accessor :provider

      # payu configuration
      config_accessor :pos_id
      config_accessor :pos_auth_key
      config_accessor :key1
      config_accessor :key2

      config_accessor :test_mode
      config_accessor :process_payments_localy

      reset_config
    end

    module ClassMethods

      def configure
        yield self
      end

      # Sets configuration back to default
      def reset_config
        configure do |config|
          config.provider = :payu

          # payu configuration
          config.pos_id = 999
          config.pos_auth_key = 'pos_auth_key'
          config.key1 = 'key1'
          config.key2 = 'key2'

          config.test_mode = false
          config.process_payments_localy = false
        end
      end

    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opay-1.1.6 lib/opay/configuration.rb
opay-1.1.5 lib/opay/configuration.rb
opay-1.1.4 lib/opay/configuration.rb