<commit_before># frozen_string_literal: true

module DonationSystem
  RawRequestData = Struct.new(:type, :amount, :currency, :giftaid, :token,
                              :name, :email,
                              :address, :city, :state, :zip, :country)
  OneOffPaymentData = Struct.new(
    :id, :amount, :currency, :created, :last4, :brand, :method, :record_type_id,
    :number
  ) do
    def received?
      true
    end

    def oneoff?
      true
    end
  end

  RecurringPaymentData = Struct.new(
    :id, :amount, :currency, :created, :last4, :brand, :method, :record_type_id,
    :number, :expiry_month, :expiry_year, :start_date, :reference,
    :collection_day, :mandate_method, :account_holder_name
  ) do
    def oneoff?
      false
    end
  end

  StripePlanFake = Struct.new(:id)

  StripeCardData = Struct.new(:last4, :brand, :exp_month, :exp_year)
  VALID_STRIPE_CARD_DATA = StripeCardData.new('4242', 'Visa', '8', '2100')

  StripeCustomerFake = Struct.new(:id) do
    SourcesFake = Struct.new(:data)
    def sources
      SourcesFake.new([VALID_STRIPE_CARD_DATA])
    end
  end

  SupporterFake = Struct.new(:Id, :AccountId)

  VALID_REQUEST_DATA = RawRequestData.new(
    'one-off', '12.345', 'gbp', true, 'tok_visa',
    'Firstname Lastname', '<EMAIL>',
    'Address', 'City', 'State', 'Z1PC0D3', 'Country'
  ).freeze

  VALID_ONEOFF_PAYMENT_DATA = OneOffPaymentData.new(<commit_msg>Add a method parameter in the data structs<commit_after># frozen_string_literal: true

module DonationSystem
  RawRequestData = Struct.new(:type, :amount, :currency, :giftaid, :token,
                              :name, :email,
                              :address, :city, :state, :zip, :country,
                              :method)
  OneOffPaymentData = Struct.new(
    :id, :amount, :currency, :created, :last4, :brand, :method, :record_type_id,
    :number
  ) do
    def received?
      true
    end

    def oneoff?
      true
    end
  end

  RecurringPaymentData = Struct.new(
    :id, :amount, :currency, :created, :last4, :brand, :method, :record_type_id,
    :number, :expiry_month, :expiry_year, :start_date, :reference,
    :collection_day, :mandate_method, :account_holder_name
  ) do
    def oneoff?
      false
    end
  end

  StripePlanFake = Struct.new(:id)

  StripeCardData = Struct.new(:last4, :brand, :exp_month, :exp_year)
  VALID_STRIPE_CARD_DATA = StripeCardData.new('4242', 'Visa', '8', '2100')

  StripeCustomerFake = Struct.new(:id) do
    SourcesFake = Struct.new(:data)
    def sources
      SourcesFake.new([VALID_STRIPE_CARD_DATA])
    end
  end

  SupporterFake = Struct.new(:Id, :AccountId)

  VALID_REQUEST_DATA = RawRequestData.new(
    'one-off', '12.345', 'gbp', true, 'tok_visa',
    'Firstname Lastname', '<EMAIL>',
    'Address', 'City', 'State', 'Z1PC0D3', 'Country',
    'stripe'
  ).freeze

  VALID_ONEOFF_PAYMENT_DATA = OneOffPaymentData.new(
{'fraction_non_alphanumeric': 0.13188705234159778, 'fraction_numerical': 0.013774104683195593, 'mean_word_length': 3.1738505747126435, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5892124', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1015, 'n_words': 220}