Class: PagSeguro::Request

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/pagseguro/request.rb

Direct Known Subclasses

Notification, Payment, Query, Refund, Session

Constant Summary collapse

API_VERSIONS =
[API_V2 = 'v2', API_V3 = 'v3']

Instance Method Summary collapse

Instance Method Details

#get(path, version, account = "default") ⇒ Object



9
10
11
12
13
# File 'lib/pagseguro/request.rb', line 9

def get(path, version,  = "default")
  self.class.base_uri PagSeguro.api_url(version)
  options = { query: add_credencials() }
  self.class.get(path, options)
end

#post(path, version, account = "default", params = {}) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/pagseguro/request.rb', line 15

def post(path, version,  = "default", params = {})
  self.class.base_uri PagSeguro.api_url(version)
  options = { body: add_credencials() }
  options[:body].merge!(params)
  options[:timeout] = PagSeguro.timeout unless PagSeguro.timeout.blank?
  self.class.post(path, options)
end