Class: JeraPayment::Api::Iugu::Plan
- Inherits:
-
Base
- Object
- Base
- JeraPayment::Api::Iugu::Plan
show all
- Defined in:
- lib/jera_payment/api/iugu/plan.rb
Constant Summary
collapse
- BASE_ENDPOINT =
'plans'
Class Method Summary
collapse
Methods inherited from Base
delete, ensure_account_access_token, get, parse_response, post, put, set_headers
Class Method Details
.create(body = {}, access_token = nil) ⇒ Object
7
8
9
|
# File 'lib/jera_payment/api/iugu/plan.rb', line 7
def self.create(body = {}, access_token = nil)
response = post(BASE_ENDPOINT, body, access_token)
end
|
.destroy(id, access_token = nil) ⇒ Object
17
18
19
20
21
|
# File 'lib/jera_payment/api/iugu/plan.rb', line 17
def self.destroy(id, access_token = nil)
url = "#{BASE_ENDPOINT}/#{id}"
response = delete(url, access_token)
end
|
.index(query = nil, access_token = nil) ⇒ Object
35
36
37
|
# File 'lib/jera_payment/api/iugu/plan.rb', line 35
def self.index(query = nil, access_token = nil)
response = get(BASE_ENDPOINT, query, access_token)
end
|
.show(id, access_token = nil) ⇒ Object
23
24
25
26
27
|
# File 'lib/jera_payment/api/iugu/plan.rb', line 23
def self.show(id, access_token = nil)
url = "#{BASE_ENDPOINT}/#{id}"
response = get(url, nil, access_token)
end
|
.show_by_identifier(identifier, access_token = nil) ⇒ Object
29
30
31
32
33
|
# File 'lib/jera_payment/api/iugu/plan.rb', line 29
def self.show_by_identifier(identifier, access_token = nil)
url = "#{BASE_ENDPOINT}/identifier/#{identifier}"
response = get(url, nil, access_token)
end
|
.update(id, body = {}, access_token = nil) ⇒ Object
11
12
13
14
15
|
# File 'lib/jera_payment/api/iugu/plan.rb', line 11
def self.update(id, body = {}, access_token = nil)
url = "#{BASE_ENDPOINT}/#{id}"
response = put(url, body, access_token)
end
|