<commit_before>review_path = ->(contribution) do
  Neighborly::Balanced::Creditcard::Engine.
    routes.url_helpers.new_payment_path(contribution_id: contribution)
end

value_with_fees = ->(value) do
  Neighborly::Balanced::Creditcard::Fee.new(value).total
end

begin
  PaymentEngines.register(name:            'balanced-creditcard',
                          locale:          'en',
                          value_with_fees: value_with_fees,
                          review_path:     review_path)
rescue Exception => e
  puts "Error while registering payment engine: #{e}"
end<commit_msg>Use TransactionAdditionalFeeCalculator on engine registration<commit_after>review_path = ->(contribution) do
  Neighborly::Balanced::Creditcard::Engine.
    routes.url_helpers.new_payment_path(contribution_id: contribution)
end

value_with_fees = ->(value) do
  Neighborly::Balanced::Creditcard::TransactionAdditionalFeeCalculator.new(value).gross_amount
end

begin
  PaymentEngines.register(name:            'balanced-creditcard',
                          locale:          'en',
                          value_with_fees: value_with_fees,
                          review_path:     review_path)
rescue Exception => e
  puts "Error while registering payment engine: #{e}"
end
{'fraction_non_alphanumeric': 0.09162717219589257, 'fraction_numerical': 0.0, 'mean_word_length': 2.9226006191950464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3728099', 'n_tokens_mistral': 375, 'n_tokens_neox': 362, 'n_words': 67}