Sha256: a1a552dc440e12d99ebca2feab28c8f85db2e3beb199b7f92c25ff362a327fdd

Contents?: true

Size: 793 Bytes

Versions: 12

Compression:

Stored size: 793 Bytes

Contents

# This module is meant to be mixed into a controller that needs to support paypal express transactions
module MuckCommerce
  module PaypalMethods

    def express
        response = OrderTransaction.paypal_express_gateway.setup_authorization(@cart.total,
          :ip                => request.remote_ip,
          :return_url        => build_paypal_express_return_url,
          :cancel_return_url => build_paypal_express_cancel_url
        )
        redirect_to OrderTransaction.paypal_express_gateway.redirect_url_for(response.token)
      end

    protected
      def build_paypal_express_return_url
        new_order_url
      end

      def build_paypal_express_cancel_url
        cart_url(@cart)
      end

      def paypal_express?
        !params[:token].blank?
      end

  end
 end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
muck-commerce-3.0.1 lib/muck-commerce/share/paypal_methods.rb
muck-commerce-0.2.8 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.2.7 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.2.6 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.2.5 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.2.4 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.2.3 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.2.2 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.2.1 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.2.0 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.1.9 lib/muck_commerce/paypal_methods.rb
muck-commerce-0.1.8 lib/muck_commerce/paypal_methods.rb