From e92e54fcd3146670579f245c96d21c779518ea40 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 14 Jan 2026 22:12:58 -0600 Subject: [PATCH] Missed some recurly/plan code for yearly --- web/app/controllers/api_recurly_controller.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/web/app/controllers/api_recurly_controller.rb b/web/app/controllers/api_recurly_controller.rb index 01048e621..7b12d9fc1 100644 --- a/web/app/controllers/api_recurly_controller.rb +++ b/web/app/controllers/api_recurly_controller.rb @@ -176,18 +176,29 @@ class ApiRecurlyController < ApiController plan_code = params[:plan_code] value = '0.00' - # Determine value based on plan (approximate monthly cost) + # Determine value based on plan (approximate cost) case plan_code when SubscriptionDefinitions::JAM_SILVER value = '5.00' + when SubscriptionDefinitions::JAM_SILVER_YEARLY + value = '50.00' when SubscriptionDefinitions::JAM_GOLD value = '10.00' + when SubscriptionDefinitions::JAM_GOLD_YEARLY + value = '100.00' when SubscriptionDefinitions::JAM_PLATINUM value = '20.00' + when SubscriptionDefinitions::JAM_PLATINUM_YEARLY + value = '200.00' end - # Calculate predicted LTV (e.g., 12 months) - ltv = (value.to_f * 12).to_s + # Calculate predicted LTV (12 months for monthly, 1 year for yearly) + # If it's a yearly plan, the value IS the yearly revenue + if plan_code.to_s.include?('yearly') + ltv = value + else + ltv = (value.to_f * 12).to_s + end CapiTransmitter.send_event('Subscribe', current_user, { value: value, currency: 'USD', predicted_ltv: ltv }) rescue => e