Interface UnhandledEventCallback

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface UnhandledEventCallback
Functional interface for handling unregistered/unhandled Chargebee webhook events.

This interface is invoked when no specific handler is registered for an event type. This allows you to log, store, or process unknown/unhandled events.

Example usage:

 UnhandledEventCallback fallbackHandler = (event, eventType, rawPayload) -> {
     log.warn("Unhandled event: type={}, id={}", eventType, event.getId());
     return WebhookResult.unhandled(eventType, event.getId());
 };
 
  • Method Summary

    Modifier and Type
    Method
    Description
    handle(Event event, String eventType, String rawPayload)
    Handles an unhandled/unregistered webhook event and returns the processing result.
  • Method Details

    • handle

      WebhookResult handle(Event event, String eventType, String rawPayload) throws Exception
      Handles an unhandled/unregistered webhook event and returns the processing result.
      Parameters:
      event - The base Event object (with content as Map)
      eventType - The event type string that was not handled
      rawPayload - The raw JSON payload (for custom parsing if needed)
      Returns:
      WebhookResult indicating the outcome of processing
      Throws:
      Exception - if event processing fails