Skip to content

Commit

Permalink
Use env var for NOTIFICATION_TOKENS_PRICE
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmsmith committed Nov 28, 2023
1 parent 4f09f34 commit d93d696
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/checkouts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize
super
@checkout_session = T.let(nil, T.untyped)
# Use Stripe livemode price in production, testmode for all other data
@price = T.let(T.unsafe(Rails.env).production? ? "price_1KXuuBBclLivpoJujRNSkGJ4" : "price_1KXuv2BclLivpoJuWavz9GPj", String)
@price = T.let(ENV.fetch("NOTIFICATION_TOKENS_PRICE"), String)
end

sig { void }
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/checkouts_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CheckoutsControllerTest < ActionDispatch::IntegrationTest
"cancel_url" => "http://www.example.com/my-courses?session_id={CHECKOUT_SESSION_ID}",
"customer" => "cus_9s6XBnVi5gbXub",
"line_items" => [
{ "price" => "price_1KXuv2BclLivpoJuWavz9GPj", "quantity" => "1" },
{ "price" => ENV.fetch("NOTIFICATION_TOKENS_PRICE"), "quantity" => "1" },
],
"mode" => "payment",
"payment_method_types" => ["card"],
Expand Down

0 comments on commit d93d696

Please sign in to comment.