Class Webhook


  • public final class Webhook
    extends java.lang.Object
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Webhook

        public Webhook()
    • 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.