Class: PagSeguro::Subscriptions

Inherits:
Object
  • Object
show all
Includes:
Restful
Defined in:
lib/pagseguro/subscriptions.rb

Instance Attribute Summary

Attributes included from Restful

#client

Instance Method Summary collapse

Methods included from Restful

#initialize

Instance Method Details

#create(params) ⇒ Object



11
12
13
14
# File 'lib/pagseguro/subscriptions.rb', line 11

def create(params)
  params = parameterize params
  post("/pre-approvals", params)
end

#find_by_notification_code(code) ⇒ Object



7
8
9
# File 'lib/pagseguro/subscriptions.rb', line 7

def find_by_notification_code(code)
  get("/pre-approvals/notifications/#{code}")
end

#update(code, params) ⇒ Object



16
17
18
19
# File 'lib/pagseguro/subscriptions.rb', line 16

def update(code, params)
  params = parameterize params
  put("/pre-approvals/#{code}/payment-method", params)
end

#url(code) ⇒ Object



21
22
23
# File 'lib/pagseguro/subscriptions.rb', line 21

def url(code)
  url_for :site, "/v2/pre-approvals/request.html", code: code
end