Package com.onlinepayments.webhooks
Class WebhooksHelper
java.lang.Object
com.onlinepayments.webhooks.WebhooksHelper
Online Payments platform v1 webhooks helper. Thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionunmarshal(byte[] body, List<RequestHeader> requestHeaders) Unmarshals the given body, while also validating it using the given request headers.unmarshal(InputStream bodyStream, List<RequestHeader> requestHeaders) Unmarshals the given input stream that contains the body, while also validating its contents using the given request headers.unmarshal(String body, List<RequestHeader> requestHeaders) Unmarshals the given body, while also validating it using the given request headers.
-
Constructor Details
-
WebhooksHelper
-
-
Method Details
-
unmarshal
public WebhooksEvent unmarshal(InputStream bodyStream, List<RequestHeader> requestHeaders) throws IOException Unmarshals the given input stream that contains the body, while also validating its contents using the given request headers.- Returns:
- The input stream unmarshalled as a
WebhooksEvent - Throws:
IOException- If the input stream could not be read.SignatureValidationException- If the input stream could not be validated successfully.ApiVersionMismatchException- If the resulting event has an API version that this version of the SDK does not support.
-
unmarshal
Unmarshals the given body, while also validating it using the given request headers.- Returns:
- The body unmarshalled as a
WebhooksEvent - Throws:
SignatureValidationException- If the body could not be validated successfully.ApiVersionMismatchException- If the resulting event has an API version that this version of the SDK does not support.
-
unmarshal
Unmarshals the given body, while also validating it using the given request headers.- Returns:
- The body unmarshalled as a
WebhooksEvent - Throws:
SignatureValidationException- If the body could not be validated successfully.ApiVersionMismatchException- If the resulting event has an API version that this version of the SDK does not support.
-