<commit_before>module Coinsimple
  class Business
    NEW_INVOICE_URL = "https://app.coinsimple.com/api/v1/invoice"

    def initialize business_id , api_key
      @api_key=api_key
      @business_id=business_id
    end

    def send_invoice invoice
      options=invioce.data
      options[:business_id]=@business_id
      timestamp=Time.now.to_i
      hash=Hashit.sha256(timestamp,@api_key)[3..-1]
      options[:timestamp]=timestamp
      options[:hash]=hash

      res = HTTP.post NEW_INVOICE_URL, json: options
      if res.status >= 400
        {"status" => "error" , "error" => "error creating invoice"}
      else
        JSON.parse res.to_s
      end
    end


  end
end
<commit_msg>fixes<commit_after>require "hashit"
require "http"
require "json"

module Coinsimple
  class Business
    NEW_INVOICE_URL = "https://app.coinsimple.com/api/v1/invoice"

    def initialize business_id , api_key
      @api_key=api_key
      @business_id=business_id
    end

    def send_invoice invoice
      options=invoice.data
      options[:business_id]=@business_id
      timestamp=Time.now.to_i
      hash=Hashit.sha256(timestamp,@api_key)[3..-1]
      options[:timestamp]=timestamp
      options[:hash]=hash

      res = HTTP.post NEW_INVOICE_URL, json: options
      if res.status >= 400
        {"status" => "error" , "error" => "error creating invoice"}
      else
        JSON.parse res.to_s
      end
    end


  end
end

{'fraction_non_alphanumeric': 0.10533707865168539, 'fraction_numerical': 0.012640449438202247, 'mean_word_length': 2.7698412698412698, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5688037', 'n_tokens_mistral': 496, 'n_tokens_neox': 465, 'n_words': 92}