Fix prezzi pubblici: Premium Light €5/€40, Full €20/€200.
Ripristina le etichette in PriceCatalog usate da prezzi, abbonamento e checkout. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,8 +5,8 @@ module Billing
|
||||
DEFAULT_INTERVAL = "yearly"
|
||||
|
||||
PRICING = {
|
||||
"premium_light" => { "yearly" => "€39,90/anno", "monthly" => "€4,90/mese" },
|
||||
"premium_full" => { "yearly" => "€69,90/anno", "monthly" => "€9,90/mese" }
|
||||
"premium_light" => { "yearly" => "€40/anno", "monthly" => "€5/mese" },
|
||||
"premium_full" => { "yearly" => "€200/anno", "monthly" => "€20/mese" }
|
||||
}.freeze
|
||||
|
||||
class << self
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
<% if plan.slug == "free" %>
|
||||
<div class="plan-price">€0</div>
|
||||
<% elsif plan.slug == "premium_light" %>
|
||||
<div class="plan-price" style="color:#e53935">€40/anno</div>
|
||||
<p style="color:#888;font-size:0.85rem">oppure €5/mese</p>
|
||||
<div class="plan-price" style="color:#e53935"><%= Billing::Stripe::PriceCatalog.label(plan_slug: plan.slug, interval: "yearly") %></div>
|
||||
<p style="color:#888;font-size:0.85rem">oppure <%= Billing::Stripe::PriceCatalog.label(plan_slug: plan.slug, interval: "monthly") %></p>
|
||||
<% else %>
|
||||
<div class="plan-price">€200/anno</div>
|
||||
<p style="color:#888;font-size:0.85rem">oppure €20/mese</p>
|
||||
<div class="plan-price"><%= Billing::Stripe::PriceCatalog.label(plan_slug: plan.slug, interval: "yearly") %></div>
|
||||
<p style="color:#888;font-size:0.85rem">oppure <%= Billing::Stripe::PriceCatalog.label(plan_slug: plan.slug, interval: "monthly") %></p>
|
||||
<% end %>
|
||||
<ul>
|
||||
<li>Staff trasmissione: <%= plan.max_staff_transmission || "illimitato" %> / anno</li>
|
||||
|
||||
@@ -32,7 +32,7 @@ RSpec.describe Public::BillingHelper, type: :helper do
|
||||
current_interval: "yearly"
|
||||
)
|
||||
expect(action[:kind]).to eq(:current)
|
||||
expect(action[:label]).to include("€39,90/anno")
|
||||
expect(action[:label]).to include("€40/anno")
|
||||
end
|
||||
|
||||
it "propone cambio intervallo sullo stesso piano" do
|
||||
|
||||
@@ -72,7 +72,7 @@ RSpec.describe "Public club billing", type: :request do
|
||||
get public_club_billing_path(club)
|
||||
|
||||
expect(response.body).to include("Completa dati di fatturazione")
|
||||
expect(response.body).not_to include("Attiva Premium Light — €39,90/anno")
|
||||
expect(response.body).not_to include("Attiva Premium Light — €40/anno")
|
||||
end
|
||||
|
||||
it "dopo profilo completo reindirizza al checkout" do
|
||||
@@ -111,8 +111,8 @@ RSpec.describe "Public club billing", type: :request do
|
||||
|
||||
login!
|
||||
get public_club_billing_path(club)
|
||||
expect(response.body).to include("Attiva Premium Light — €39,90/anno")
|
||||
expect(response.body).to include("Attiva Premium Light — €4,90/mese")
|
||||
expect(response.body).to include("Attiva Premium Light — €40/anno")
|
||||
expect(response.body).to include("Attiva Premium Light — €5/mese")
|
||||
|
||||
allow(Billing::Stripe::CheckoutSession).to receive(:new).and_return(
|
||||
instance_double(Billing::Stripe::CheckoutSession, url: "https://checkout.stripe.com/test")
|
||||
|
||||
@@ -7,8 +7,10 @@ Crea **2 prodotti** in Stripe, ciascuno con **2 prezzi ricorrenti**:
|
||||
|
||||
| Piano app | Prodotto Stripe (Dashboard) | Mensile | Annuale | Variabile `.env` |
|
||||
|-----------|------------------------------|---------|---------|------------------|
|
||||
| Premium Light | **Match Live TV** | €4,90 | €39,90 | `STRIPE_PREMIUM_LIGHT_MONTHLY_PRICE_ID` / `..._YEARLY_...` |
|
||||
| Premium Full | **Match Live TV PRO** | €9,90 | €69,90 | `STRIPE_PREMIUM_FULL_MONTHLY_PRICE_ID` / `..._YEARLY_...` |
|
||||
| Premium Light | **Match Live TV** | €5 | €40 | `STRIPE_PREMIUM_LIGHT_MONTHLY_PRICE_ID` / `..._YEARLY_...` |
|
||||
| Premium Full | **Match Live TV PRO** | €20 | €200 | `STRIPE_PREMIUM_FULL_MONTHLY_PRICE_ID` / `..._YEARLY_...` |
|
||||
|
||||
Gli importi in Stripe Dashboard devono coincidere con il sito (€5/€40 e €20/€200).
|
||||
|
||||
In Stripe apri ogni prezzo e copia l’**ID prezzo** (`price_...`), non l’ID prodotto.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user