<commit_before>module Pesapal
  class QueryPaymentStatus

    require 'oauth'
    require 'uri'
    require 'active_support/core_ext/object/to_query'
    require 'htmlentities'

    attr_reader :post_data_xml, :callback_url, :token, :test

    HTTP_METHOD = 'get'
    API_ACTION = '/API/PostPesapalDirectOrderV4'

    def initialize(post_data_xml, callback_url, test=true)
      @post_data_xml   = post_data_xml
      @callback_url    = callback_url
      @token           = <PASSWORD>
      @test            = test
    end

    def api_domain
      test ? 'http://demo.pesapal.com' : 'https://www.pesapal.com'
    end

    def url
      "#{api_domain}#{signed_request.path}"
    end

    def consumer
      @consumer ||= begin
        OAuth::Consumer.new(consumer_key, consumer_secret, {
            site: api_domain,
            http_method: HTTP_METHOD,
            scheme: :query_string
        })
      end
    end

    def consumer_key
      Rails.application.secrets.pesapal_consumer_key<commit_msg>Changed api url<commit_after>module Pesapal
  class QueryPaymentStatus

    require 'oauth'
    require 'uri'
    require 'active_support/core_ext/object/to_query'
    require 'htmlentities'

    attr_reader :post_data_xml, :callback_url, :token, :test

    HTTP_METHOD = 'get'
    API_ACTION = '/API/QueryPaymentStatus'

    def initialize(post_data_xml, callback_url, test=true)
      @post_data_xml   = post_data_xml
      @callback_url    = callback_url
      @token           = <PASSWORD>
      @test            = test
    end

    def api_domain
      test ? 'http://demo.pesapal.com' : 'https://www.pesapal.com'
    end

    def url
      "#{api_domain}#{signed_request.path}"
    end

    def consumer
      @consumer ||= begin
        OAuth::Consumer.new(consumer_key, consumer_secret, {
            site: api_domain,
            http_method: HTTP_METHOD,
            scheme: :query_string
        })
      end
    end

    def consumer_key
      Rails.application.secrets.pesapal_consumer_key
{'fraction_non_alphanumeric': 0.09063745019920319, 'fraction_numerical': 0.00049800796812749, 'mean_word_length': 2.387858347386172, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, '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': '513399', 'n_tokens_mistral': 655, 'n_tokens_neox': 634, 'n_words': 123}