Sha256: 0e1d014b21968856b8d46c6c99e209244e0c92bb713d1e03f4349e9b9b894c40

Contents?: true

Size: 932 Bytes

Versions: 9

Compression:

Stored size: 932 Bytes

Contents

module Effective
  module Providers
    module Ccbill
      extend ActiveSupport::Concern

      included do
        skip_before_filter :verify_authenticity_token, only: [:ccbill_postback]

        if defined?(CanCan)
          skip_authorization_check only: [:ccbill_postback]
        end
      end

      def ccbill_postback
        postback = Effective::Providers::CcbillPostback.new(params)
        @order ||= Effective::Order.find(postback.order_id)

        if @order.present? && postback.verified?
          if @order.purchased?
            order_purchased(details: postback.order_details, provider: 'ccbill')
          elsif postback.approval? && postback.matches?(@order)
            order_purchased(details: postback.order_details, provider: 'ccbill')
          else
            order_declined(details: postback.order_details, provider: 'ccbill')
          end
        end

        head(:ok)
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
effective_orders-2.1.6 app/controllers/effective/providers/ccbill.rb
effective_orders-2.1.5 app/controllers/effective/providers/ccbill.rb
effective_orders-2.1.4 app/controllers/effective/providers/ccbill.rb
effective_orders-2.1.3 app/controllers/effective/providers/ccbill.rb
effective_orders-2.1.2 app/controllers/effective/providers/ccbill.rb
effective_orders-2.1.1 app/controllers/effective/providers/ccbill.rb
effective_orders-2.1.0 app/controllers/effective/providers/ccbill.rb
effective_orders-2.0.1 app/controllers/effective/providers/ccbill.rb
effective_orders-2.0.0 app/controllers/effective/providers/ccbill.rb