Sha256: 66e562acced84532e9dbd180e214695a0034e2f37de96e48f582825a8187f976

Contents?: true

Size: 940 Bytes

Versions: 20

Compression:

Stored size: 940 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)

        if params[:commit].to_s.include?('Decline')
          order_declined(
            payment: 'for pretend', 
            provider: 'pretend', 
            card: 'none', 
            declined_url: pretend_params[:declined_url]
          )
        else
          order_purchased(
            payment: 'for pretend', 
            provider: 'pretend', 
            card: 'none', 
            purchased_url: pretend_params[:purchased_url],
            current_user: current_user
          )
        end
      end

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

    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
effective_orders-6.9.2 app/controllers/effective/providers/pretend.rb
effective_orders-6.9.1 app/controllers/effective/providers/pretend.rb
effective_orders-6.9.0 app/controllers/effective/providers/pretend.rb
effective_orders-6.8.2 app/controllers/effective/providers/pretend.rb
effective_orders-6.8.1 app/controllers/effective/providers/pretend.rb
effective_orders-6.8.0 app/controllers/effective/providers/pretend.rb
effective_orders-6.7.3 app/controllers/effective/providers/pretend.rb
effective_orders-6.7.2 app/controllers/effective/providers/pretend.rb
effective_orders-6.7.1 app/controllers/effective/providers/pretend.rb
effective_orders-6.7.0 app/controllers/effective/providers/pretend.rb
effective_orders-6.6.3 app/controllers/effective/providers/pretend.rb
effective_orders-6.6.2 app/controllers/effective/providers/pretend.rb
effective_orders-6.6.1 app/controllers/effective/providers/pretend.rb
effective_orders-6.6.0 app/controllers/effective/providers/pretend.rb
effective_orders-6.5.9 app/controllers/effective/providers/pretend.rb
effective_orders-6.5.8 app/controllers/effective/providers/pretend.rb
effective_orders-6.5.7 app/controllers/effective/providers/pretend.rb
effective_orders-6.5.6 app/controllers/effective/providers/pretend.rb
effective_orders-6.5.5 app/controllers/effective/providers/pretend.rb
effective_orders-6.5.4 app/controllers/effective/providers/pretend.rb