Class SpiPaymentFactory


  • @Component
    public class SpiPaymentFactory
    extends Object
    Factory class to be used to get SpiPayment from PisPayment, PaymentProduct and PaymentType or concrete SpiPayment (SINGLE/PERIODIC/BULK) from PisPayment and PaymentProduct
    • Constructor Detail

      • SpiPaymentFactory

        public SpiPaymentFactory()
    • Method Detail

      • createSpiPaymentByPaymentType

        public Optional<? extends de.adorsys.psd2.xs2a.spi.service.SpiPayment> createSpiPaymentByPaymentType​(de.adorsys.psd2.consent.api.pis.CommonPaymentData commonPaymentData)
        Creates Optional of SpiPayment from PisPayment, PaymentProduct and PaymentType. Should be used, when general SpiPayment type is needed.
        Parameters:
        commonPaymentData - CommonPaymentData object
        Returns:
        Optional of SpiPayment subclass of requested payment type or throws IllegalArgumentException for unknown payment type
      • createSpiSinglePayment

        public Optional<de.adorsys.psd2.xs2a.spi.domain.payment.SpiSinglePayment> createSpiSinglePayment​(de.adorsys.psd2.consent.api.pis.CommonPaymentData commonPaymentData)
        Creates SpiSinglePayment from PisPayment and PaymentProduct. Should be used, when concrete SpiSinglePayment type is needed.
        Parameters:
        commonPaymentData - CommonPaymentData object
        Returns:
        Optional of SpiSinglePayment from PisPayment
      • createSpiPeriodicPayment

        public Optional<de.adorsys.psd2.xs2a.spi.domain.payment.SpiPeriodicPayment> createSpiPeriodicPayment​(de.adorsys.psd2.consent.api.pis.CommonPaymentData commonPaymentData)
        Creates SpiPeriodicPayment from PisPayment and PaymentProduct. Should be used, when concrete SpiPeriodicPayment type is needed.
        Parameters:
        commonPaymentData - CommonPaymentData object
        Returns:
        Optional of SpiPeriodicPayment from PisPayment
      • createSpiBulkPayment

        public Optional<de.adorsys.psd2.xs2a.spi.domain.payment.SpiBulkPayment> createSpiBulkPayment​(de.adorsys.psd2.consent.api.pis.CommonPaymentData commonPaymentData)
        Creates SpiBulkPayment from PisPayment and PaymentProduct. Should be used, when concrete SpiBulkPayment type is needed.
        Parameters:
        commonPaymentData - CommonPaymentData object
        Returns:
        Optional of SpiBulkPayment from PisPayment