<commit_before>module Promisepay
  # Resource for the Users API
  class TokenResource < BaseResource
    def model
      Promisepay::Token
    end

    # Create a new token for an item
    #
    # @see http://docs.promisepay.com/v2.2/docs/request_session_token
    #
    # @param attributes [Hash] Token's attributes.
    #
    # @return [Promisepay::Token]
    def create(type = :session, attributes)
      case type
        when :session
          if attributes && attributes[:fee_ids] && attributes[:fee_ids].is_a?(Array)
            attributes[:fee_ids] = attributes[:fee_ids].join(",")
          end
          response = JSON.parse(@client.get('request_session_token', attributes).body)
          Promisepay::Token.new(@client, response.token)
      end
    end

  end
end<commit_msg>- Fixed token response<commit_after>module Promisepay
  # Resource for the Users API
  class TokenResource < BaseResource
    def model
      Promisepay::Token
    end

    # Create a new token for an item
    #
    # @see http://docs.promisepay.com/v2.2/docs/request_session_token
    #
    # @param attributes [Hash] Token's attributes.
    #
    # @return [Promisepay::Token]
    def create(type = :session, attributes)
      case type
        when :session
          if attributes && attributes[:fee_ids] && attributes[:fee_ids].is_a?(Array)
            attributes[:fee_ids] = attributes[:fee_ids].join(",")
          end
          response = JSON.parse(@client.get('request_session_token', attributes).body)
          Promisepay::Token.new(@client, response[:token])
      end
    end

  end
end
{'fraction_non_alphanumeric': 0.11139081183134046, 'fraction_numerical': 0.0025173064820641915, 'mean_word_length': 2.697674418604651, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2261626', 'n_tokens_mistral': 477, 'n_tokens_neox': 472, 'n_words': 110}