Sha256: 759b277a3eecaa78c74d32caf5a11a8a35f37d2a89b8ec1215b17948607e3e89

Contents?: true

Size: 742 Bytes

Versions: 22

Compression:

Stored size: 742 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 rescue 0)).first

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

        if @order.present?
          if @order.purchased?
            order_purchased(params)
          elsif (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

22 entries across 22 versions & 1 rubygems

Version Path
effective_orders-1.8.1 app/controllers/effective/providers/paypal.rb
effective_orders-1.8.0 app/controllers/effective/providers/paypal.rb
effective_orders-1.7.5 app/controllers/effective/providers/paypal.rb
effective_orders-1.7.4 app/controllers/effective/providers/paypal.rb
effective_orders-1.7.3 app/controllers/effective/providers/paypal.rb
effective_orders-1.7.2 app/controllers/effective/providers/paypal.rb
effective_orders-1.7.1 app/controllers/effective/providers/paypal.rb
effective_orders-1.7.0 app/controllers/effective/providers/paypal.rb
effective_orders-1.6.6 app/controllers/effective/providers/paypal.rb
effective_orders-1.6.5 app/controllers/effective/providers/paypal.rb
effective_orders-1.6.4 app/controllers/effective/providers/paypal.rb
effective_orders-1.6.3 app/controllers/effective/providers/paypal.rb
effective_orders-1.6.1 app/controllers/effective/providers/paypal.rb
effective_orders-1.6.0 app/controllers/effective/providers/paypal.rb
effective_orders-1.5.9 app/controllers/effective/providers/paypal.rb
effective_orders-1.5.8 app/controllers/effective/providers/paypal.rb
effective_orders-1.5.7 app/controllers/effective/providers/paypal.rb
effective_orders-1.5.5 app/controllers/effective/providers/paypal.rb
effective_orders-1.5.4 app/controllers/effective/providers/paypal.rb
effective_orders-1.5.3 app/controllers/effective/providers/paypal.rb