Class: PagSeguro::Request
- Inherits:
-
Object
- Object
- PagSeguro::Request
show all
- Includes:
- HTTParty
- Defined in:
- lib/pagseguro/request.rb
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, account = "default")
self.class.base_uri PagSeguro.api_url(version)
options = { query: add_credencials(account) }
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, account = "default", params = {})
self.class.base_uri PagSeguro.api_url(version)
options = { body: add_credencials(account) }
options[:body].merge!(params)
options[:timeout] = PagSeguro.timeout unless PagSeguro.timeout.blank?
self.class.post(path, options)
end
|