Module: PayPal::SDK::Permissions::Urls

Included in:
API
Defined in:
lib/paypal-sdk/permissions/urls.rb

Constant Summary collapse

REDIRECT_ENDPOINTS =
{
:live => "https://www.paypal.com/webscr",
:sandbox => "https://www.sandbox.paypal.com/webscr" }

Instance Method Summary collapse

Instance Method Details

#grant_permission_url(token) ⇒ Object Also known as: request_permissions_url


13
14
15
16
# File 'lib/paypal-sdk/permissions/urls.rb', line 13

def grant_permission_url(token)
  token = token.token if token.respond_to?(:token)
  redirect_url(:cmd => "_grant-permission", :request_token => token.to_s)
end

#redirect_url(params = {}) ⇒ Object


9
10
11
# File 'lib/paypal-sdk/permissions/urls.rb', line 9

def redirect_url(params = {})
  "#{REDIRECT_ENDPOINTS[api_mode]}?#{encode_www_form(params)}"
end