Class PaymentProcessor


  • public class PaymentProcessor
    extends java.lang.Object
    Processor for Payment entity.

    The API allows you to create, confirm, cancel payments, as well as receive information about them.

    Use ApiClient for API server communication.

    • 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 created Payment by its identifier.
      Payment capture​(java.lang.String paymentId, Payment paymentParams, java.lang.String idempotencyKey)
      Capture Payment that holds in waiting_for_capture status.
      Payment create​(Payment paymentParams, java.lang.String idempotencyKey)
      Creates new Payment 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 some Payment by its identifier.
      • Methods inherited from class java.lang.Object

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

      • PaymentProcessor

        public PaymentProcessor()
    • Method Detail

      • findById

        public Payment findById​(java.lang.String paymentId)
        Receive information about some Payment 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 new Payment entity with certain parameters.

        Generate random idempotency key if corresponding argument is null.

        Parameters:
        paymentParams - parameters for new payment
        idempotencyKey - 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)
        Capture Payment 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 capture
        paymentParams - capture parameters
        idempotencyKey - 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 created Payment by its identifier.

        Generate random idempotency key if corresponding argument is null.

        Parameters:
        paymentId - payment identifier to be canceled
        idempotencyKey - idempotency key
        Returns:
        payment entity with actual status
        Throws:
        java.lang.IllegalArgumentException - if payment identifier is null or empty