user upgrades: add upgrade code system.
Add a system for upgrading accounts using upgrade codes. Users purchase an upgrade code off-site then redeem it on-site to upgrade their account to Gold. Upgrade codes are randomly pre-generated and are one time use only. Codes have enough randomness that guessing a code is infeasible.
This commit is contained in:
@@ -10,6 +10,9 @@
|
||||
var $input = $('<input type="hidden" name="token">').val(token);
|
||||
$form.append($input).appendTo("body").submit();
|
||||
});
|
||||
<% elsif @user_upgrade.shopify? %>
|
||||
window.history.pushState({}, "", location.href);
|
||||
window.location.assign("<%= j Danbooru.config.shopify_purchase_url %>?attributes[user_upgrade_id]=<%= @user_upgrade.id %>&attributes[purchaser_id]=<%= @user_upgrade.purchaser_id %>&attributes[purchaser_name]=<%= @user_upgrade.purchaser.name %>&checkout[email]=<%= @user_upgrade.purchaser&.email_address&.address %>");
|
||||
<% else %>
|
||||
<% raise NotImplementedError, "payment method not implemented" %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user