Class: PagSeguro::Plans

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

Instance Attribute Summary

Attributes included from Restful

#client

Instance Method Summary collapse

Methods included from Restful

#initialize

Instance Method Details

#create(params) ⇒ Object



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

def create(params)
  body = build_request(params).to_xml
  post("/pre-approvals/request", body, xml: :versioned)
end

#update(code, params) ⇒ Object



12
13
14
15
16
17
# File 'lib/pagseguro/plans.rb', line 12

def update(code, params)
  params[:amount_per_payment] = to_money params[:amount_per_payment]
  params = parameterize params

  put("/pre-approvals/request/#{code}/payment", params)
end