Skip to content

Commit

Permalink
Move stripe to WebhookController
Browse files Browse the repository at this point in the history
  • Loading branch information
miharekar committed Jan 24, 2025
1 parent 3599c17 commit 031b407
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class StripeController < ApplicationController
class WebhookController < ApplicationController
skip_before_action :verify_authenticity_token

def create
def stripe
StripeWebhookHandler.new(request).handle
head :ok
rescue JSON::ParserError, Stripe::SignatureVerificationError
Expand Down
3 changes: 1 addition & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

get :heartbeat, to: "heartbeat#show"
get :privacy, to: "home#privacy"
post :stripe, to: "stripe#create"
post :stripe, to: "webhook#stripe"
post "emails/unsubscribe"

resources :people, only: %i[show] do
Expand Down Expand Up @@ -106,7 +106,6 @@
get "yearly_brew/:slug(/:year)", to: "yearly_brew#show", as: :yearly_brew

resources :stats, only: [:index]
resources :customers, only: %i[index]
resources :updates, except: %i[destroy] do
get :feed, on: :collection
end
Expand Down

0 comments on commit 031b407

Please sign in to comment.