public final class Webhook
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Webhook.Signature |
static class |
Webhook.Util |
Constructor and Description |
---|
Webhook() |
Modifier and Type | Method and 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.
|
public static Event constructEvent(java.lang.String payload, java.lang.String sigHeader, java.lang.String secret) throws SignatureVerificationException
payload
- the payload sent by Stripe.sigHeader
- the contents of the signature header sent by Stripe.secret
- secret used to generate the signature.SignatureVerificationException
- if the verification fails.public static Event constructEvent(java.lang.String payload, java.lang.String sigHeader, java.lang.String secret, long tolerance) throws SignatureVerificationException
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 timeSignatureVerificationException
- if the verification fails.