Sha256: 4b0ce74a3af248bae793c1ea57d7c73349a7d9663a2d6cbb3902495eb2c4c82f
Contents?: true
Size: 618 Bytes
Versions: 6
Compression:
Stored size: 618 Bytes
Contents
require "httparty" module PagseguroCatcher class Checker include HTTParty attr_accessor :code, :type, :response def initialize(code, type) self.code = code self.type = type end def check(force=false) self.response = HTTParty.get(url).body if force self.response ||= HTTParty.get(url).body if self.response PagseguroCatcher::Transaction::Base.new(self.response) end end private def url "#{PagseguroCatcher.url}/#{self.code}?email=#{PagseguroCatcher.email}&token=#{PagseguroCatcher.token}" end end end
Version data entries
6 entries across 6 versions & 1 rubygems