Class WebhookProcessor


  • public class WebhookProcessor
    extends java.lang.Object
    Processor for Webhook entity.

    Webhook is a mechanism for automatically notifying your system about events that happen to created objects. For example, YooKassa can tell you when a payment object created in your application enters the waiting_for_capture status.

    Using the API, you can set up a webhook (create, delete, view the list of created ones) for the passed OAuth token.

    Use ApiClient for API server communication.

    API Note:
    Authentication by OAuth token only. Available through the Partner API
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Webhook create​(Webhook webhookParams, java.lang.String idempotencyKey)
      Creates new Webhook entity with certain parameters.
      PaginatedResponse<Webhook> findAll()
      Receive information about all existing webhooks.
      Webhook removeById​(java.lang.String webhookId, java.lang.String idempotencyKey)
      Remove already existing Webhook by its identifier.
      • Methods inherited from class java.lang.Object

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

      • WebhookProcessor

        public WebhookProcessor()
    • Method Detail

      • findAll

        public PaginatedResponse<Webhook> findAll()
        Receive information about all existing webhooks.

        Can be used only if OAuth authentication method configured.

        Returns:
        listed webhook entities
        See Also:
        PaginatedResponse
      • create

        public Webhook create​(Webhook webhookParams,
                              java.lang.String idempotencyKey)
        Creates new Webhook entity with certain parameters.

        Generate random idempotency key if corresponding argument is null.

        Can be used only if OAuth authentication method configured.

        Parameters:
        webhookParams - parameters for new webhook
        idempotencyKey - idempotency key
        Returns:
        new webhook entity
        Throws:
        java.lang.IllegalArgumentException - if webhook parameters is null
      • removeById

        public Webhook removeById​(java.lang.String webhookId,
                                  java.lang.String idempotencyKey)
        Remove already existing Webhook by its identifier.

        Generate random idempotency key if corresponding argument is null.

        Parameters:
        webhookId - webhook identifier to be removed
        idempotencyKey - idempotency key
        Returns:
        webhook entity
        Throws:
        java.lang.IllegalArgumentException - if webhook identifier is null or empty