Class WebhookResult

java.lang.Object
com.chargebee.v4.webhook.WebhookResult

public class WebhookResult extends Object
Result of webhook processing.

This class represents the outcome of processing a Chargebee webhook event. Use the static factory methods to create appropriate results:

  • Method Details

    • success

      public static WebhookResult success(String eventType, String eventId)
      Creates a success result indicating the event was processed successfully.
      Parameters:
      eventType - The event type that was processed
      eventId - The event ID
      Returns:
      A success WebhookResult
    • unhandled

      public static WebhookResult unhandled(String eventType, String eventId)
      Creates an unhandled result indicating the event was received but no handler was registered.
      Parameters:
      eventType - The event type
      eventId - The event ID
      Returns:
      An unhandled WebhookResult
    • failure

      public static WebhookResult failure(String errorMessage)
      Creates a failure result indicating the event processing failed.
      Parameters:
      errorMessage - Description of the failure
      Returns:
      A failure WebhookResult
    • isSuccess

      public boolean isSuccess()
      Returns:
      true if the webhook was processed without errors
    • isHandled

      public boolean isHandled()
      Returns:
      true if a handler was found and executed for this event
    • getEventType

      public String getEventType()
      Returns:
      The event type that was processed, or null on failure
    • getEventId

      public String getEventId()
      Returns:
      The event ID, or null on failure
    • getErrorMessage

      public String getErrorMessage()
      Returns:
      Error message if processing failed, null otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object