Sha256: 599f1210e5557ee63af24fc15954731ba89fdb3492f7b8ba0bc1be642aa27813

Contents?: true

Size: 1022 Bytes

Versions: 34

Compression:

Stored size: 1022 Bytes

Contents

module Killbill::PaypalExpress
  class Properties
    def initialize(file = 'paypal_express.yml')
      @config_file = Pathname.new(file).expand_path
    end

    def parse!
      raise "#{@config_file} is not a valid file" unless @config_file.file?
      @config = YAML.load_file(@config_file.to_s)
      validate!
    end

    def [](key)
      @config[key]
    end

    private

    def validate!
      raise "Bad configuration for PaypalExpress plugin. Config is #{@config.inspect}" if @config.blank? ||
                                                                                          @config[:paypal].blank? ||
                                                                                          @config[:paypal][:signature].blank? ||
                                                                                          @config[:paypal][:login].blank? ||
                                                                                          @config[:paypal][:password].blank?
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
killbill-paypal-express-1.7.0 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.6.7 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.6.6 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.6.5 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.6.4 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.6.3 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.6.2 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.6.1 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.6.0 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.5.4 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.5.3 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.5.2 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.5.1 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.5.0 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.4.1 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.4.0 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.3.0 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.2.0 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.1.0 lib/paypal_express/config/properties.rb
killbill-paypal-express-1.0.17 lib/paypal_express/config/properties.rb