<commit_before>module Spree
  class Gateway::AdyenPayment < Gateway
    include AdyenCommon

    def auto_capture?
      false
    end

    def authorize(amount, source, gateway_options = {})
      provider.authorise_payment(
        gateway_options[:order_id],

        { :currency => Config.currency, :value => amount },

        { :reference => gateway_options[:email],
          :email => gateway_options[:email],
          :ip => gateway_options[:ip],
          :statement => 'invoice number 123456' },

        { :holder_name => "#{source.first_name} #{source.last_name}",
          :number => '4111111111111111',
          :cvc => '737',
          :expiry_month => "06",
          :expiry_year => "2016" }
      )
    end

    def capture(amount, response_code, gateway_options = {})
      value = { :currency => Config.currency, :value => amount }
      response = provider.capture_payment(response_code, value)

      # spree/payment/processing calls this method
      def response.authorization; end

      response
    end
  end
end<commit_msg>Replace hardcoded cc values for params<commit_after>module Spree
  class Gateway::AdyenPayment < Gateway
    include AdyenCommon

    def auto_capture?
      false
    end

    def authorize(amount, source, gateway_options = {})
      provider.authorise_payment(
        gateway_options[:order_id],

        { :currency => Config.currency, :value => amount },

        { :reference => gateway_options[:email],
          :email => gateway_options[:email],
          :ip => gateway_options[:ip],
          :statement => "Order # #{gateway_options[:order_id]}" },

        { :holder_name => "#{source.first_name} #{source.last_name}",
          :number => source.number,
          :cvc => source.verification_value,
          :expiry_month => source.month,
          :expiry_year => source.year }
      )
    end

    def capture(amount, response_code, gateway_options = {})
      value = { :currency => Config.currency, :value => amount }
      response = provider.capture_payment(response_code, value)

      # spree/payment/processing calls this method
      def response.authorization; end

      response
    end
  end
end
{'fraction_non_alphanumeric': 0.11886186324001835, 'fraction_numerical': 0.014226709499770536, 'mean_word_length': 2.6454849498327757, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '6069900', 'n_tokens_mistral': 659, 'n_tokens_neox': 603, 'n_words': 135}