You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
mount StripeEvent::Engine, at: "/stripe/event/(:account_country)"
I can configure my US stripe account to hit "/stripe/event/us" and likewise my AU account to hit "/stripe/event/au".
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?
The text was updated successfully, but these errors were encountered: