mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-10 16:05:22 +02:00
Subscription tests and domain (#2209)
* Save work * Subscriptions and trials domain * Store family ID on customer * Remove indirection of stripe calls * Test simplifications * Update brakeman * Fix stripe tests in CI * Update billing page to show subscription details * Remove legacy columns * Complete billing settings page * Fix hardcoded plan name * Handle subscriptions for self hosting mode * Lint fixes
This commit is contained in:
parent
8c10e87387
commit
5da4bb6dc3
40 changed files with 1041 additions and 233 deletions
|
@ -11,19 +11,21 @@
|
|||
) %>
|
||||
|
||||
<div class="text-sm space-y-1">
|
||||
<% if subscription_pending? %>
|
||||
<% if @family.has_active_subscription? %>
|
||||
<p class="text-primary">
|
||||
Your subscription is pending. You can still use Maybe+ while we process your subscription.
|
||||
<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>
|
||||
<% end %>
|
||||
</p>
|
||||
<% elsif @user.family.trialing? %>
|
||||
<% elsif @family.trialing? %>
|
||||
<p class="text-primary">
|
||||
You are currently trialing <span class="font-medium">Maybe+</span>
|
||||
You are currently trialing Maybe
|
||||
<span class="text-secondary">
|
||||
(<%= @user.family.trial_remaining_days %> days remaining)
|
||||
(<%= @family.days_left_in_trial %> days remaining)
|
||||
</span>
|
||||
</p>
|
||||
<% elsif @user.family.subscribed? %>
|
||||
<p class="text-primary">You are currently subscribed to <span class="font-medium">Maybe+</span></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 Maybe+, you'll see your billing settings here.</p>
|
||||
|
@ -31,7 +33,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<% if @user.family.subscribed? %>
|
||||
<% if @family.has_active_subscription? %>
|
||||
<%= render LinkComponent.new(
|
||||
text: "Manage",
|
||||
icon: "external-link",
|
||||
|
@ -40,7 +42,7 @@
|
|||
href: subscription_path,
|
||||
rel: "noopener"
|
||||
) %>
|
||||
<% elsif @user.family.trialing? && !subscription_pending? %>
|
||||
<% else %>
|
||||
<%= render LinkComponent.new(
|
||||
text: "Choose plan",
|
||||
variant: "primary",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue