Sha256: 655fe2bd9eac66dc5d1dce47bfc688cea5f97e1a5f7837d48e5b557c9ed0ecb4

Contents?: true

Size: 734 Bytes

Versions: 7

Compression:

Stored size: 734 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 @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

7 entries across 7 versions & 1 rubygems

Version Path
effective_orders-1.5.0 app/controllers/effective/providers/paypal.rb
effective_orders-1.4.8 app/controllers/effective/providers/paypal.rb
effective_orders-1.4.7 app/controllers/effective/providers/paypal.rb
effective_orders-1.4.6 app/controllers/effective/providers/paypal.rb
effective_orders-1.4.5 app/controllers/effective/providers/paypal.rb
effective_orders-1.4.4 app/controllers/effective/providers/paypal.rb
effective_orders-1.4.3 app/controllers/effective/providers/paypal.rb