Open jkburges opened 3 years ago
I have a need for seeing the params along with the event as well. Any update on this?
@daniely FWIW I didn't get anywhere with this.
I might be able to submit a PR at some point but would need advice from the gem owners on the best way to proceed.
I'm trying to solve the problem of knowing from which stripe account events are coming. It doesn't seem like there's consistently an
account
field in the event from stripe (I think this may only be a stripe connect thing, which I don't have).e.g. with a route definition having a dynamic segment such as:
I can configure my US stripe account to hit "/stripe/event/us" and likewise my AU account to hit "/stripe/event/au".
The dynamic segment value is then available at https://github.com/integrallis/stripe_event/blob/master/app/controllers/stripe_event/webhook_controller.rb#L8 as
params[:account_country]
.After that point however, the information is lost and doesn't make it through to the event handlers.
One way to pass it on would be to change https://github.com/integrallis/stripe_event/blob/master/app/controllers/stripe_event/webhook_controller.rb#L8 to:
and so on downstream, so that the event handler ends up having an interface such as:
but I'm not sure if that can be done without breaking compatibility with the old interface.
Another alternative would be to piggyback on the event object itself, e.g at https://github.com/integrallis/stripe_event/blob/master/app/controllers/stripe_event/webhook_controller.rb#L8"
but that seems a bit of a hack.
Does anyone have some advice?