<commit_before>class OrdersController < ApplicationController
  include Order::RazorpayConcern
  skip_before_action :verify_authenticity_token
  def purchase_status
    begin
      @order = Order.process_razorpayment(payment_params)
      redirect_to :action => "show", :id => @order.id
    rescue Exception => e
      # use case either refund immediatly or notify admin / client.
      redirect_to root_path, flash: "Unable to process payment, please check with our customer service."
    end
  end

  def show
    @order = Order.find_by_id(params[:id])
  end

  def index
    @orders = Order.filter(filter_params).page(params[:page]).per(10)
  end

  private
    def payment_params
      if params[:payment_id].nil?
        params.merge!(payment_id: params[:razorpay_payment_id]) 
        params.except!(:razorpay_payment_id)
      end
      params.permit(:payment_id, :user_id, :product_id, :price)
    end

    def filter_params
      params.permit(:status, :page)
    end

end
<commit_msg>changed params object<commit_after>class OrdersController < ApplicationController
  include Order::RazorpayConcern
  skip_before_action :verify_authenticity_token
  def purchase_status
    begin
      @order = Order.process_razorpayment(payment_params)
      redirect_to :action => "show", :id => @order.id
    rescue Exception => e
      # use case either refund immediatly or notify admin / client.
      redirect_to root_path, flash: "Unable to process payment, please check with our customer service."
    end
  end

  def show
    @order = Order.find_by_id(params[:id])
  end

  def index
    @orders = Order.filter(filter_params).page(params[:page]).per(10)
  end

  private
    def payment_params
        params = params.to_hash
      if params[:payment_id].nil?
        params.merge!(payment_id: params[:razorpay_payment_id]) 
        params.except!(:razorpay_payment_id)
      end
      params.permit(:payment_id, :user_id, :product_id, :price)
    end

    def filter_params
      params.permit(:status, :page)
    end

end

{'fraction_non_alphanumeric': 0.08974358974358974, 'fraction_numerical': 0.0019723865877712033, 'mean_word_length': 3.439824945295405, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5508298', 'n_tokens_mistral': 624, 'n_tokens_neox': 611, 'n_words': 152}