set strip billing version in custom attributes

This commit is contained in:
Tanmay Deep Sharma
2025-11-06 02:07:44 +05:30
parent fcc6973245
commit d38bd5139e
2 changed files with 5 additions and 2 deletions
@@ -14,7 +14,9 @@ class Enterprise::Billing::CreditSyncJob < ApplicationJob
def sync_all_accounts
Rails.logger.info '[CreditSyncJob] Starting credit sync for all accounts'
accounts_with_stripe = Account.where("custom_attributes->>'stripe_customer_id' IS NOT NULL")
accounts_with_stripe = Account.where(
"custom_attributes->>'stripe_customer_id' IS NOT NULL AND custom_attributes->>'stripe_billing_version' = '2'"
)
synced_count = 0
failed_count = 0
@@ -113,7 +113,8 @@ class Enterprise::Billing::V2::SubscriptionProvisioningService < Enterprise::Bil
'pending_subscription_pricing_plan' => nil,
'billing_cadence' => billing_cadence,
'next_billing_date' => nil,
'pending_stripe_pricing_plan_id' => nil
'pending_stripe_pricing_plan_id' => nil,
'stripe_billing_version' => 2
}
attributes['stripe_pricing_plan_id'] = pricing_plan_id if pricing_plan_id.present?