Remove references to the Stripe gem
Rather than figure out how to upgrade the Stripe gem to be compatible with future Rails, I'd rather just delete the references, since it's currently unused. I'm not so bold as to go in and fully trash all our donation code; I just want to ensure we're not sending people down broken codepaths, and that if they reach them, the error messages are clear enough.
This commit is contained in:
parent
9cb71da77c
commit
7f8f7e624d
4 changed files with 70 additions and 59 deletions
2
Gemfile
2
Gemfile
|
@ -69,8 +69,6 @@ gem 'rack-attack', '~> 2.2.0'
|
||||||
|
|
||||||
gem 'react-rails', '~> 0.8.0.0'
|
gem 'react-rails', '~> 0.8.0.0'
|
||||||
|
|
||||||
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
|
|
||||||
|
|
||||||
gem "letter_opener", :group => :development
|
gem "letter_opener", :group => :development
|
||||||
|
|
||||||
gem 'sass-rails', "~> 3.2.6"
|
gem 'sass-rails', "~> 3.2.6"
|
||||||
|
|
|
@ -35,14 +35,6 @@ GIT
|
||||||
specs:
|
specs:
|
||||||
RocketAMF (1.0.0)
|
RocketAMF (1.0.0)
|
||||||
|
|
||||||
GIT
|
|
||||||
remote: https://github.com/stripe/stripe-ruby
|
|
||||||
revision: 8c6dc1a838db0d39d9083431f6a4a8287f25d814
|
|
||||||
specs:
|
|
||||||
stripe (1.23.0)
|
|
||||||
json (~> 1.8.1)
|
|
||||||
rest-client (~> 1.4)
|
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
|
@ -335,7 +327,6 @@ DEPENDENCIES
|
||||||
rvm-capistrano (~> 1.5.6)
|
rvm-capistrano (~> 1.5.6)
|
||||||
sanitize (~> 2.0.3)
|
sanitize (~> 2.0.3)
|
||||||
sass-rails (~> 3.2.6)
|
sass-rails (~> 3.2.6)
|
||||||
stripe!
|
|
||||||
swf_converter (~> 0.0.3)
|
swf_converter (~> 0.0.3)
|
||||||
uglifier (>= 1.0.3)
|
uglifier (>= 1.0.3)
|
||||||
whenever (~> 0.7.3)
|
whenever (~> 0.7.3)
|
||||||
|
|
|
@ -6,51 +6,52 @@
|
||||||
toward #{@current_campaign.purpose}.
|
toward #{@current_campaign.purpose}.
|
||||||
Thanks so much!
|
Thanks so much!
|
||||||
|
|
||||||
= form_tag donations_path, method: 'POST', id: 'donation-form',
|
-# TODO: Reinstall Stripe before showing the checkout form
|
||||||
'data-checkout-image' => image_path('default_preview.png'),
|
= form_tag donations_path, method: 'POST', id: 'donation-form',
|
||||||
'data-checkout-publishable-key' => Rails.configuration.stripe[:publishable_key],
|
'data-checkout-image' => image_path('default_preview.png'),
|
||||||
'data-campaign-theme' => @current_campaign.theme_id do
|
'data-checkout-publishable-key' => Rails.configuration.stripe[:publishable_key],
|
||||||
= hidden_field_tag 'donation[stripe_token]'
|
'data-campaign-theme' => @current_campaign.theme_id do
|
||||||
= hidden_field_tag 'donation[stripe_token_type]'
|
= hidden_field_tag 'donation[stripe_token]'
|
||||||
= hidden_field_tag 'donation[donor_email]'
|
= hidden_field_tag 'donation[stripe_token_type]'
|
||||||
= hidden_field_tag 'donation[amount]'
|
= hidden_field_tag 'donation[donor_email]'
|
||||||
%header
|
= hidden_field_tag 'donation[amount]'
|
||||||
%p#donation-form-title
|
%header
|
||||||
Thanks for supporting Dress to Impress!
|
%p#donation-form-title
|
||||||
%p
|
Thanks for supporting Dress to Impress!
|
||||||
From modeling to servers, Dress to Impress is a community effort.
|
%p
|
||||||
This year, we need to raise
|
From modeling to servers, Dress to Impress is a community effort.
|
||||||
#{cents_to_currency(@current_campaign.goal, precision: 0)}
|
This year, we need to raise
|
||||||
to cover our #{@current_campaign.name} hosting costs.
|
#{cents_to_currency(@current_campaign.goal, precision: 0)}
|
||||||
%p
|
to cover our #{@current_campaign.name} hosting costs.
|
||||||
As a thank-you gift, for every $5 you give, we'll feature one of your
|
%p
|
||||||
outfits here and on the homepage. Show off your latest designs!
|
As a thank-you gift, for every $5 you give, we'll feature one of your
|
||||||
%p
|
outfits here and on the homepage. Show off your latest designs!
|
||||||
All donations are securely powered by
|
%p
|
||||||
#{link_to 'Stripe', 'https://stripe.com/'}, and go directly toward our
|
All donations are securely powered by
|
||||||
hosting costs. Thank you for your help!
|
#{link_to 'Stripe', 'https://stripe.com/'}, and go directly toward our
|
||||||
#donation-fields
|
hosting costs. Thank you for your help!
|
||||||
#amount-header Amount
|
#donation-fields
|
||||||
#amount-choices
|
#amount-header Amount
|
||||||
%li
|
#amount-choices
|
||||||
%input#amount-5{type: 'radio', name: 'amount', value: '5.00'}
|
%li
|
||||||
%label{for: 'amount-5'} $5
|
%input#amount-5{type: 'radio', name: 'amount', value: '5.00'}
|
||||||
%li
|
%label{for: 'amount-5'} $5
|
||||||
%input#amount-10{type: 'radio', name: 'amount', value: '10.00'}
|
%li
|
||||||
%label{for: 'amount-10'} $10
|
%input#amount-10{type: 'radio', name: 'amount', value: '10.00'}
|
||||||
%li
|
%label{for: 'amount-10'} $10
|
||||||
%input#amount-30{type: 'radio', name: 'amount', value: '20.00', checked: true}
|
%li
|
||||||
%label{for: 'amount-30'} $20
|
%input#amount-30{type: 'radio', name: 'amount', value: '20.00', checked: true}
|
||||||
%li
|
%label{for: 'amount-30'} $20
|
||||||
%input#amount-50{type: 'radio', name: 'amount', value: '50.00'}
|
%li
|
||||||
%label{for: 'amount-50'} $50
|
%input#amount-50{type: 'radio', name: 'amount', value: '50.00'}
|
||||||
%li
|
%label{for: 'amount-50'} $50
|
||||||
%input#amount-custom{type: 'radio', name: 'amount', value: 'custom'}
|
%li
|
||||||
%label{for: 'amount-custom'} Other
|
%input#amount-custom{type: 'radio', name: 'amount', value: 'custom'}
|
||||||
%label#amount-custom-fields{for: 'amount-custom-value'}
|
%label{for: 'amount-custom'} Other
|
||||||
%input#amount-custom-value{type: 'text'}
|
%label#amount-custom-fields{for: 'amount-custom-value'}
|
||||||
#donation-controls
|
%input#amount-custom-value{type: 'text'}
|
||||||
%button{type: 'submit'} Donate now!
|
#donation-controls
|
||||||
|
%button{type: 'submit'} Donate now!
|
||||||
|
|
||||||
- if @donations.present?
|
- if @donations.present?
|
||||||
#outfits-header
|
#outfits-header
|
||||||
|
|
|
@ -1,6 +1,27 @@
|
||||||
|
# TODO: Upgrade Stripe to be usable again, or remove references altogether
|
||||||
|
|
||||||
Rails.configuration.stripe = {
|
Rails.configuration.stripe = {
|
||||||
:publishable_key => ENV.fetch('STRIPE_PUBLISHABLE_KEY'),
|
:publishable_key => "REMOVED:STRIPE_PUBLISHABLE_KEY",
|
||||||
:secret_key => ENV.fetch('STRIPE_SECRET_KEY')
|
:secret_key => "REMOVED:STRIPE_SECRET_KEY"
|
||||||
}
|
}
|
||||||
|
|
||||||
Stripe.api_key = Rails.configuration.stripe[:secret_key]
|
# Stripe.api_key = Rails.configuration.stripe[:secret_key]
|
||||||
|
|
||||||
|
# Some stub methods for our Stripe calls, to give clearer error messages (but
|
||||||
|
# those code paths shouldn't be accessible by normal users rn anyway).
|
||||||
|
module Stripe
|
||||||
|
class Customer
|
||||||
|
def self.create(*args)
|
||||||
|
raise NotImplementedError, "TODO: Reinstall Stripe"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Card
|
||||||
|
def self.create(*args)
|
||||||
|
raise NotImplementedError, "TODO: Reinstall Stripe"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class CardError < Exception
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in a new issue