Processing Strategy
Processing Strategy provides an abstraction over handling of Payment Entries to be processed in a specific way; this takes in request creation and request handling.
In order to do this, a client-specific instance of the ProcessingStrategy interface needs to be implemented, where the ProcessingRequestCreator and RequestProcessor are supplied as well as an appropriate ProcessingActionType, specifying what action is being performed.
Example Processing Strategy implementation
You can find an example implementation for the Release action Processing Strategy below:
package com.iconsolutions.ipf.core.releaser;
@RequiredArgsConstructor
public class ExampleReleaseProcessingStrategy
implements ProcessingStrategy<ExamplePaymentInitiation, ExamplePaymentInstruction, ExamplePaymentTransaction, ExecutePaymentRequest> {
private final ProcessingRequestCreator<ExamplePaymentInitiation, ExamplePaymentInstruction, ExamplePaymentTransaction, ExecutePaymentRequest> requestCreator;
private final RequestProcessor<ExecutePaymentRequest> requestSender;
@Override
public ProcessingRequestCreator<ExamplePaymentInitiation, ExamplePaymentInstruction, ExamplePaymentTransaction, ExecutePaymentRequest> getRequestCreator() {
return requestCreator; (1)
}
@Override
public RequestProcessor<ExecutePaymentRequest> getRequestProcessor() {
return requestSender; (2)
}
@Override
public ProcessingActionType getActionType() {
return ProcessingActionTypes.RELEASE; (3)
}
}
| 1 | client-specific ProcessingRequestCreator implementation, used for creating ExecutePaymentRequest instance. |
| 2 | client-specific RequestProcessor implementation, used for sending previously created ExecutePaymentRequest for the Execution |
| 3 | custom or predefined ProcessingActionType, will be used by PaymentEntriesProcessor for invoking the appropriate Creator and Processor implementations defined above |
ProcessingActionTypes.RELEASE and ProcessingActionTypes.CANCEL are predefined Action Types ready to be used in your Processing Strategy implementation(s)
|
The ProcessingActionTypes class provides a registry for managing instances of ProcessingActionType. Out of the box it includes default action types such as CANCEL and RELEASE.
However, the ProcessingActionType allows for the flexibility to define other action type instances.
Further details are outlined in the Implementation page