set strip billing version in custom attributes
This commit is contained in:
@@ -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?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user