Class WebhookProcessor

java.lang.Object
ru.loolzaaa.youkassa.processors.WebhookProcessor

public class WebhookProcessor extends 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
  • Constructor Details

    • WebhookProcessor

      public WebhookProcessor()
  • Method Details

    • 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:
    • create

      public Webhook create(Webhook webhookParams, 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:
      IllegalArgumentException - if webhook parameters is null
    • removeById

      public Webhook removeById(String webhookId, 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:
      IllegalArgumentException - if webhook identifier is null or empty