<commit_before>module PayByNet
  class PaymentVerifier

    attr_accessor :payment_id

    def initialize(payment_id)
      @payment_id = payment_id
    end

    def verify
      completed?(connect)
    end

    def connect
      @client = Savon.client(wsdl: 'https://pbn.paybynet.com.pl/axist/services/PBNTransactionsGetStatus?wsdl')
      response =@client.call(:get_status_by_payment_id, message: {in0: payment_id,  in1: ENV['COMPANY_NIP']})
      status_code(response)
    end

    def status_code(response)
      response.body[:get_status_by_payment_id_response][:get_status_by_payment_id_return].to_i
    end

    def completed?(response)
     [2203, 2303].include?(response)
    end

    def rejected?(response)
      [2202, 2302].include?(response)
    end

    def outdated?(response)
      [2201, 2301].include?(response)
    end

    def pending?(response)
      [2101,2102].include?(response)<commit_msg>not using env<commit_after>module PayByNet
  class PaymentVerifier

    attr_accessor :payment_id, :client_id

    def initialize(payment_id, client_id)
      @payment_id = payment_id
      @client_id = client_id
    end

    def verify
      completed?(connect)
    end

    def connect
      @client = Savon.client(wsdl: 'https://pbn.paybynet.com.pl/axist/services/PBNTransactionsGetStatus?wsdl')
      response =@client.call(:get_status_by_payment_id, message: {in0: payment_id,  in1: client_id})
      status_code(response)
    end

    def status_code(response)
      response.body[:get_status_by_payment_id_response][:get_status_by_payment_id_return].to_i
    end

    def completed?(response)
     [2203, 2303].include?(response)
    end

    def rejected?(response)
      [2202, 2302].include?(response)
    end

    def outdated?(response)
      [2201, 2301].include?(response)
    end

    def pending?(response)
      [2101,2102].include?(response)
{'fraction_non_alphanumeric': 0.10506666666666667, 'fraction_numerical': 0.03626666666666667, 'mean_word_length': 3.466666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4421008', 'n_tokens_mistral': 676, 'n_tokens_neox': 630, 'n_words': 107}