From 93551149601ad6c8ecdc7344fa68acdd6060fa07 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Tue, 4 Feb 2020 20:49:22 -0800 Subject: [PATCH] Cleanup stripe stuff --- app/views/payments/_payment.html.haml | 18 ++++++++---------- config/initializers/stripe.rb | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/views/payments/_payment.html.haml b/app/views/payments/_payment.html.haml index ff27e2ba..440f9985 100644 --- a/app/views/payments/_payment.html.haml +++ b/app/views/payments/_payment.html.haml @@ -20,15 +20,13 @@ = humanized_money_with_symbol ticket.quantity * ticket.price = form_tag conference_payments_path do - %script.stripe-button{ src: "https://checkout.stripe.com/checkout.js", - data: { - amount: @total_amount_to_pay.cents, - label: "Pay #{humanized_money_with_symbol @total_amount_to_pay}", - email: current_user.email, - currency: @total_amount_to_pay.currency, - name: ENV['OSEM_NAME'] || 'OSEM', - description: "#{OSEM_NAME} tickets", - key: ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.secrets.stripe_publishable_key, locale: "auto" - }} + %script.stripe-button{'src': "https://checkout.stripe.com/checkout.js", + 'data': {amount: @total_amount_to_pay.cents, + label: "Pay #{humanized_money_with_symbol @total_amount_to_pay}", + email: current_user.email, + currency: @total_amount_to_pay.currency, + name: ENV['OSEM_NAME'] || 'OSEM', + description: "#{ENV['OSEM_NAME']} tickets", + key: ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.secrets.stripe_publishable_key, locale: "auto"}} = link_to('Edit Purchase', conference_tickets_path(@conference.short_title), class: 'btn btn-default') diff --git a/config/initializers/stripe.rb b/config/initializers/stripe.rb index 555cc16f..b89159b4 100644 --- a/config/initializers/stripe.rb +++ b/config/initializers/stripe.rb @@ -1 +1 @@ -Stripe.api_key = Rails.application.secrets.stripe_secret_key +Stripe.api_key = ENV['STRIPE_SECRET_KEY'] || Rails.application.secrets.stripe_secret_key