<commit_before>class PaypalController < CheckoutController 
  protect_from_forgery :except => [:confirm] 
  skip_before_filter :persist_gender
  
  def confirm
    # XXX It works!
    #redirect_to checkout_state_path("confirm")
    # but we want this:
    unless current_order
      redirect_to root_path
    else
      order = current_order
      while order.state != "complete"
         order.next
         state_callback(:after)
      end
      #order.finalize!
      redirect_to order_path(current_order)
    end
  end

end<commit_msg>added flash notice on payment completion<commit_after>class PaypalController < CheckoutController 
  protect_from_forgery :except => [:confirm] 
  skip_before_filter :persist_gender
  
  def confirm
    # XXX It works!
    #redirect_to checkout_state_path("confirm")
    # but we want this:
    unless current_order
      redirect_to root_path
    else
      order = current_order
      while order.state != "complete"
         order.next
         state_callback(:after)
      end
      #order.finalize!
      flash[:notice] = I18n.t(:order_processed_successfully)
      flash[:commerce_tracking] = "nothing special"
      redirect_to order_path(current_order)
    end
  end

end
{'fraction_non_alphanumeric': 0.06896551724137931, 'fraction_numerical': 0.0016420361247947454, 'mean_word_length': 3.0364238410596025, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2347277', 'n_tokens_mistral': 365, 'n_tokens_neox': 354, 'n_words': 85}