Sha256: 352429b571963b26f6b478c05d2332cb92e5c203b5478c216090c621f188c4cb

Contents?: true

Size: 632 Bytes

Versions: 85

Compression:

Stored size: 632 Bytes

Contents

module ActiveMerchant
  module Billing
    module PaypalExpressCommon
      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
      
      def redirect_url
        test? ? test_redirect_url : live_redirect_url
      end
      
      def redirect_url_for(token, options = {})
        options = {:review => true}.update(options)
        options[:review] ? "#{redirect_url}#{token}" : "#{redirect_url}#{token}&useraction=commit"
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 26 rubygems

Version Path
johnideal-activemerchant-1.4.10 lib/active_merchant/billing/gateways/paypal_express_common.rb
johnideal-activemerchant-1.4.11 lib/active_merchant/billing/gateways/paypal_express_common.rb
johnideal-activemerchant-1.4.4 lib/active_merchant/billing/gateways/paypal_express_common.rb
johnideal-activemerchant-1.4.5 lib/active_merchant/billing/gateways/paypal_express_common.rb
johnideal-activemerchant-1.4.6 lib/active_merchant/billing/gateways/paypal_express_common.rb
johnideal-activemerchant-1.4.7 lib/active_merchant/billing/gateways/paypal_express_common.rb
johnideal-activemerchant-1.4.8 lib/active_merchant/billing/gateways/paypal_express_common.rb
martinstannard-activemerchant-0.1.0 lib/active_merchant/billing/gateways/paypal_express_common.rb
mattbauer-activemerchant-1.4.2 lib/active_merchant/billing/gateways/paypal_express_common.rb
seamusabshere-active_merchant-1.4.2.1 lib/active_merchant/billing/gateways/paypal_express_common.rb
seamusabshere-active_merchant-1.4.2.3 lib/active_merchant/billing/gateways/paypal_express_common.rb
tomriley-active_merchant-1.4.2.3 lib/active_merchant/billing/gateways/paypal_express_common.rb
tomriley-active_merchant-1.4.2.4 lib/active_merchant/billing/gateways/paypal_express_common.rb
tomriley-active_merchant-1.4.2.5 lib/active_merchant/billing/gateways/paypal_express_common.rb
tomriley-active_merchant-1.4.2.6 lib/active_merchant/billing/gateways/paypal_express_common.rb
tomriley-active_merchant-1.4.2.7 lib/active_merchant/billing/gateways/paypal_express_common.rb
tomriley-active_merchant-1.4.2.8 lib/active_merchant/billing/gateways/paypal_express_common.rb
tomriley-tomriley-active_merchant-1.4.2.4 lib/active_merchant/billing/gateways/paypal_express_common.rb
goldstar-activemerchant-1.4.2.7 lib/active_merchant/billing/gateways/paypal_express_common.rb
activemerchant-abn-ideal-1.7.0c lib/active_merchant/billing/gateways/paypal_express_common.rb