diff --git a/app/models/pay/paddle_billing/subscription.rb b/app/models/pay/paddle_billing/subscription.rb index 6ac37aba..65f26d01 100644 --- a/app/models/pay/paddle_billing/subscription.rb +++ b/app/models/pay/paddle_billing/subscription.rb @@ -102,9 +102,11 @@ def change_quantity(quantity, **options) quantity: quantity }] - proration_billing_mode = options.delete(:proration_billing_mode) || "prorated_immediately" - - ::Paddle::Subscription.update(id: processor_id, items: items, proration_billing_mode: proration_billing_mode) + ::Paddle::Subscription.update( + id: processor_id, + items: items, + proration_billing_mode: options.delete(:proration_billing_mode) || "prorated_immediately" + ) update(quantity: quantity) rescue ::Paddle::Error => e raise Pay::PaddleBilling::Error, e @@ -157,9 +159,11 @@ def swap(plan, **options) quantity: quantity || 1 }] - proration_billing_mode = options.delete(:proration_billing_mode) || "prorated_immediately" - - ::Paddle::Subscription.update(id: processor_id, items: items, proration_billing_mode: proration_billing_mode) + ::Paddle::Subscription.update( + id: processor_id, + items: items, + proration_billing_mode: options.delete(:proration_billing_mode) || "prorated_immediately" + ) update(processor_plan: plan, ends_at: nil, status: :active) end