Module: Effective::Providers::Phone

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

Instance Method Summary collapse

Instance Method Details

#phoneObject



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

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

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

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

  flash[:success] = EffectiveOrders.phone[:success]

  order_deferred(provider: 'phone', deferred_url: phone_params[:deferred_url])
end

#phone_paramsObject



18
19
20
# File 'app/controllers/effective/providers/phone.rb', line 18

def phone_params
  params.require(:phone).permit(:deferred_url)
end