pay: ActionController::RoutingError (uninitialized constant Pay::Webhooks::StripeController
Hey π
On webhook callback, I have this error:
ActionController::RoutingError (uninitialized constant Pay::Webhooks::StripeController
Did you mean? DeviseController):
Here is my initializer:
# frozen_string_literal: true
Pay.setup do |config|
config.chargeable_class = 'Pay::Charge'
config.chargeable_table = 'pay_charges'
# For use in the receipt/refund/renewal mailers
# ...
config.default_product_name = 'Gold'
config.default_plan_name = 'gold'
config.automount_routes = true
config.routes_path = '/pay' # Only when automount_routes is true
end
And I donβt have catchall routes.
I ran this command to forward hooks:
stripe listen --forward-to localhost:3000/pay/webhooks/stripe
I restarted my server many times and run bundle install too.
Any idea why?
Thanks!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (9 by maintainers)
Awesome, feel free to open a new issue if the persists.
@guillaumebriday @excid3 upgrading from
3.0.23to3.0.24fixed this for me! You can probably close this issue unless others are still running into this.Iβm seeing the same issue in our app. When enabling verbose logging for the zeitwerk loader (https://guides.rubyonrails.org/autoloading_and_reloading_constants.html#troubleshooting), Iβm not seeing the webhook controllers being autoloaded:
Iβll spend some time this morning to get the dummy application up and running and replicate there (right now running into migration issues).
Edit: I think the
Pay::Webhooksnamespace is clashing: If I renameapp/controllers/pay/webhooksto justapp/controllers/pay/hooks(and adjust the files, of course), the webhook controllers get picked up.