Skip to content

Add a hook to run some code before any Stripe event callbacks #188

@ndbroadbent

Description

@ndbroadbent

Hello,

I saw that the stripe.event callback is run at the very end:

      def run_callbacks(evt, target)
        _run_callbacks evt.type, evt, target
        _run_callbacks 'stripe.event', evt, target
      end

It would be very useful if I could also run a callback at the beginning. In my case, I want to add the event ID as extra context for my Sentry error reports, in case one of my event handlers crashes with an error. e.g.

before_stripe_event_callback do |event|
   Raven.extra_context(event_id: event.id)
end

This would make it much easier for me to look up the Stripe event in the Stripe web UI, so I can see what event data caused the error to happen.

Do you have any feedback or suggestions for this idea, or any thoughts on how this could be implemented?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions