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:
@@ -33,4 +33,8 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% elsif subscription&.bank_transfer? %>
|
||||
<p style="color:#888;font-size:0.9rem;margin-top:0">
|
||||
<%= raw t("billing.subscription_status.bank_transfer_until_html", date: l_local(subscription.current_period_end.to_date)) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<%# locals: (order:) %>
|
||||
<% return if order.blank? %>
|
||||
<div class="card" style="margin-top:16px;border-color:#3d3520;background:#1a1810">
|
||||
<p style="margin:0 0 8px;color:#ddd">
|
||||
<strong><%= t("billing.bank_transfer.pending_title") %></strong>
|
||||
<%= raw t("billing.bank_transfer.pending_body_html",
|
||||
plan: order.plan.name,
|
||||
price: order.price_label,
|
||||
causal: order.payment_causal) %>
|
||||
</p>
|
||||
<p style="margin:0;color:#aaa;font-size:0.9rem">
|
||||
<%= raw t("billing.bank_transfer.pending_proof_html",
|
||||
email_link: mail_to(MatchLiveTv.bank_transfer_proof_email, MatchLiveTv.bank_transfer_proof_email)) %>
|
||||
</p>
|
||||
</div>
|
||||
@@ -13,7 +13,8 @@
|
||||
target_plan: plan,
|
||||
stripe_subscription_active: stripe_subscription_active?(subscription),
|
||||
current_interval: current_interval,
|
||||
subscription: subscription
|
||||
subscription: subscription,
|
||||
club: club
|
||||
) : nil %>
|
||||
<% featured = plan.slug == "premium_full" %>
|
||||
<div class="plan-card<%= " plan-card--featured" if featured %>">
|
||||
@@ -23,6 +24,13 @@
|
||||
<%= render "shared/plan_title", plan: plan %>
|
||||
<% if plan.slug == "free" %>
|
||||
<div class="plan-price">€0</div>
|
||||
<% elsif billing_mode && club&.active_billing_quote&.plan_slug == plan.slug %>
|
||||
<% quote = club.active_billing_quote %>
|
||||
<div class="plan-price-block">
|
||||
<div class="plan-price<%= " plan-price--featured" if featured %>"><%= quote.formatted_amount %></div>
|
||||
<span class="plan-price-badge"><%= t("billing.bank_transfer.quoted_badge") %></span>
|
||||
<p class="plan-price-equiv"><%= t("billing.bank_transfer.quoted_interval.#{quote.billing_interval}") %></p>
|
||||
</div>
|
||||
<% else %>
|
||||
<% yearly = Billing::Stripe::PriceCatalog.label(plan_slug: plan.slug, interval: "yearly") %>
|
||||
<% monthly = Billing::Stripe::PriceCatalog.label(plan_slug: plan.slug, interval: "monthly") %>
|
||||
@@ -63,12 +71,14 @@
|
||||
<% end %>
|
||||
<% if billing_mode %>
|
||||
<% action_kind = action[:kind] %>
|
||||
<% quote = club&.active_billing_quote %>
|
||||
<% pending_transfer = club&.pending_transfer_order %>
|
||||
<% if action_kind == :current %>
|
||||
<span class="btn btn-secondary" style="opacity:0.7"><%= action[:label] %></span>
|
||||
<% elsif action_kind == :none %>
|
||||
<% elsif action_kind.in?(%i[contact disabled]) %>
|
||||
<% elsif action_kind.in?(%i[contact disabled quoted_other]) %>
|
||||
<p class="plan-action-hint"><%= action[:label] %></p>
|
||||
<% elsif action_kind == :checkout_options || action_kind == :change_options || action_kind == :interval_switch %>
|
||||
<% elsif action_kind.in?(%i[checkout_options change_options interval_switch quoted bank_only]) %>
|
||||
<% if billing_profile_blocks_premium?(club) %>
|
||||
<p class="plan-action-hint" style="color:#e53935;margin-bottom:10px">
|
||||
<%= billing_profile_incomplete_message(club) %>
|
||||
@@ -77,14 +87,33 @@
|
||||
public_club_billing_profile_path(club, plan: plan.slug),
|
||||
class: "btn btn-primary" %>
|
||||
<% else %>
|
||||
<div class="plan-interval-actions">
|
||||
<% plan_intervals_for_display(action[:intervals]).each do |interval| %>
|
||||
<% btn_kind = action_kind == :checkout_options ? :checkout_options : action_kind %>
|
||||
<%= link_to plan_interval_button_label(plan, interval, kind: btn_kind),
|
||||
plan_interval_checkout_path(club, plan, interval),
|
||||
class: plan_interval_button_class(interval) %>
|
||||
<% unless action_kind.in?(%i[quoted bank_only]) %>
|
||||
<div class="plan-interval-actions">
|
||||
<% plan_intervals_for_display(action[:intervals]).each do |interval| %>
|
||||
<% btn_kind = action_kind == :checkout_options ? :checkout_options : action_kind %>
|
||||
<%= link_to plan_interval_button_label(plan, interval, kind: btn_kind),
|
||||
plan_interval_checkout_path(club, plan, interval),
|
||||
class: plan_interval_button_class(interval) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% transfer_intervals = action_kind == :quoted ? action[:intervals] : (action[:intervals].presence || bank_transfer_intervals_for(plan)) %>
|
||||
<% if MatchLiveTv.bank_transfer_configured? && transfer_intervals.any? %>
|
||||
<% unless action_kind.in?(%i[quoted bank_only]) %>
|
||||
<p class="plan-action-hint" style="margin:10px 0 6px"><%= t("billing.bank_transfer.or_label") %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="plan-interval-actions">
|
||||
<% plan_intervals_for_display(transfer_intervals).each do |interval| %>
|
||||
<% next unless show_bank_transfer_for?(club: club, plan: plan, interval: interval, quote: quote, pending_transfer: pending_transfer) %>
|
||||
<%= button_to t("billing.bank_transfer.pay_button_with_price", price: bank_transfer_price_label(plan, interval, quote: quote)),
|
||||
public_club_billing_bank_transfer_path(club, plan: plan.slug, interval: interval),
|
||||
method: :post,
|
||||
class: "btn btn-outline plan-interval-btn",
|
||||
form: { data: { turbo_confirm: t("billing.bank_transfer.hint") } } %>
|
||||
<% end %>
|
||||
</div>
|
||||
<p class="plan-action-hint" style="margin-top:8px"><%= t("billing.bank_transfer.hint") %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% elsif plan.slug == "free" %>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<%# locals: (quote:) %>
|
||||
<% return if quote.blank? %>
|
||||
<div class="card" style="margin-top:16px;border-color:#2e5a3c;background:#142018">
|
||||
<p style="margin:0;color:#ddd">
|
||||
<strong><%= t("billing.bank_transfer.quote_banner_title") %></strong>
|
||||
<%= raw t("billing.bank_transfer.quote_banner_body_html", plan: quote.plan.name, price: quote.price_label) %>
|
||||
</p>
|
||||
<% if quote.note.present? %>
|
||||
<p style="margin:8px 0 0;color:#aaa;font-size:0.9rem"><%= t("billing.bank_transfer.quote_note", note: quote.note) %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
<%# locals: (club:, subscription:) %>
|
||||
<% return unless subscription&.premium? && subscription.stripe_subscription_id.present? && MatchLiveTv.stripe_enabled? %>
|
||||
<% return unless subscription&.premium? && MatchLiveTv.stripe_enabled? && subscription.stripe_subscription_id.present? %>
|
||||
|
||||
<section id="subscription-cancel" class="subscription-cancel" style="margin-top:24px;padding:16px;border:1px solid #333;border-radius:8px">
|
||||
<% if subscription.cancel_at_period_end? %>
|
||||
|
||||
Reference in New Issue
Block a user