<commit_before>module MPower
  class DirectMobile < MPower::Checkout::Core

    def charge(amount,customer_details={})
      payload = {
        :customer_name => customer_details[:customer_name],
        :customer_phone => customer_details[:customer_phone],
        :customer_email => customer_details[:customer_email],
        :wallet_provider => customer_details[:wallet_provider],
        :merchant_name => customer_details[:merchant_name],
        :amount => amount
      }

      result = http_json_request(MPower::Setup.direct_mobile_charge_base_url,payload)

      if result["response_code"] == "00"
        push_results(result)
        true
      else
        push_results(result)
        false
      end
    end

    # Poll this method for completed / pending / failed / cancelled status
    def transaction_status(token)
      payload = { :token => token }
      result = http_json_request(MPower::Setup.direct_mobile_tx_status_base_url,payload)

      if result["response_code"] == "00"
        push_results(result)
        true
      else
        push_results(result)
        false
      end
    end
  end
end<commit_msg>Mobile Invoice Number<commit_after>module MPower
  class DirectMobile < MPower::Checkout::Core

    attr_accessor :mobile_invoice_no
    def charge(amount,customer_details={})
      payload = {
        :customer_name => customer_details[:customer_name],
        :customer_phone => customer_details[:customer_phone],
        :customer_email => customer_details[:customer_email],
        :wallet_provider => customer_details[:wallet_provider],
        :merchant_name => customer_details[:merchant_name],
        :amount => amount
      }

      result = http_json_request(MPower::Setup.direct_mobile_charge_base_url,payload)

      if result["response_code"] == "00"
        @mobile_invoice_no = result["mobile_invoice_no"]
        push_results(result)
        true
      else
        push_results(result)
        false
      end
    end

    # Poll this method for completed / pending / failed / cancelled status
    def transaction_status(token)
      payload = { :token => token }
      result = http_json_request(MPower::Setup.direct_mobile_tx_status_base_url,payload)

      if result["response_code"] == "00"
        push_results(result)
        true
      else
        push_results(result)
        false
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09156118143459915, 'fraction_numerical': 0.0033755274261603376, 'mean_word_length': 2.9125412541254128, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '4092503', 'n_tokens_mistral': 670, 'n_tokens_neox': 658, 'n_words': 125}