Module: Effective::Providers::Pretend

Extended by:
ActiveSupport::Concern
Included in:
OrdersController
Defined in:
app/controllers/effective/providers/pretend.rb

Instance Method Summary collapse

Instance Method Details

#pretendObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/effective/providers/pretend.rb', line 6

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]
  )
end

#pretend_paramsObject



21
22
23
# File 'app/controllers/effective/providers/pretend.rb', line 21

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