Sha256: f983f9b2225658b1ead5115095aa827807827bddc8fa5b4297e0db9babe70c75

Contents?: true

Size: 662 Bytes

Versions: 35

Compression:

Stored size: 662 Bytes

Contents

module Effective
  module Providers
    module Paypal
      extend ActiveSupport::Concern

      included do
        skip_before_filter :verify_authenticity_token, :only => [:paypal_postback]
      end

      def paypal_postback
        @order ||= Effective::Order.where(:id => params[:invoice].to_i).first

        EffectiveOrders.authorized?(self, :update, @order)

        if @order.present?
          if params[:payment_status] == 'Completed' && params[:custom] == EffectiveOrders.paypal[:secret]
            order_purchased(params)
          else
            order_declined(params)
          end
        end

        head(:ok)
      end


    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
effective_orders-1.4.2 app/controllers/effective/providers/paypal.rb
effective_orders-1.4.1 app/controllers/effective/providers/paypal.rb
effective_orders-1.4.0 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.13 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.12 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.11 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.10 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.9 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.8 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.7 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.6 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.5 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.4 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.3 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.2 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.1 app/controllers/effective/providers/paypal.rb
effective_orders-1.3.0 app/controllers/effective/providers/paypal.rb
effective_orders-1.2.13 app/controllers/effective/providers/paypal.rb
effective_orders-1.2.12 app/controllers/effective/providers/paypal.rb
effective_orders-1.2.11 app/controllers/effective/providers/paypal.rb