Aggiunge pagamento con bonifico e importo concordato per società.

Il piano si attiva solo dopo la conferma admin; Stripe resta a listino se non c'è un prezzo commerciale.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 23:20:43 +02:00
co-authored by Cursor
parent 1e4e0560f1
commit e436f5ece4
56 changed files with 1571 additions and 53 deletions
@@ -73,6 +73,30 @@ module MatchLiveTv
stripe_secret_key.present?
end
def bank_transfer_iban
ENV["BANK_TRANSFER_IBAN"].to_s.gsub(/\s+/, "").presence
end
def bank_transfer_account_holder
ENV["BANK_TRANSFER_ACCOUNT_HOLDER"].to_s.strip.presence
end
def bank_transfer_bank_name
ENV["BANK_TRANSFER_BANK_NAME"].to_s.strip.presence
end
def bank_transfer_bic
ENV["BANK_TRANSFER_BIC"].to_s.strip.presence
end
def bank_transfer_proof_email
ENV["BANK_TRANSFER_PROOF_EMAIL"].presence || support_email
end
def bank_transfer_configured?
bank_transfer_iban.present? && bank_transfer_account_holder.present?
end
def privacy_controller_name
ENV.fetch("PRIVACY_CONTROLLER_NAME", "Emiliano Frascaro")
end
+36
View File
@@ -44,6 +44,10 @@ it:
invoice_issued: "Fattura %{number} emessa e inviata a %{email}."
invoice_updated: "Fattura %{number} aggiornata."
invoice_uploaded: "Fattura caricata e inviata a %{email}."
quote_saved: "Prezzo concordato salvato per %{club}: %{plan} a %{amount}."
quote_revoked: "Prezzo concordato revocato per %{club}."
transfer_confirmed: "Bonifico confermato: piano %{plan} attivo per %{club}."
transfer_cancelled: Bonifico in attesa annullato.
youtube_not_configured: Configura YOUTUBE_CLIENT_ID e YOUTUBE_CLIENT_SECRET in .env
common:
free_plan: Free
@@ -193,6 +197,7 @@ it:
teams: Squadre
comped: Omaggio
stripe: Stripe
quote: Concordato
manage: Gestisci
invoices: Fatture
show:
@@ -228,6 +233,22 @@ it:
reason_label: "Motivo (es. sponsor 2026)"
reason_placeholder: "Sponsor, promozione…"
grant_button: Concedi omaggio
quote:
title: Prezzo concordato (bonifico)
description: "Importo commerciale per questa società: piano, cadenza e cifra in euro. In billing la società vede solo questo prezzo e può pagare solo con bonifico. L'omaggio (0 €) resta nella card sopra."
none: Nessun prezzo concordato. La società paga a listino (carta o bonifico).
active_html: "<strong>%{plan}</strong> · %{interval} · <strong>%{amount}</strong>"
note_label: "Nota:"
plan_label: Piano
interval_label: Cadenza
interval_yearly: Annuale
interval_monthly: Mensile
amount_label: "Importo (€)"
amount_placeholder: "es. 150 oppure 150,00"
commercial_note_label: Nota commerciale (opzionale)
save_button: Salva prezzo concordato
revoke_button: Revoca prezzo concordato
revoke_confirm: "Revocare il prezzo concordato per %{club}? Tornerà il listino (carta + bonifico)."
teams:
show:
back: "← %{club}"
@@ -281,6 +302,21 @@ it:
index:
title: Pagamenti da fatturare
description: "Pagamenti Stripe pagati senza PDF fattura. Genera il PDF nei tuoi sistemi, poi caricalo qui: viene associato al pagamento e inviato via email al cliente."
transfers_title: Bonifici in attesa
transfers_description: "La società ha chiesto di pagare con bonifico: il piano non è ancora attivo. Conferma dopo l'accredito (puoi allegare subito il PDF fattura)."
transfers_none: Nessun bonifico in attesa.
transfers_table:
club: Società
plan: Piano
amount: Importo
causal: Causale
requested: Richiesto
confirm_button: Conferma pagamento e attiva
cancel_button: Annulla richiesta
cancel_confirm: Annullare questa richiesta di bonifico?
pdf_optional: PDF fattura (opzionale)
kind_quote: prezzo concordato
kind_list: listino
filter_label: "Filtra società:"
filter_all: Tutte
incomplete_profile_warning: Dati fatturazione incompleti
+21
View File
@@ -334,6 +334,7 @@ it:
contact_for_free: "Per passare al piano Free, contatta il supporto."
stripe_not_configured: Stripe non configurato
stripe_prices_not_configured: Prezzi Stripe non configurati
bank_transfer_not_configured: Bonifico non ancora configurato
complete_billing_prefix: Completa i dati di fatturazione prima di attivare un piano premium.
profile_incomplete_default: Completa i dati di fatturazione prima di attivare un piano premium.
profile_missing: "Mancano: %{fields}."
@@ -396,6 +397,7 @@ it:
end_of_period: fine periodo
next_renewal: prossimo rinnovo
next_renewal_label: "Prossimo rinnovo: %{date}"
bank_transfer_until_html: "Pagato con bonifico, valido fino al <strong>%{date}</strong> (nessun rinnovo automatico)."
plan_change_info:
trigger_label: Info cambio piano e fatturazione
title: Cambio piano e fatturazione
@@ -425,6 +427,23 @@ it:
prices:
yearly: "%{amount}/anno"
monthly: "%{amount}/mese"
bank_transfer:
quoted_badge: Prezzo concordato
quoted_interval:
yearly: fatturazione annuale, solo bonifico
monthly: fatturazione mensile, solo bonifico
quoted_other: "Per questa società è attivo un prezzo concordato su un altro piano."
pay_button: Paga con bonifico
pay_button_with_price: "Paga con bonifico — %{price}"
or_label: oppure
pending_title: Bonifico in attesa di conferma
pending_body_html: "Hai richiesto <strong>%{plan}</strong> (%{price}). Il piano si attiverà dopo la conferma del pagamento. Causale: <strong>%{causal}</strong>."
pending_proof_html: "Invia la distinta a %{email_link}."
quote_banner_title: Prezzo concordato
quote_banner_body_html: "Per questa società vale <strong>%{plan}</strong> a <strong>%{price}</strong>. Il pagamento avviene solo con bonifico (non con carta)."
quote_note: "Nota commerciale: %{note}"
hint: "Il piano resta quello attuale finché Match Live TV non conferma l'accredito."
renewal_html: "Con il bonifico l'abbonamento non si rinnova da solo: alla scadenza torna Free, salvo nuovo bonifico o rinnovo da parte nostra."
regia:
meta_title_fallback: "Regia — Match Live TV"
title: "Regia — %{home} vs %{away}"
@@ -627,6 +646,8 @@ it:
subscription_canceled: "Abbonamento disdetto. Resta attivo fino al %{date}; da quel giorno passerai al piano Free."
stripe_error: "Errore Stripe: %{message}"
invoice_pdf_unavailable: PDF fattura non disponibile.
bank_transfer_requested: Istruzioni per il bonifico inviate all'email di fatturazione. Il piano si attiverà dopo la conferma del pagamento.
quote_checkout_denied: "Per questa società è attivo un prezzo concordato: usa il pagamento con bonifico."
club_recordings:
not_authorized: Non autorizzato
teams:
+31
View File
@@ -54,3 +54,34 @@ en:
also_text: It is also available under Subscription on the Match Live TV site.
thanks: Thanks,
signoff: Match Live TV
invoice_activated:
subject: "Plan %{plan} is active — invoice %{number}"
hello: Hello,
period_fallback: the end of the period
body_html: "we received your bank transfer: the <strong>%{plan}</strong> plan is now active for <strong>%{club}</strong> until <strong>%{until_date}</strong>. Invoice <strong>%{number}</strong> for <strong>%{amount}</strong> is attached."
body_text: "we received your bank transfer: the %{plan} plan is now active for %{club} until %{until_date}. Invoice %{number} for %{amount} is attached."
bank_transfer:
thanks: Thanks,
signoff: Match Live TV
instructions:
subject: "Bank transfer instructions — %{plan}"
hello: Hello,
intro_html: "you requested the <strong>%{plan}</strong> plan (%{price}) for <strong>%{club}</strong> with a bank transfer."
intro_text: "you requested the %{plan} plan (%{price}) for %{club} with a bank transfer."
not_active_yet: The plan will be activated only after Match Live TV confirms the payment. Until then your current plan stays active.
iban_label: "IBAN:"
holder_label: "Account holder:"
bank_label: "Bank:"
bic_label: "BIC/SWIFT:"
amount_label: "Amount:"
causal_label: "Payment reference:"
proof_html: "After paying, send the receipt to <strong>%{email}</strong>."
proof_text: "After paying, send the receipt to %{email}."
plan_activated:
subject: "Plan %{plan} is active — Match Live TV"
hello: Hello,
period_fallback: the end of the period
body_html: "we received your bank transfer: the <strong>%{plan}</strong> plan is now active for <strong>%{club}</strong> until <strong>%{until_date}</strong>. The invoice will follow by email shortly."
body_text: "we received your bank transfer: the %{plan} plan is now active for %{club} until %{until_date}. The invoice will follow by email shortly."
invoice_later: You can already use the plan from the Subscription section of your account.
+31
View File
@@ -54,3 +54,34 @@ it:
also_text: È disponibile anche in Abbonamento sul sito Match Live TV.
thanks: Grazie,
signoff: Match Live TV
invoice_activated:
subject: "Piano %{plan} attivo — fattura %{number}"
hello: Buongiorno,
period_fallback: fine periodo
body_html: "abbiamo ricevuto il bonifico: il piano <strong>%{plan}</strong> è attivo per <strong>%{club}</strong> fino al <strong>%{until_date}</strong>. In allegato la fattura <strong>%{number}</strong> di <strong>%{amount}</strong>."
body_text: "abbiamo ricevuto il bonifico: il piano %{plan} è attivo per %{club} fino al %{until_date}. In allegato la fattura %{number} di %{amount}."
bank_transfer:
thanks: Grazie,
signoff: Match Live TV
instructions:
subject: "Istruzioni per il bonifico — %{plan}"
hello: Buongiorno,
intro_html: "hai richiesto l'abbonamento <strong>%{plan}</strong> (%{price}) per <strong>%{club}</strong> con pagamento tramite bonifico."
intro_text: "hai richiesto l'abbonamento %{plan} (%{price}) per %{club} con pagamento tramite bonifico."
not_active_yet: Il piano verrà attivato solo dopo la conferma del pagamento da parte di Match Live TV. Fino ad allora resta attivo il piano attuale.
iban_label: "IBAN:"
holder_label: "Intestatario:"
bank_label: "Banca:"
bic_label: "BIC/SWIFT:"
amount_label: "Importo:"
causal_label: "Causale:"
proof_html: "Dopo il pagamento invia la distinta o la ricevuta a <strong>%{email}</strong>."
proof_text: "Dopo il pagamento invia la distinta o la ricevuta a %{email}."
plan_activated:
subject: "Piano %{plan} attivo — Match Live TV"
hello: Buongiorno,
period_fallback: fine periodo
body_html: "abbiamo ricevuto il bonifico: il piano <strong>%{plan}</strong> è attivo per <strong>%{club}</strong> fino al <strong>%{until_date}</strong>. La fattura ti arriverà a breve via email."
body_text: "abbiamo ricevuto il bonifico: il piano %{plan} è attivo per %{club} fino al %{until_date}. La fattura ti arriverà a breve via email."
invoice_later: Puoi già usare le funzioni del piano dalla sezione Abbonamento del tuo account.
+5
View File
@@ -93,11 +93,15 @@ Rails.application.routes.draw do
end
get "billing", to: "billing#index", as: :billing
post "billing/payments/:payment_id/attach_pdf", to: "billing#attach_pdf", as: :billing_payment_attach_pdf
post "billing/transfers/:id/confirm", to: "billing#confirm_transfer", as: :billing_transfer_confirm
post "billing/transfers/:id/cancel", to: "billing#cancel_transfer", as: :billing_transfer_cancel
resources :teams, only: %i[show]
resources :clubs, only: %i[index show] do
member do
post :grant_comped
delete :revoke_comped
post :set_quote
delete :revoke_quote
end
resources :billing_invoices, only: %i[index new create edit update], controller: "billing_invoices"
resources :club_recordings, only: %i[index update destroy], path: "replays", as: :recordings do
@@ -198,6 +202,7 @@ Rails.application.routes.draw do
get "clubs/:id/billing/profile", to: "club_billing#profile", as: :club_billing_profile
patch "clubs/:id/billing/profile", to: "club_billing#update_profile"
post "clubs/:id/billing/cancel_subscription", to: "club_billing#cancel_subscription", as: :club_billing_cancel_subscription
post "clubs/:id/billing/bank_transfer", to: "club_billing#request_bank_transfer", as: :club_billing_bank_transfer
get "clubs/:id/billing/invoices/:invoice_id", to: "club_billing#download_invoice", as: :club_billing_invoice
get "clubs/:id/checkout", to: "clubs#checkout", as: :club_checkout
post "clubs/:id/portal", to: "clubs#portal", as: :club_portal