Closed ghiculescu closed 6 years ago
Hey @ghiculescu
I've ended up monkey patching the WebhookHandler
in like this:
app/services/chargebee_rails/webhook_handler.rb
Rails.application.config.to_prepare do
ChargebeeRails::WebhookHandler.module_eval do
def handle(chargebee_event)
@chargebee_event = chargebee_event
sync_events if sync_events_list.include?(event.event_type)
send(event.event_type) if respond_to?(event.event_type)
# ignore events that aren't handled or add some logging
end
end
end
fyi - I have offered a similar solution in this pull request https://github.com/spritlesoftware/chargebee-rails-subscriptions/pull/13
@ghiculescu We have handled only some important events initially. We will update the gem to handle all events. FYI: We will maintain this gem on SpritleSoftware repo and review and merge necessary PR over there. I am closing this issue here.
We're seeing a lot of errors like this when using this gem's standard webhook implementation:
My current solution is to override the controller in a fairly dodgy fashion:
Is there a better/proper solution?