Package ru.loolzaaa.youkassa.processors
Class PaymentProcessor
- java.lang.Object
-
- ru.loolzaaa.youkassa.processors.PaymentProcessor
-
public class PaymentProcessor extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PaymentProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Payment
cancel(java.lang.String paymentId, java.lang.String idempotencyKey)
Cancel already createdPayment
by its identifier.Payment
capture(java.lang.String paymentId, Payment paymentParams, java.lang.String idempotencyKey)
CapturePayment
that holds in waiting_for_capture status.Payment
create(Payment paymentParams, java.lang.String idempotencyKey)
Creates newPayment
entity with certain parameters.PaginatedResponse<Payment>
findAll(PaymentList paymentList)
Receive information about all payments with some filter conditions.Payment
findById(java.lang.String paymentId)
Receive information about somePayment
by its identifier.
-
-
-
Method Detail
-
findById
public Payment findById(java.lang.String paymentId)
Receive information about somePayment
by its identifier.- Parameters:
paymentId
- payment identifier- Returns:
- payment entity with actual status
- Throws:
java.lang.IllegalArgumentException
- if payment id is null or empty
-
findAll
public PaginatedResponse<Payment> findAll(PaymentList paymentList)
Receive information about all payments with some filter conditions.- Parameters:
paymentList
- collection with filter conditions- Returns:
- listed payment entities
- See Also:
PaginatedResponse
-
create
public Payment create(Payment paymentParams, java.lang.String idempotencyKey)
Creates newPayment
entity with certain parameters.Generate random idempotency key if corresponding argument is null.
- Parameters:
paymentParams
- parameters for new paymentidempotencyKey
- idempotency key- Returns:
- new payment entity with actual status
- Throws:
java.lang.IllegalArgumentException
- if payment parameters is null
-
capture
public Payment capture(java.lang.String paymentId, Payment paymentParams, java.lang.String idempotencyKey)
CapturePayment
that holds in waiting_for_capture status.Needs when payment was creates with capture = false (default) parameter.
Generate random idempotency key if corresponding argument is null.
- Parameters:
paymentId
- payment identifier to be capturepaymentParams
- capture parametersidempotencyKey
- idempotency key- Returns:
- payment entity with actual status
- Throws:
java.lang.IllegalArgumentException
- if payment identifier is null or empty, and if capture parameters is null
-
cancel
public Payment cancel(java.lang.String paymentId, java.lang.String idempotencyKey)
Cancel already createdPayment
by its identifier.Generate random idempotency key if corresponding argument is null.
- Parameters:
paymentId
- payment identifier to be canceledidempotencyKey
- idempotency key- Returns:
- payment entity with actual status
- Throws:
java.lang.IllegalArgumentException
- if payment identifier is null or empty
-
-