Package com.stripe.net
Class Webhook
- java.lang.Object
-
- com.stripe.net.Webhook
-
public final class Webhook extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Webhook.Signature
static class
Webhook.Util
-
Constructor Summary
Constructors Constructor Description Webhook()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Event
constructEvent(java.lang.String payload, java.lang.String sigHeader, java.lang.String secret)
Returns an Event instance using the provided JSON payload.static Event
constructEvent(java.lang.String payload, java.lang.String sigHeader, java.lang.String secret, long tolerance)
Returns an Event instance using the provided JSON payload.
-
-
-
Method Detail
-
constructEvent
public static Event constructEvent(java.lang.String payload, java.lang.String sigHeader, java.lang.String secret) throws SignatureVerificationException
Returns an Event instance using the provided JSON payload. Throws a JsonSyntaxException if the payload is not valid JSON, and a SignatureVerificationException if the signature verification fails for any reason.- Parameters:
payload
- the payload sent by Stripe.sigHeader
- the contents of the signature header sent by Stripe.secret
- secret used to generate the signature.- Returns:
- the Event instance
- Throws:
SignatureVerificationException
- if the verification fails.
-
constructEvent
public static Event constructEvent(java.lang.String payload, java.lang.String sigHeader, java.lang.String secret, long tolerance) throws SignatureVerificationException
Returns an Event instance using the provided JSON payload. Throws a JsonSyntaxException if the payload is not valid JSON, and a SignatureVerificationException if the signature verification fails for any reason.- Parameters:
payload
- the payload sent by Stripe.sigHeader
- the contents of the signature header sent by Stripe.secret
- secret used to generate the signature.tolerance
- maximum difference in seconds allowed between the header's timestamp and the current time- Returns:
- the Event instance
- Throws:
SignatureVerificationException
- if the verification fails.
-
-