Module: ActiveMerchant::Billing::PaypalExpressCommon

Included in:
PayflowExpressGateway, PaypalExpressGateway
Defined in:
lib/active_merchant/billing/gateways/paypal_express_common.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
# File 'lib/active_merchant/billing/gateways/paypal_express_common.rb', line 4

def self.included(base)
  base.cattr_accessor :test_redirect_url
  base.cattr_accessor :live_redirect_url
  base.live_redirect_url = 'https://www.paypal.com/cgibin/webscr?cmd=_express-checkout&token='
end

Instance Method Details

#redirect_urlObject



10
11
12
# File 'lib/active_merchant/billing/gateways/paypal_express_common.rb', line 10

def redirect_url
  test? ? test_redirect_url : live_redirect_url
end

#redirect_url_for(token, options = {}) ⇒ Object



14
15
16
17
# File 'lib/active_merchant/billing/gateways/paypal_express_common.rb', line 14

def redirect_url_for(token, options = {})
  options = {:review => true}.update(options)
  options[:review] ? "#{redirect_url}#{token}" : "#{redirect_url}#{token}&useraction=commit"
end