def METHOD_NAME(
    stripe_object: Union[stripe.checkout.Session, stripe.PaymentIntent], event: Event
) -> None:
    event.status = Event.EVENT_HANDLER_STARTED
    event.save(update_fields=["status"])
    try:
        func(stripe_object, event.content_object)
    except BillingError as e:
        billing_logger.warning(
            "BillingError in %s event handler: %s. stripe_object_id=%s, customer_id=%s metadata=%s",
            event.type,
            e.error_description,
            stripe_object.id,
            stripe_object.customer,
            stripe_object.metadata,
        )
        event.status = Event.EVENT_HANDLER_FAILED
        event.handler_error = {
            "message": e.msg,
            "description": e.error_description,
        }
        event.save(update_fields=["status", "handler_error"])
    except Exception:
        billing_logger.exception(
            "Uncaught exception in %s event handler:",
            event.type,
            stack_info=True,
        )
        event.status = Event.EVENT_HANDLER_FAILED
        event.handler_error = {
            "description": f"uncaught exception in {event.type} event handler",
            "message": BillingError.CONTACT_SUPPORT.format(email=settings.ZULIP_ADMINISTRATOR),
        }
        event.save(update_fields=["status", "handler_error"])
    else:
        event.status = Event.EVENT_HANDLER_SUCCEEDED
        event.save()