This upgrades from the legacy version of Stripe's checkout system to the new version: > The legacy version of Checkout presented customers with a modal dialog > that collected card information, and returned a token or a source to > your website. In contrast, the new version of Checkout is a smart > payment page hosted by Stripe that creates payments or subscriptions. It > supports Apple Pay, Dynamic 3D Secure, and many other features. Basic overview of the new system: * We send the user to a checkout page on Stripe. * Stripe collects payment and sends us a webhook notification when the order is complete. * We receive the webhook notification and upgrade the user. Docs: * https://stripe.com/docs/payments/checkout * https://stripe.com/docs/payments/checkout/migration#client-products * https://stripe.com/docs/payments/handling-payment-events * https://stripe.com/docs/payments/checkout/fulfill-orders
122 lines
4.5 KiB
Plaintext
122 lines
4.5 KiB
Plaintext
<% page_title "Account Upgrade" %>
|
|
<% meta_description "Upgrade to a Gold or Platinum account." %>
|
|
<script src="https://js.stripe.com/v3/"></script>
|
|
|
|
<%= render "users/secondary_links" %>
|
|
|
|
<div id="c-user-upgrades">
|
|
<div id="a-new" class="fixed-width-container">
|
|
<h1>Upgrade Account</h1>
|
|
|
|
<% unless params[:user_id] %>
|
|
<p class="copy">Want more searching power? Upgrade your account and become a power user of the best database of anime artwork on the internet.</p>
|
|
|
|
<div id="feature-comparison">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>Basic</th>
|
|
<th>Gold</th>
|
|
<th>Platinum</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<colgroup id="labels"></colgroup>
|
|
<colgroup id="basic"></colgroup>
|
|
<colgroup id="gold"></colgroup>
|
|
<colgroup id="platinum"></colgroup>
|
|
<tr>
|
|
<td>Cost</td>
|
|
<td>Free</td>
|
|
<td>
|
|
<%= cents_to_usd(UserUpgrade.gold_price) %>
|
|
<div class="fineprint">One time fee</div>
|
|
</td>
|
|
<td>
|
|
<%= cents_to_usd(UserUpgrade.platinum_price) %>
|
|
<div class="fineprint">One time fee</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Tag Limit</td>
|
|
<td>2</td>
|
|
<td><%= Danbooru.config.base_tag_query_limit %></td>
|
|
<td><%= Danbooru.config.base_tag_query_limit*2 %></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Favorite Limit</td>
|
|
<td>10,000</td>
|
|
<td>20,000</td>
|
|
<td>Unlimited</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Favorite Groups</td>
|
|
<td>3</td>
|
|
<td>5</td>
|
|
<td>10</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Page Limit</td>
|
|
<td>1,000</td>
|
|
<td>2,000</td>
|
|
<td>5,000</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Saved Searches</td>
|
|
<td>250</td>
|
|
<td>250</td>
|
|
<td>1,000</td>
|
|
</tr>
|
|
<tr>
|
|
<td>See Hidden Tags</td>
|
|
<td>No</td>
|
|
<td>Yes</td>
|
|
<td>Yes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Search Timeout</td>
|
|
<td>3 sec</td>
|
|
<td>6 sec</td>
|
|
<td>9 sec</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="section">
|
|
<% if params[:user_id] %>
|
|
<p>You are gifting this account upgrade to <%= link_to user.pretty_name, user_path(params[:user_id]) %>.</p>
|
|
<% else %>
|
|
<p>You can also upgrade someone else's account for the same price. The easiest way is to go to their profile page and look for a "Gift Upgrade" link.</p>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% if Danbooru.config.stripe_publishable_key %>
|
|
<% if CurrentUser.is_anonymous? %>
|
|
<p><%= link_to "Sign up", new_user_path %> or <%= link_to "login", login_path(url: new_user_upgrade_path) %> first to upgrade your account.</p>
|
|
<% elsif CurrentUser.safe_mode? %>
|
|
<div class="section">
|
|
<p>You can pay with a credit or debit card. Safebooru uses <a href="https://www.stripe.com">Stripe</a>
|
|
as a payment intermediary so none of your personal information will be stored on the site.</p>
|
|
|
|
<% if user.level < User::Levels::GOLD %>
|
|
<p><%= button_to "Upgrade to Gold", user_upgrade_path(user_id: user.id, level: User::Levels::GOLD), remote: true, disable_with: "Redirecting..." %></p>
|
|
<p><%= button_to "Upgrade to Platinum", user_upgrade_path(user_id: user.id, level: User::Levels::PLATINUM), remote: true, disable_with: "Redirecting..." %></p>
|
|
<% elsif user.level < User::Levels::PLATINUM %>
|
|
<p><%= button_to "Upgrade Gold to Platinum", user_upgrade_path(user_id: user.id, level: User::Levels::PLATINUM), remote: true, disable_with: "Redirecting..." %></p>
|
|
<% end %>
|
|
</div>
|
|
<% else %>
|
|
<div class="section">
|
|
<p>You can pay with a credit or debit card on
|
|
<%= link_to "Safebooru", new_user_upgrade_url(user_id: user.id, host: "safebooru.donmai.us", protocol: "https") %>.
|
|
Your account will then also be upgraded on Danbooru. You can login to
|
|
Safebooru with the same username and password you use on Danbooru.</p>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|