<commit_before>module Spree
  class SmspayController < StoreController
    def confirm
      order = current_order || raise(ActiveRecord::RecordNotFound)

      begin
        if provider.login
          order.payments.create!(
            source: SmspayCheckout.create(
              phone_code: params[:phone_code],
              phone_number: params[:phone_number],
              order: order),
            amount: order.total,
            payment_method: payment_method
          )
          order.next
          if order.complete?
            flash.notice = Spree.t(:order_processed_successfully)
            flash[:order_completed] = true
            session[:order_id] = nil
            redirect_to completion_route(order)
          else
            redirect_to checkout_state_path(order.state)
          end
        else
          flash[:error] = Spree.t('flash.generic_error', scope: 'smspay', reasons: "Unauthorized")
          redirect_to checkout_state_path(order.state)
        end
      rescue SocketError
        flash[:error] = Spree.t('flash.connection_failed', scope: 'smspay')
        redirect_to checkout_state_path(:payment)
      end
    end

    def success<commit_msg>Remove smspay_controller#confirm method<commit_after>module Spree
  class SmspayController < StoreController
    def success
{'fraction_non_alphanumeric': 0.07756653992395438, 'fraction_numerical': 0.0, 'mean_word_length': 2.29, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5281126', 'n_tokens_mistral': 350, 'n_tokens_neox': 343, 'n_words': 71}