Implementation
To build your Payment Entries Processor implementation you will have to create your own concrete implementations of abstracted classes and interfaces.
Import Dependencies
Add the payment-releaser-core artefact to your pom.xml dependencies.
<dependency>
<groupId>com.iconsolutions.ipf.core.releaser</groupId>
<artifactId>payment-releaser-core</artifactId>
</dependency>
Implementations
The following abstractions need to be implemented:
-
PaymentDataSource<INIT, INSTR, TRANS>interface -
InstructionSender<INSTR>interface -
ProcessingRequestCreator<INIT, INSTR, TRANS, PAY_REQ>interface -
RequestProcessor<REQ>interface -
ProcessingStrategy<INIT, INSTR, TRANS ,REQ>interface
| An overview of these interfaces are described in Features. |
All of the above need to be wired-in as Spring Beans, in addition to:
-
PaymentEntriesProcessingServiceImpl, or a custom implementation of thePaymentEntriesProcessingServiceinterface. -
InstructionPreparationServiceImpl <INIT extends PaymentInitiation<?>, INSTR extends PaymentInstruction<?>, TRANS extends PaymentTransaction<?>>, or a custom implementation of theInstructionPreparationServiceinterface. -
InstructionProcessingCompletionServiceImpl<INIT extends PaymentInitiation<?>, INSTR extends PaymentInstruction<?>, TRANS extends PaymentTransaction<?>>, or a custom implementation of theInstructionProcessingCompletionServiceinterface.
The implementation of a ProcessingStrategy faciliates the cancelling and releasing of stored payments.
Processing Strategy provides guidance on the use of the ProcessingActionType, and the Example Request Creator and Example Request Processor sections
provide further guidance as to what an implementation of this might look like.
Using Warehouse as Data Source
This section details the steps to take if you want to use the Payment Warehouse as your data source instead of implementing your own custom data source. See Payment Warehouse Datasource for more information.
This module provides an abstract implementation of the PaymentDataSource<INIT, INSTR, TRANS> interface as BasePaymentWarehouseDataSource.
You will need to implement with the appropriate types, and wire this in as a Spring Bean.
Additionally, supplying the following aggregator function’s is part of processing a transaction; these will need to be wired in as Spring Beans:
-
Initiation aggregator:
Function<List<PaymentEntry>, PaymentWarehouseInitiation> -
Instruction aggregator:
Function<List<PaymentEntry>, PaymentWarehouseInstruction> -
Transaction aggregator:
Function<List<PaymentEntry>, PaymentWarehouseTransaction>
| The Initiation aggregator is optional (and can be left out) whereas the Instruction aggregator and Transaction aggregator are required. |
Wire-up the Entry Point
The entrypoint to the system is the AkkaPaymentEntriesProcessor class that implements the PaymentEntriesProcessor interface.
You have to declare a Spring Bean of this class in your application.
The AkkaPaymentEntriesProcessor constructor arguments are as specified earlier in this document.
@Bean
public PaymentEntriesProcessor paymentEntriesProcessor(
ActorSystem<?> actorSystem, (1)
PaymentEntryProcessorProperties paymentEntryProcessorProperties, (2)
PreparerProperties preparerProperties, (3)
InstructionPreparationService instructionPreparationService, (4)
PaymentEntriesProcessingService paymentEntriesProcessingService) { (5)
return new AkkaPaymentEntriesProcessor(
actorSystem,
paymentEntryProcessorProperties,
preparerProperties,
instructionPreparationService,
paymentEntriesProcessingService);
}
-
The ActorSystem provided by your IPF application
-
Supplied as a Spring Bean in the payment-releaser-core module
-
Supplied as a Spring Bean in the payment-releaser-core module
-
Specified above
-
Specified above