Package com.chargebee.v4.webhook
Class WebhookResult
java.lang.Object
com.chargebee.v4.webhook.WebhookResult
Result of webhook processing.
This class represents the outcome of processing a Chargebee webhook event. Use the static factory methods to create appropriate results:
success(String, String)- Event processed successfullyunhandled(String, String)- Event received but no handler registeredfailure(String)- Event processing failed
-
Method Summary
Modifier and TypeMethodDescriptionstatic WebhookResultCreates a failure result indicating the event processing failed.booleanbooleanstatic WebhookResultCreates a success result indicating the event was processed successfully.toString()static WebhookResultCreates an unhandled result indicating the event was received but no handler was registered.
-
Method Details
-
success
Creates a success result indicating the event was processed successfully.- Parameters:
eventType- The event type that was processedeventId- The event ID- Returns:
- A success WebhookResult
-
unhandled
Creates an unhandled result indicating the event was received but no handler was registered.- Parameters:
eventType- The event typeeventId- The event ID- Returns:
- An unhandled WebhookResult
-
failure
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
- Returns:
- The event type that was processed, or null on failure
-
getEventId
- Returns:
- The event ID, or null on failure
-
getErrorMessage
- Returns:
- Error message if processing failed, null otherwise
-
toString
-