Sha256: a5a42fc80bb41e36dd7f13a6f88be2dbba640850697a4f6c920ab68750425f81

Contents?: true

Size: 958 Bytes

Versions: 1

Compression:

Stored size: 958 Bytes

Contents

module Pin
  ##
  # This class sets up a few things like the base URL and provides a few utility methods to be shared between classes.
  class ReceiptBase
    include HTTParty
    include Pin

    ##
    # Create a new Pin instance
    # Args:
    #  key: Your Pin secret key
    #  env: The environment you want to use. Leave blank for live and pass in :test for test
    # An error is raised if an invalid env is passed in.
    # def initialize(key = "", env = :live)
    #   @key = key
    #   env = env.to_sym
    #   @@auth = {username: key, password: ''}
    #   @@base_url = if env == :live
    #     "https://api.pin.net.au/1/"
    #   elsif env == :test
    #     "https://test-api.pin.net.au/1/"
    #   else
    #     raise "'env' option must be :live or :test. Leave blank for live payments"
    #   end
    # end

    ##
    # Provides access to your key if needed
    def self.root
      File.expand_path '../../..', __FILE__
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pin_up_receipts-1.1.0 lib/pin_up_receipts/base.rb