Class: PagSeguro::Checkout

Inherits:
Object
  • Object
show all
Includes:
Restful
Defined in:
lib/pagseguro/checkout.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
11
# File 'lib/pagseguro/checkout.rb', line 7

def create(params)
  body = build_request(params).to_xml(encoding: "UTF-8")
  response = post("/v2/checkout", body, xml: :simple)
  response.checkout
end

#url(code) ⇒ Object



13
14
15
# File 'lib/pagseguro/checkout.rb', line 13

def url(code)
  url_for :site, "/v2/checkout/payment.html", code: code
end