<commit_before>require 'omni_kassa'
require './test_settings'

get '/' do
  redirect '1337'
end

get '/:amount' do
  omnikassa = OmniKassa::Request.new
  omnikassa.order_id = rand(1337)
  omnikassa.amount = params[:amount]
  omnikassa.normal_return_url = request.url
  omnikassa.perform
end

post '/:amount' do
  omnikassa = OmniKassa::Response.new(params)

  data = {
    raw: omnikassa,
    response_code: omnikassa.response_code,
    response: omnikassa.response,
    succesful: omnikassa.successful?
  }
  puts data.to_yaml
  render omnikassa.response
end

<commit_msg>Fix Sinatra interface<commit_after>require 'omni_kassa'
require './test_settings'

get '/' do
  redirect '1337'
end

get '/:amount' do
  omnikassa = OmniKassa::Request.new
  omnikassa.order_id = rand(1337)
  omnikassa.amount = params[:amount]
  omnikassa.normal_return_url = request.url
  omnikassa.perform
end

post '/:amount' do
  omnikassa = OmniKassa::Response.new(params)
  puts omnikassa.inspect

  omnikassa.response.to_s
end


{'fraction_non_alphanumeric': 0.10824230387288977, 'fraction_numerical': 0.015888778550148957, 'mean_word_length': 4.361702127659575, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5018732', 'n_tokens_mistral': 407, 'n_tokens_neox': 373, 'n_words': 74}