<% if @user_upgrade.stripe? %> var stripe = Stripe("<%= j Danbooru.config.stripe_publishable_key %>"); stripe.redirectToCheckout({ sessionId: "<%= j @checkout.id %>" }); <% elsif @user_upgrade.authorize_net? %> $(function() { var url = "<%= j @checkout[0] %>"; var token = "<%= j @checkout[1] %>"; var $form = $('
').attr("action", url) var $input = $('').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 %>