From fb86b1354af89dfb122000c7c51f8a7be9fdd310 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Thu, 6 Nov 2025 15:31:06 +0530 Subject: [PATCH] make stripe billing version consistent --- .../enterprise/billing/create_stripe_customer_service.rb | 2 +- .../enterprise/billing/create_stripe_customer_service_spec.rb | 4 ++-- .../enterprise/billing/v2/usage_reporter_service_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/enterprise/app/services/enterprise/billing/create_stripe_customer_service.rb b/enterprise/app/services/enterprise/billing/create_stripe_customer_service.rb index 531516b3d..742bac00a 100644 --- a/enterprise/app/services/enterprise/billing/create_stripe_customer_service.rb +++ b/enterprise/app/services/enterprise/billing/create_stripe_customer_service.rb @@ -67,7 +67,7 @@ class Enterprise::Billing::CreateStripeCustomerService attributes = { stripe_customer_id: customer_id, - stripe_billing_version: 'v2' + stripe_billing_version: '2' } if hacker_plan_config&.value.present? diff --git a/spec/enterprise/services/enterprise/billing/create_stripe_customer_service_spec.rb b/spec/enterprise/services/enterprise/billing/create_stripe_customer_service_spec.rb index a2fac700f..731a77762 100644 --- a/spec/enterprise/services/enterprise/billing/create_stripe_customer_service_spec.rb +++ b/spec/enterprise/services/enterprise/billing/create_stripe_customer_service_spec.rb @@ -54,7 +54,7 @@ describe Enterprise::Billing::CreateStripeCustomerService do expect(Stripe::Customer).to have_received(:create).with({ name: account.name, email: admin1.email }) expect(account.reload.custom_attributes).to include( 'stripe_customer_id' => 'cus_random_number', - 'stripe_billing_version' => 'v2', + 'stripe_billing_version' => '2', 'stripe_pricing_plan_id' => 'bpp_hacker_123', 'plan_name' => 'Hacker', 'subscribed_quantity' => 2 @@ -79,7 +79,7 @@ describe Enterprise::Billing::CreateStripeCustomerService do expect(Stripe::Customer).not_to have_received(:create) expect(account.reload.custom_attributes).to include( 'stripe_customer_id' => 'cus_existing_v2', - 'stripe_billing_version' => 'v2', + 'stripe_billing_version' => '2', 'stripe_pricing_plan_id' => 'bpp_hacker_123', 'plan_name' => 'Hacker', 'subscribed_quantity' => 2 diff --git a/spec/enterprise/services/enterprise/billing/v2/usage_reporter_service_spec.rb b/spec/enterprise/services/enterprise/billing/v2/usage_reporter_service_spec.rb index 354463bb7..7bd2ce6e6 100644 --- a/spec/enterprise/services/enterprise/billing/v2/usage_reporter_service_spec.rb +++ b/spec/enterprise/services/enterprise/billing/v2/usage_reporter_service_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe Enterprise::Billing::V2::UsageReporterService do - let(:account) { create(:account, custom_attributes: { 'stripe_billing_version' => 2, 'stripe_customer_id' => 'cus_123' }) } + let(:account) { create(:account, custom_attributes: { 'stripe_billing_version' => '2', 'stripe_customer_id' => 'cus_123' }) } let(:service) { described_class.new(account: account) } describe '#report' do