Module: Auth::Concerns::Shopping::PayUMoneyControllerConcern

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb

Instance Method Summary collapse

Instance Method Details

#payumoney_paramsObject

This includes the params sent back in the payumoney callback + PLUS the params that we send to the payumoney endpoint

> of these, [firstname, email, phone, amount and txnid] are also sent back in the payumoney callback.

PLUS the params that are native to the payment concern [:payment_type, :cart_id] Everywhere txnid, and :id is the same thing.



18
19
20
# File 'app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb', line 18

def payumoney_params
	[:txnid, :surl, :furl, :productinfo, :firstname, :email, :phone, :gateway_payment_initiated]
end

#permitted_paramsObject

permits the original parameters defined in the payment_controller_concern and the additional params that are defined here as “payumoney_params, alongwith id.”



27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb', line 27

def permitted_params
  
  payment_controller_params = []

  if super["payment"]
    payment_controller_params = super["payment"].keys.map{|c| c = c.to_sym}
  end
  pp = payumoney_params + payment_controller_params
  params.permit({payment: pp},:id)
end