Package ru.loolzaaa.youkassa.processors
Class WebhookProcessor
- java.lang.Object
-
- ru.loolzaaa.youkassa.processors.WebhookProcessor
-
public class WebhookProcessor extends java.lang.Object
Processor forWebhook
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 Summary
Constructors Constructor Description WebhookProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Webhook
create(Webhook webhookParams, java.lang.String idempotencyKey)
Creates newWebhook
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 existingWebhook
by its identifier.
-
-
-
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 newWebhook
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 webhookidempotencyKey
- 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 existingWebhook
by its identifier.Generate random idempotency key if corresponding argument is null.
- Parameters:
webhookId
- webhook identifier to be removedidempotencyKey
- idempotency key- Returns:
- webhook entity
- Throws:
java.lang.IllegalArgumentException
- if webhook identifier is null or empty
-
-