Sha256: f1cd0da0c946e2bac90f999ab9073c46160a7a1970e6704b542fff88c9aaf323

Contents?: true

Size: 1.44 KB

Versions: 59

Compression:

Stored size: 1.44 KB

Contents

module Auth::Concerns::Shopping::PayUMoneyControllerConcern

  extend ActiveSupport::Concern


  included do

  	protect_from_forgery :except => [:update]

  end


  ## This includes the params sent back in the payumoney callback + 
  ## PLUS the params that we send to the payumoney endpoint[:amount,:txnid,:surl,:furl,:productinfo,:firstname,:email,:phone]
  ## => 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.
  def payumoney_params
  	[:txnid, :surl, :furl, :productinfo, :firstname, :email, :phone, :gateway_payment_initiated]
  end

  ##note that the payumoney callback makes a POST requet to whatever url you specifiy.
  ##This does not suit our puprose, since we want it to make a PUT request to the update_url.
  ##for this purpose a route has been added to the dummy apps routes file, that maps a POST request to the update path for the 

  ## permits the original parameters defined in the payment_controller_concern and the additional params that are defined here as "payumoney_params, alongwith id."
  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

end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
wordjelly-auth-1.6.0 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.9 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.8 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.7 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.6 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.5 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.4 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.3 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.2 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.1 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.5.0 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.4.9 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.4.8 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.4.7 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.4.6 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.4.5 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.4.4 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.4.3 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.4.2 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
wordjelly-auth-1.4.0 app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb