Package com.adyen.notification
Class WebhookHandler
- java.lang.Object
-
- com.adyen.notification.WebhookHandler
-
public class WebhookHandler extends Object
Handler for Adyen webhooks. It provides methods to parse incoming JSON webhook payloads into Java objects.
-
-
Constructor Summary
Constructors Constructor Description WebhookHandler()Initializes a new instance of theWebhookHandler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NotificationRequesthandleNotificationJson(String json)Deserializes a JSON string into aNotificationRequestobject.NotificationRequesthandleNotificationJsonJackson(String json)Deserializes a JSON string into aNotificationRequestobject using Jackson.TerminalAPIRequesthandleTerminalNotificationJson(String json)Deserializes a terminal notification JSON string into aTerminalAPIRequestobject.
-
-
-
Constructor Detail
-
WebhookHandler
public WebhookHandler()
Initializes a new instance of theWebhookHandler.
-
-
Method Detail
-
handleNotificationJson
public NotificationRequest handleNotificationJson(String json) throws IOException
Deserializes a JSON string into aNotificationRequestobject. This method uses Gson for deserialization.- Parameters:
json- The JSON string to deserialize.- Returns:
- The deserialized
NotificationRequest. - Throws:
IOException- if the JSON string cannot be deserialized.
-
handleNotificationJsonJackson
public NotificationRequest handleNotificationJsonJackson(String json) throws IOException
Deserializes a JSON string into aNotificationRequestobject using Jackson.- Parameters:
json- The JSON string to deserialize.- Returns:
- The deserialized
NotificationRequest. - Throws:
IOException- if the JSON string cannot be deserialized.
-
handleTerminalNotificationJson
public TerminalAPIRequest handleTerminalNotificationJson(String json)
Deserializes a terminal notification JSON string into aTerminalAPIRequestobject. Note that terminal notifications are structured asTerminalAPIRequestobjects.- Parameters:
json- The JSON string to deserialize.- Returns:
- The deserialized
TerminalAPIRequest.
-
-