<commit_before>class PaymentNotificationsController < ApplicationController
  protect_from_forgery :except => [:success, :failed]
  before_filter :authorize, :only => [:create]
  
  def create
    @notification = PaymentNotification.create(params[:payment_notification])
    redirect_to root_path
  end
  
  def success
    if params[:crypt]
      protx_params = GATEWAY.parse_response(CGI.escape(params[:crypt]))
      @notification = PaymentNotification.create!(protx_params)
      raise if @notifcation.status =~ /\n/
      redirect_to thanks_brick_path(@notification.brick)
    else
      redirect_to root_path
    end
  end
  
  def failed
    if params[:crypt]
      protx_params = GATEWAY.parse_response(CGI.escape(params[:crypt]))
      @notification = PaymentNotification.create!(protx_params)
    else
      redirect_to root_path<commit_msg>Fixed typo<commit_after>class PaymentNotificationsController < ApplicationController
  protect_from_forgery :except => [:success, :failed]
  before_filter :authorize, :only => [:create]
  
  def create
    @notification = PaymentNotification.create(params[:payment_notification])
    redirect_to root_path
  end
  
  def success
    if params[:crypt]
      protx_params = GATEWAY.parse_response(CGI.escape(params[:crypt]))
      @notification = PaymentNotification.create!(protx_params)
      raise if @notification.status =~ /\n/
      redirect_to thanks_brick_path(@notification.brick)
    else
      redirect_to root_path
    end
  end
  
  def failed
    if params[:crypt]
      protx_params = GATEWAY.parse_response(CGI.escape(params[:crypt]))
      @notification = PaymentNotification.create!(protx_params)
    else
      redirect_to root_path
{'fraction_non_alphanumeric': 0.09058823529411765, 'fraction_numerical': 0.0, 'mean_word_length': 4.0625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3429116', 'n_tokens_mistral': 506, 'n_tokens_neox': 498, 'n_words': 96}