After having some implementation problems with students in the next cohort, Thomas realized two things were giving us problems:
- config/application.rb needed to included these lines:
config.stripe.secret_key = ENV[‘STRIPE_SECRET_KEY’] config.stripe.publishable_key = ENV[‘STRIPE_PUBLISHABLE_KEY’] config.stripe.endpoint = ‘/payment/stripe-integration’
2. Stripe will translate its pop-up credit card window to match the language of the user’s computer. This needs to be handled in the application so it doesn’t break when working with someone who doesn’t have English as their default (otherwise the tests will fail):
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-description="Thank you message"
data-amount="<%= @totalamount*100 %>"
data-locale="<%= Rails.env.test? ? 'en' : 'auto' %>">