integrallis / stripe_event

Stripe webhook integration for Rails applications.
https://rubygems.org/gems/stripe_event
MIT License
844 stars 104 forks source link

ActionController::RoutingError (No route matches [GET] ""): #41

Closed BobWalsh closed 9 years ago

BobWalsh commented 9 years ago

In a rails 4.1.6 (ruby 2.1.2) app using stripe_event 1.3.0, I'm getting

Started GET "/stripe" for 127.0.0.1 at 2014-10-13 11:30:55 -0700 ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"

ActionController::RoutingError (No route matches [GET] ""): actionpack (4.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in call' actionpack (4.1.6) lib/action_dispatch/middleware/show_exceptions.rb:30:incall' . . . whenever I load http://localhost:3000/stripe

In rake routes, I see stripe_event_path has blank for HTTP verb.

This seems similar to https://github.com/integrallis/stripe_event/issues/13. Any idea how to fix?

invisiblefunnel commented 9 years ago

@BobWalsh webhooks from Stripe are delivered via HTTP POSTs, which is why you are getting a missing route error with GET requests.

BobWalsh commented 9 years ago

I understand that, but I think you missed the point: installed gem, used your config code in the stripe initalizer, opened the /stripe page. Expected to see: Started GET "/stripe" for 127.0.0.1 at ... Processing by StripeEvent::WebhookController#event as HTML Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)

Instead, got the above error.

Is this tutorial https://tutorials.railsapps.org/tutorials/rails-stripe-membership-saas#stripe-push-notifications wrong?

Cheers, Bob

invisiblefunnel commented 9 years ago

Ah, ok. Looks like that tutorial requires a login. Older versions (< 0.6.1) of stripe_event did respond to GET requests, but that was an oversight on my part. To confirm the setup of newer versions, run something like the following curl command:

$ curl -X POST -d'{"just":"a test"}' http://localhost:3000/stripe

EDIT: yes, it appears the tutorial is out of date