Module: PayPal::SDK::Merchant::Urls

Included in:
API
Defined in:
lib/paypal-sdk/merchant/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

#express_checkout_url(token, extra_params = {}) ⇒ Object



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

def express_checkout_url(token, extra_params={})
  token = token.Token if token.respond_to?(:Token)
  params = {:cmd => "_express-checkout", :token => token.to_s}
  redirect_url(params.merge!(extra_params))
end

#redirect_url(params = {}) ⇒ Object



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

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