Sha256: f21447abd3ed7fd4e60cb4ff009766b735462f355af177cdaa2e5aeb9687f67b

Contents?: true

Size: 641 Bytes

Versions: 2

Compression:

Stored size: 641 Bytes

Contents

module CatarsePagarme
  class NotificationsController < CatarsePagarme::ApplicationController
    skip_before_filter :authenticate_user!
    skip_before_filter :force_http

    def create
      if PagarMe::validate_fingerprint(contribution.try(:payment_id), params[:fingerprint])
        if contribution
          contribution.payment_notifications.create(extra_data: params.to_json)
          delegator.change_status_by_transaction(params[:current_status])

          return render nothing: true, status: 200
        end

        return render nothing: true, status: 404
      end

      render nothing: true, status: 404
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
catarse_pagarme-0.1.2 app/controllers/catarse_pagarme/notifications_controller.rb
catarse_pagarme-0.1.1 app/controllers/catarse_pagarme/notifications_controller.rb