<commit_before># frozen_string_literal: true

require 'spec_helper'

describe ProcessPaymentIntent do
  let(:service) { described_class.new }

  describe "processing a payment intent" do
    let(:customer) { create(:customer) }
    let(:order) { create(:order, customer: customer, distributor: customer.enterprise, state: "payment") }
    let(:payment_method) { create(:stripe_sca_payment_method) }
    let!(:payment) { create(
      :payment,
      payment_method: payment_method,
      cvv_response_message: "https://stripe.com/redirect",
      response_code: "pi_123",
      order: order,
      state: "pending")
    }
    let(:validator) { instance_double(Stripe::PaymentIntentValidator) }

    before do
      allow(Stripe::PaymentIntentValidator).to receive(:new).and_return(validator)
    end
<commit_msg>Use :order_with_totals in ProcessPaymentIntent<commit_after># frozen_string_literal: true

require 'spec_helper'

describe ProcessPaymentIntent do
  let(:service) { described_class.new }

  describe "processing a payment intent" do
    let(:customer) { create(:customer) }
    let(:order) {
      create(:order_with_totals, customer: customer, distributor: customer.enterprise, state: "payment")
    }
    let(:payment_method) { create(:stripe_sca_payment_method) }
    let!(:payment) { create(
      :payment,
      payment_method: payment_method,
      cvv_response_message: "https://stripe.com/redirect",
      response_code: "pi_123",
      order: order,
      state: "pending")
    }
    let(:validator) { instance_double(Stripe::PaymentIntentValidator) }

    before do
      allow(Stripe::PaymentIntentValidator).to receive(:new).and_return(validator)
    end

{'fraction_non_alphanumeric': 0.11733174508636093, 'fraction_numerical': 0.00357355568790947, 'mean_word_length': 4.350318471337579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3738819', 'n_tokens_mistral': 509, 'n_tokens_neox': 500, 'n_words': 99}