Sha256: 7c89f77436a9ca9ac1988c38c557ea9ac83b569712a3545b5593b1eb72fca04a

Contents?: true

Size: 552 Bytes

Versions: 5

Compression:

Stored size: 552 Bytes

Contents

module PagSeguro
  class Query < Transaction
  
    def initialize(email = nil, token = nil, transaction_code=nil)
      raise "Needs a transaction code" if transaction_code.blank?
      raise "Needs an email" if email.blank?
      raise "Needs a token" if token.blank?
      @data = transaction_data(email, token, transaction_code)
    end
      
    private
      def transaction_data(email, token, transaction_code)
        super(RestClient.get("#{PAGSEGURO_TRANSACTIONS_URL}/#{transaction_code}?email=#{email}&token=#{token}"))
      end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pag_seguro-0.4.1 lib/pag_seguro/query.rb
pag_seguro-0.4.0 lib/pag_seguro/query.rb
pag_seguro-0.3.2 lib/pag_seguro/query.rb
pag_seguro-0.3.1 lib/pag_seguro/query.rb
pag_seguro-0.3.0 lib/pag_seguro/query.rb