remove coinbase references

This commit is contained in:
Albert Yi
2016-12-02 13:52:39 -08:00
parent 6e27d06eee
commit 1314239326
6 changed files with 1 additions and 60 deletions

View File

@@ -48,7 +48,6 @@ gem 'radix62', '~> 1.0.1'
gem 'streamio-ffmpeg'
gem 'rubyzip', :require => "zip"
gem 'stripe'
gem 'coinbase'
gem 'twitter'
gem 'aws-sdk', '~> 2'
gem 'responders'

View File

@@ -1,14 +1,12 @@
class UserUpgradesController < ApplicationController
before_filter :member_only, :only => [:new, :show]
helper_method :encrypt_custom, :coinbase, :user
helper_method :user
force_ssl :if => :ssl_enabled?
skip_before_action :verify_authenticity_token, only: [:create]
def create
if params[:stripeToken]
create_stripe
elsif params[:order]
create_coinbase
end
end
@@ -21,14 +19,6 @@ class UserUpgradesController < ApplicationController
def show
end
def encrypt_custom(level)
crypt.encrypt_and_sign("#{user.id},#{level}")
end
def coinbase
@coinbase_api ||= Coinbase::Client.new(Danbooru.config.coinbase_api_key, Danbooru.config.coinbase_api_secret)
end
def user
if params[:user_id]
User.find(params[:user_id])
@@ -71,29 +61,6 @@ class UserUpgradesController < ApplicationController
redirect_to user_upgrade_path
end
def create_coinbase
if params[:order][:status] == "completed"
user_id, level = decrypt_custom
member = User.find(user_id)
if member.level < User::Levels::PLATINUM && level >= User::Levels::GOLD && level <= User::Levels::PLATINUM
CurrentUser.scoped(User.admins.first, "127.0.0.1") do
member.promote_to!(level, :skip_feedback => true)
end
end
end
render :nothing => true
end
def decrypt_custom
crypt.decrypt_and_verify(params[:order][:custom]).split(/,/).map(&:to_i)
end
def crypt
ActiveSupport::MessageEncryptor.new(Danbooru.config.coinbase_secret)
end
def ssl_enabled?
!Rails.env.development? && !Rails.env.test?
end

View File

@@ -12,7 +12,6 @@ class MissedSearchService
http.read_timeout = 1
http.request_get(url.request_uri) do |res|
if res.is_a?(Net::HTTPSuccess)
puts res.inspect
response = res.body
end
end

View File

@@ -1,11 +0,0 @@
<div class="section">
<p>You can pay with Bitcoin. You will pay either $20 USD or $40 USD equivalent in Bitcoin. Danbooru uses <a href="https://www.coinbase.com">Coinbase</a> as a payment intermediary so none of your personal information will be stored on the site.</p>
<% if user.level < User::Levels::GOLD %>
<%= raw coinbase.create_button("Upgrade to Gold", 20.to_money("USD"), "Upgrade your Basic Account to a Gold Account", encrypt_custom(User::Levels::GOLD), :button => {:style => "custom_small", :text => "Upgrade to Gold", :callback_url => user_upgrade_path(:only_path => false, :host => Danbooru.config.hostname, :protocol => "https")}).embed_html %>
<%= raw coinbase.create_button("Upgrade to Platinum", 40.to_money("USD"), "Upgrade your Basic Account to a Platinum Account", encrypt_custom(User::Levels::PLATINUM), :button => {:style => "custom_small", :text => "Upgrade to Platinum", :callback_url => user_upgrade_path(:only_path => false, :host => Danbooru.config.hostname, :protocol => "https")}).embed_html %>
<% elsif user.level < User::Levels::PLATINUM %>
<%= raw coinbase.create_button("Upgrade to Platinum", 20.to_money("USD"), "Upgrade your Gold Account to a Platinum Account", encrypt_custom(User::Levels::PLATINUM), :button => {:style => "custom_small", :text => "Upgrade to Platinum", :callback_url => user_upgrade_path(:only_path => false, :host => Danbooru.config.hostname, :protocol => "https")}).embed_html %>
<% end %>
</div>

View File

@@ -92,10 +92,6 @@
<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.coinbase_api_key %>
<%#= render "coinbase_payment" %>
<% end %>
<% if Danbooru.config.stripe_publishable_key %>
<% if CurrentUser.safe_mode? %>

View File

@@ -345,15 +345,6 @@ module Danbooru
"/var/www/danbooru2/shared"
end
def coinbase_secret
end
def coinbase_api_key
end
def coinbase_api_secret
end
def stripe_secret_key
end