Sha256: 6740d698b0e8caaf55ac019942762df0e57805c76b97698f110def1782c7461d

Contents?: true

Size: 671 Bytes

Versions: 4

Compression:

Stored size: 671 Bytes

Contents

module Effective
  module Providers
    module Pretend
      extend ActiveSupport::Concern

      def pretend
        raise('pretend provider is not available') unless EffectiveOrders.pretend?

        @order ||= Order.find(params[:id])

        EffectiveResources.authorize!(self, :update, @order)

        order_purchased(
          payment: 'for pretend',
          provider: 'pretend',
          card: 'none',
          purchased_url: pretend_params[:purchased_url],
          declined_url: pretend_params[:declined_url]
        )
      end

      def pretend_params
        params.require(:pretend).permit(:purchased_url, :declined_url)
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
effective_orders-5.0.2 app/controllers/effective/providers/pretend.rb
effective_orders-5.0.1 app/controllers/effective/providers/pretend.rb
effective_orders-4.6.1 app/controllers/effective/providers/pretend.rb
effective_orders-5.0.0 app/controllers/effective/providers/pretend.rb