class PagSeguro::Authorizations
Constants
- PERMISSIONS
Public Instance Methods
create(params)
click to toggle source
# File lib/pagseguro/authorizations.rb, line 18 def create(params) body = build_request(params).to_xml response = post("/v2/authorizations/request", body, xml: :simple) response.authorization_request end
find_by_notification_code(code)
click to toggle source
# File lib/pagseguro/authorizations.rb, line 24 def find_by_notification_code(code) response = get("/v2/authorizations/notifications/#{code}", nil, xml: :simple) response.authorization end
url(code)
click to toggle source
# File lib/pagseguro/authorizations.rb, line 29 def url(code) url_for :site, "/v2/authorization/request.jhtml", code: code end
Private Instance Methods
build_request(params)
click to toggle source
# File lib/pagseguro/authorizations.rb, line 34 def build_request(params) builder do authorizationRequest do redirectURL params[:redirect_url] permissions do params[:permissions].each do |aliased| code PERMISSIONS[aliased] end end end end end