Class SpiPaymentFactory
- java.lang.Object
-
- de.adorsys.psd2.xs2a.service.mapper.payment.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 Summary
Constructors Constructor Description SpiPaymentFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<de.adorsys.psd2.xs2a.spi.domain.payment.SpiBulkPayment>createSpiBulkPayment(de.adorsys.psd2.consent.api.pis.CommonPaymentData commonPaymentData)Creates SpiBulkPayment from PisPayment and PaymentProduct.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.Optional<de.adorsys.psd2.xs2a.spi.domain.payment.SpiPeriodicPayment>createSpiPeriodicPayment(de.adorsys.psd2.consent.api.pis.CommonPaymentData commonPaymentData)Creates SpiPeriodicPayment from PisPayment and PaymentProduct.Optional<de.adorsys.psd2.xs2a.spi.domain.payment.SpiSinglePayment>createSpiSinglePayment(de.adorsys.psd2.consent.api.pis.CommonPaymentData commonPaymentData)Creates SpiSinglePayment from PisPayment and PaymentProduct.
-
-
-
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-CommonPaymentDataobject- 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-CommonPaymentDataobject- 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-CommonPaymentDataobject- 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-CommonPaymentDataobject- Returns:
- Optional of SpiBulkPayment from PisPayment
-
-