mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
Rename billing to payment throughout the codebase (#726)
* Rename billing to payment throughout the codebase This change updates terminology from "billing" to "payment" to better reflect that these are contributions/payments rather than bills. Changes include: - Rename BillingsController to PaymentsController - Rename billing_email to payment_email - Rename next_billing_date to next_payment_date - Rename create_billing_portal_session_url to create_payment_portal_session_url - Update routes from billing to payment - Update all 12 locale files with new terminology - Update views, helpers, and tests * Update app/views/subscriptions/upgrade.html.erb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Juan José Mata <jjmata@jjmata.com> --------- Signed-off-by: Juan José Mata <jjmata@jjmata.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
class Settings::BillingsController < ApplicationController
|
||||
class Settings::PaymentsController < ApplicationController
|
||||
layout "settings"
|
||||
|
||||
def show
|
||||
@@ -16,7 +16,7 @@ class SubscriptionsController < ApplicationController
|
||||
checkout_session = stripe.create_checkout_session(
|
||||
plan: params[:plan],
|
||||
family_id: Current.family.id,
|
||||
family_email: Current.family.billing_email,
|
||||
family_email: Current.family.payment_email,
|
||||
success_url: success_subscription_url + "?session_id={CHECKOUT_SESSION_ID}",
|
||||
cancel_url: upgrade_subscription_url
|
||||
)
|
||||
@@ -37,9 +37,9 @@ class SubscriptionsController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
portal_session_url = stripe.create_billing_portal_session_url(
|
||||
portal_session_url = stripe.create_payment_portal_session_url(
|
||||
customer_id: Current.family.stripe_customer_id,
|
||||
return_url: settings_billing_url
|
||||
return_url: settings_payment_url
|
||||
)
|
||||
|
||||
redirect_to portal_session_url, allow_other_host: true, status: :see_other
|
||||
|
||||
@@ -6,7 +6,7 @@ module SettingsHelper
|
||||
{ name: "Preferences", path: :settings_preferences_path },
|
||||
{ name: "Profile Info", path: :settings_profile_path },
|
||||
{ name: "Security", path: :settings_security_path },
|
||||
{ name: "Billing", path: :settings_billing_path, condition: :not_self_hosted? },
|
||||
{ name: "Payment", path: :settings_payment_path, condition: :not_self_hosted? },
|
||||
# Transactions section
|
||||
{ name: "Categories", path: :categories_path },
|
||||
{ name: "Tags", path: :tags_path },
|
||||
|
||||
@@ -5,7 +5,7 @@ module Family::Subscribeable
|
||||
has_one :subscription, dependent: :destroy
|
||||
end
|
||||
|
||||
def billing_email
|
||||
def payment_email
|
||||
primary_admin = users.admin.order(:created_at).first || users.super_admin.order(:created_at).first
|
||||
|
||||
unless primary_admin.present?
|
||||
@@ -45,7 +45,7 @@ module Family::Subscribeable
|
||||
subscription.nil? && !self_hoster?
|
||||
end
|
||||
|
||||
def next_billing_date
|
||||
def next_payment_date
|
||||
subscription&.current_period_ends_at
|
||||
end
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class Provider::Stripe
|
||||
CheckoutSessionResult.new(success?: false, subscription_id: nil)
|
||||
end
|
||||
|
||||
def create_billing_portal_session_url(customer_id:, return_url:)
|
||||
def create_payment_portal_session_url(customer_id:, return_url:)
|
||||
client.v1.billing_portal.sessions.create(
|
||||
customer: customer_id,
|
||||
return_url: return_url
|
||||
|
||||
@@ -8,7 +8,7 @@ nav_sections = [
|
||||
{ label: t(".preferences_label"), path: settings_preferences_path, icon: "bolt" },
|
||||
{ label: t(".profile_label"), path: settings_profile_path, icon: "circle-user" },
|
||||
{ label: t(".security_label"), path: settings_security_path, icon: "shield-check" },
|
||||
{ label: t(".billing_label"), path: settings_billing_path, icon: "circle-dollar-sign", if: !self_hosted? }
|
||||
{ label: t(".payment_label"), path: settings_payment_path, icon: "circle-dollar-sign", if: !self_hosted? }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<p class="text-primary">
|
||||
<span>You are currently subscribed to the <span class="font-medium"><%= @family.subscription.name %></span>.</span>
|
||||
|
||||
<% if @family.next_billing_date %>
|
||||
<span>Your plan renews on <span class="font-medium"><%= @family.next_billing_date.strftime("%B %d, %Y") %></span>.</span>
|
||||
<% if @family.next_payment_date %>
|
||||
<span>Your plan renews on <span class="font-medium"><%= @family.next_payment_date.strftime("%B %d, %Y") %></span>.</span>
|
||||
<% end %>
|
||||
</p>
|
||||
<% elsif @family.trialing? %>
|
||||
@@ -28,7 +28,7 @@
|
||||
</p>
|
||||
<% else %>
|
||||
<p class="text-primary">You are currently <span class="font-medium">not subscribed</span></p>
|
||||
<p class="text-secondary">Once you subscribe to <%= product_name %>, you'll see your billing settings here.</p>
|
||||
<p class="text-secondary">Once you subscribe to <%= product_name %>, you'll see your payment settings here.</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<%= image_tag "stripe-logo.svg", class: "w-5 h-5 shrink-0" %>
|
||||
<p class="text-secondary text-sm">Billing via Stripe</p>
|
||||
<p class="text-secondary text-sm">Payment via Stripe</p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -52,7 +52,7 @@
|
||||
) %>
|
||||
|
||||
<p class="text-xs text-secondary">
|
||||
In the next step, you'll be redirected to Stripe which handles our billing.
|
||||
In the next step, you'll be redirected to Stripe which handles our payments.
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -19,10 +19,10 @@ ca:
|
||||
subtitle: La IA categoritza automàticament les teves transaccions segons
|
||||
les categories definides
|
||||
title: Categoritzador de transaccions
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Facturació
|
||||
subscription_subtitle: Actualitza la teva subscripció i dades de facturació
|
||||
page_title: Pagament
|
||||
subscription_subtitle: Actualitza la teva subscripció i dades de pagament
|
||||
subscription_title: Gestiona la subscripció
|
||||
hostings:
|
||||
ensure_admin:
|
||||
@@ -123,7 +123,7 @@ ca:
|
||||
api_key_label: Clau API
|
||||
api_keys_label: Clau API
|
||||
bank_sync_label: Sincronització bancària
|
||||
billing_label: Facturació
|
||||
payment_label: Pagament
|
||||
categories_label: Categories
|
||||
feedback_label: Feedback
|
||||
general_section_title: General
|
||||
|
||||
@@ -15,10 +15,10 @@ de:
|
||||
merchant_detector:
|
||||
title: Händlererkennung
|
||||
subtitle: Die KI identifiziert und ergänzt Transaktionsdaten mit Händlerinformationen
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Abrechnung
|
||||
subscription_subtitle: Aktualisiere dein Abonnement und deine Rechnungsdetails
|
||||
page_title: Zahlung
|
||||
subscription_subtitle: Aktualisiere dein Abonnement und deine Zahlungsdetails
|
||||
subscription_title: Abonnement verwalten
|
||||
preferences:
|
||||
show:
|
||||
@@ -90,7 +90,7 @@ de:
|
||||
advanced_section_title: Erweitert
|
||||
ai_prompts_label: KI-Eingabeaufforderungen
|
||||
api_key_label: API-Schlüssel
|
||||
billing_label: Abrechnung
|
||||
payment_label: Zahlung
|
||||
categories_label: Kategorien
|
||||
feedback_label: Feedback
|
||||
general_section_title: Allgemein
|
||||
|
||||
@@ -16,10 +16,10 @@ en:
|
||||
merchant_detector:
|
||||
title: Merchant Detector
|
||||
subtitle: AI identifies and enriches transaction data with merchant information
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Billing
|
||||
subscription_subtitle: Update your subscription and billing details
|
||||
page_title: Payment
|
||||
subscription_subtitle: Update your subscription and payment details
|
||||
subscription_title: Manage subscription
|
||||
preferences:
|
||||
show:
|
||||
@@ -111,7 +111,7 @@ en:
|
||||
advanced_section_title: Advanced
|
||||
ai_prompts_label: AI Prompts
|
||||
api_key_label: API Key
|
||||
billing_label: Billing
|
||||
payment_label: Payment
|
||||
categories_label: Categories
|
||||
feedback_label: Feedback
|
||||
general_section_title: General
|
||||
|
||||
@@ -16,10 +16,10 @@ es:
|
||||
merchant_detector:
|
||||
title: Detector de Comerciantes
|
||||
subtitle: La IA identifica y enriquece los datos de transacciones con información de comerciantes
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Facturación
|
||||
subscription_subtitle: Actualiza tu suscripción y detalles de facturación
|
||||
page_title: Pago
|
||||
subscription_subtitle: Actualiza tu suscripción y detalles de pago
|
||||
subscription_title: Gestionar suscripción
|
||||
preferences:
|
||||
show:
|
||||
@@ -91,7 +91,7 @@ es:
|
||||
advanced_section_title: Avanzado
|
||||
ai_prompts_label: Indicaciones de IA
|
||||
api_key_label: Clave API
|
||||
billing_label: Facturación
|
||||
payment_label: Pago
|
||||
categories_label: Categorías
|
||||
feedback_label: Comentarios
|
||||
general_section_title: General
|
||||
|
||||
@@ -16,10 +16,10 @@ fr:
|
||||
merchant_detector:
|
||||
title: Détection du vendeur
|
||||
subtitle: L'IA identifie et enrichit les données de transaction avec des informations sur le vendeur
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Facturation
|
||||
subscription_subtitle: Mettez à jour votre abonnement et vos détails de facturation
|
||||
page_title: Paiement
|
||||
subscription_subtitle: Mettez à jour votre abonnement et vos détails de paiement
|
||||
subscription_title: Gérer l'abonnement
|
||||
preferences:
|
||||
show:
|
||||
@@ -108,7 +108,7 @@ fr:
|
||||
advanced_section_title: Avancé
|
||||
ai_prompts_label: Prompts IA
|
||||
api_key_label: Clé API
|
||||
billing_label: Facturation
|
||||
payment_label: Paiement
|
||||
categories_label: Catégories
|
||||
feedback_label: Retour d'information
|
||||
general_section_title: Général
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
nb:
|
||||
settings:
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Fakturering
|
||||
subscription_subtitle: Oppdater abonnementet og faktureringsdetaljene dine
|
||||
page_title: Betaling
|
||||
subscription_subtitle: Oppdater abonnementet og betalingsdetaljene dine
|
||||
subscription_title: Administrer abonnement
|
||||
preferences:
|
||||
show:
|
||||
@@ -76,7 +76,7 @@ nb:
|
||||
accounts_label: Kontoer
|
||||
api_key_label: API-nøkkel
|
||||
advanced_section_title: Avansert
|
||||
billing_label: Fakturering
|
||||
payment_label: Betaling
|
||||
categories_label: Kategorier
|
||||
feedback_label: Tilbakemelding
|
||||
general_section_title: Generelt
|
||||
|
||||
@@ -16,10 +16,10 @@ nl:
|
||||
merchant_detector:
|
||||
title: Handelaar Detectie
|
||||
subtitle: AI identificeert en verrijkt transactiegegevens met handelaarsinformatie
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Facturering
|
||||
subscription_subtitle: Werk uw abonnement en factureringsgegevens bij
|
||||
page_title: Betaling
|
||||
subscription_subtitle: Werk uw abonnement en betalingsgegevens bij
|
||||
subscription_title: Abonnement beheren
|
||||
preferences:
|
||||
show:
|
||||
@@ -111,7 +111,7 @@ nl:
|
||||
advanced_section_title: Geavanceerd
|
||||
ai_prompts_label: AI Prompts
|
||||
api_key_label: API Key
|
||||
billing_label: Facturering
|
||||
payment_label: Betaling
|
||||
categories_label: Categorieën
|
||||
feedback_label: Feedback
|
||||
general_section_title: Algemeen
|
||||
|
||||
@@ -16,10 +16,10 @@ pt-BR:
|
||||
merchant_detector:
|
||||
title: Detector de Estabelecimentos
|
||||
subtitle: A IA identifica e enriquece dados de transações com informações do estabelecimento
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Cobrança
|
||||
subscription_subtitle: Atualize sua assinatura e detalhes de cobrança
|
||||
page_title: Pagamento
|
||||
subscription_subtitle: Atualize sua assinatura e detalhes de pagamento
|
||||
subscription_title: Gerenciar assinatura
|
||||
preferences:
|
||||
show:
|
||||
@@ -86,7 +86,7 @@ pt-BR:
|
||||
settings_nav:
|
||||
accounts_label: Contas
|
||||
api_key_label: Chave da API
|
||||
billing_label: Cobrança
|
||||
payment_label: Pagamento
|
||||
categories_label: Categorias
|
||||
feedback_label: Feedback
|
||||
general_section_title: Geral
|
||||
|
||||
@@ -16,10 +16,10 @@ ro:
|
||||
merchant_detector:
|
||||
title: Detector de comercianți
|
||||
subtitle: AI identifică și îmbogățește datele tranzacțiilor cu informații despre comercianți
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Facturare
|
||||
subscription_subtitle: Actualizează-ți abonamentul și detaliile de facturare
|
||||
page_title: Plată
|
||||
subscription_subtitle: Actualizează-ți abonamentul și detaliile de plată
|
||||
subscription_title: Gestionează abonamentul
|
||||
preferences:
|
||||
show:
|
||||
@@ -94,7 +94,7 @@ ro:
|
||||
advanced_section_title: Avansat
|
||||
ai_prompts_label: Prompturi AI
|
||||
api_key_label: Cheie API
|
||||
billing_label: Facturare
|
||||
payment_label: Plată
|
||||
categories_label: Categorii
|
||||
feedback_label: Feedback
|
||||
general_section_title: General
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
tr:
|
||||
settings:
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: Faturalandırma
|
||||
subscription_subtitle: Abonelik ve fatura bilgilerinizi güncelleyin
|
||||
page_title: Ödeme
|
||||
subscription_subtitle: Abonelik ve ödeme bilgilerinizi güncelleyin
|
||||
subscription_title: Aboneliği yönet
|
||||
preferences:
|
||||
show:
|
||||
@@ -74,7 +74,7 @@ tr:
|
||||
accounts_label: Hesaplar
|
||||
api_key_label: API Anahtarı
|
||||
advanced_section_title: Gelişmiş
|
||||
billing_label: Faturalandırma
|
||||
payment_label: Ödeme
|
||||
categories_label: Kategoriler
|
||||
feedback_label: Geri Bildirim
|
||||
general_section_title: Genel
|
||||
|
||||
@@ -16,10 +16,10 @@ zh-CN:
|
||||
transaction_categorizer:
|
||||
subtitle: AI 根据您定义的分类自动为交易进行分类
|
||||
title: 交易分类器
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: 账单管理
|
||||
subscription_subtitle: 更新订阅与账单信息
|
||||
page_title: 付款管理
|
||||
subscription_subtitle: 更新订阅与付款信息
|
||||
subscription_title: 管理订阅
|
||||
hostings:
|
||||
ensure_admin:
|
||||
@@ -96,7 +96,7 @@ zh-CN:
|
||||
api_key_label: API 密钥
|
||||
api_keys_label: API 密钥
|
||||
bank_sync_label: 银行同步
|
||||
billing_label: 账单管理
|
||||
payment_label: 付款管理
|
||||
categories_label: 分类管理
|
||||
feedback_label: 意见反馈
|
||||
general_section_title: 通用设置
|
||||
|
||||
@@ -16,10 +16,10 @@ zh-TW:
|
||||
merchant_detector:
|
||||
title: 商家偵測器
|
||||
subtitle: AI 會辨識交易資料並自動補全商家資訊
|
||||
billings:
|
||||
payments:
|
||||
show:
|
||||
page_title: 帳單
|
||||
subscription_subtitle: 更新您的訂閱方案與帳單詳情
|
||||
page_title: 付款
|
||||
subscription_subtitle: 更新您的訂閱方案與付款詳情
|
||||
subscription_title: 管理訂閱
|
||||
preferences:
|
||||
show:
|
||||
@@ -91,7 +91,7 @@ zh-TW:
|
||||
advanced_section_title: 進階設定
|
||||
ai_prompts_label: AI 提示詞
|
||||
api_key_label: API 金鑰
|
||||
billing_label: 帳單
|
||||
payment_label: 付款
|
||||
categories_label: 類別
|
||||
feedback_label: 意見回饋
|
||||
general_section_title: 一般
|
||||
|
||||
@@ -99,7 +99,7 @@ Rails.application.routes.draw do
|
||||
resource :hosting, only: %i[show update] do
|
||||
delete :clear_cache, on: :collection
|
||||
end
|
||||
resource :billing, only: :show
|
||||
resource :payment, only: :show
|
||||
resource :security, only: :show
|
||||
resources :sso_identities, only: :destroy
|
||||
resource :api_key, only: [ :show, :new, :create, :destroy ]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require "test_helper"
|
||||
|
||||
class Settings::BillingsControllerTest < ActionDispatch::IntegrationTest
|
||||
class Settings::PaymentsControllerTest < ActionDispatch::IntegrationTest
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
@@ -44,7 +44,7 @@ class SubscriptionsControllerTest < ActionDispatch::IntegrationTest
|
||||
@mock_stripe.expects(:create_checkout_session).with(
|
||||
plan: "monthly",
|
||||
family_id: @family.id,
|
||||
family_email: @family.billing_email,
|
||||
family_email: @family.payment_email,
|
||||
success_url: success_subscription_url + "?session_id={CHECKOUT_SESSION_ID}",
|
||||
cancel_url: upgrade_subscription_url
|
||||
).returns(
|
||||
|
||||
@@ -63,10 +63,10 @@ class SettingsTest < ApplicationSystemTestCase
|
||||
assert_selector 'span[data-clipboard-target="iconSuccess"]', visible: true, count: 1 # text copied and icon changed to checkmark
|
||||
end
|
||||
|
||||
test "does not show billing link if self hosting" do
|
||||
test "does not show payment link if self hosting" do
|
||||
Rails.application.config.app_mode.stubs(:self_hosted?).returns(true)
|
||||
open_settings_from_sidebar
|
||||
assert_no_selector "li", text: I18n.t("settings.settings_nav.billing_label")
|
||||
assert_no_selector "li", text: I18n.t("settings.settings_nav.payment_label")
|
||||
end
|
||||
|
||||
test "does not show admin settings to non-admin users" do
|
||||
|
||||
Reference in New Issue
Block a user