Sha256: c0ca081bce61745fe19c9d6b8b374f586c8cbedb42eb671a04a3281abe2cc766

Contents?: true

Size: 579 Bytes

Versions: 5

Compression:

Stored size: 579 Bytes

Contents

module PagSeguro
  class Notification < Transaction
  
    def initialize(email = nil, token = nil, notification_code=nil)
      raise "Needs a notification code" if notification_code.blank?
      raise "Needs an email" if email.blank?
      raise "Needs a token" if token.blank?
      @data = transaction_data(email, token, notification_code)
    end
      
    private
      def transaction_data(email, token, notification_code)
        super(RestClient.get("#{PAGSEGURO_TRANSACTIONS_URL}/notifications/#{notification_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/notification.rb
pag_seguro-0.4.0 lib/pag_seguro/notification.rb
pag_seguro-0.3.2 lib/pag_seguro/notification.rb
pag_seguro-0.3.1 lib/pag_seguro/notification.rb
pag_seguro-0.3.0 lib/pag_seguro/notification.rb