Documentation for a newer release is available. View Latest

Sepa CT Extension Point Client

Sepa CT Extension Point Client consists of Receive Connector with kafka/jms transports to consume ExtensionPointRequest messages published by Sepa CT CSM Service and a Send Connector to send ExtensionPointResponse. Client will also deal with low level stuff, such as constructing entire scheme ISO message for which client can implement appropriate handler.

Configuration

Property Grouping: ipf.csm.sepa-ct.extension-point

Key Description Default Value

ipf.csm.sepa-ct.extension-point.enabled

When enabled, ExtensionPointRequest messages will be processed and ExtensionPointResponse will be sent.

true

Kafka Client Dependency

<dependency>
    <groupId>com.iconsolutions.ipf.payments.csm.sepact</groupId>
    <artifactId>sepact-csm-extension-point-client-kafka</artifactId>
</dependency>

Property Grouping: ipf.csm.sepa-ct.extension-point.kafka

Key Description Default Value

ipf.csm.sepa-ct.extension-point.kafka.consumer.kafka-clients.group.id

"sepa-csm-extension-point-group"

ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.max-restarts-within

"10m"

ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.max-backoff

"5s"

ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.min-backoff

"1s"

ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.min-backoff

"1s"

ipf.csm.sepa-ct.extension-point.kafka.producer.topic

"SEPA_EXTENSION_POINT_RESPONSE"

ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.max-restarts-within

"10m"

ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.max-restarts

5

ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.max-backoff

"5s"

ipf.csm.sepa-ct.extension-point.kafka.consumer.restart-settings.random-factor

0.25

ipf.csm.sepa-ct.extension-point.kafka.producer.kafka-clients.client.id

"sepa-csm-extension-point-client"

ipf.csm.sepa-ct.extension-point.kafka.consumer.topic

"SEPA_EXTENSION_POINT_REQUEST"

ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.max-restarts

5

ipf.csm.sepa-ct.extension-point.kafka.producer.restart-settings.random-factor

0.25

Jms Client Dependency

<dependency>
    <groupId>com.iconsolutions.ipf.payments.csm.sepact</groupId>
    <artifactId>sepact-csm-extension-point-client-jms</artifactId>
</dependency>

Property Grouping: ipf.csm.sepa-ct.extension-point.jms

Key Description Default Value

ipf.csm.sepa-ct.extension-point.jms.consumer-window-size

0

ipf.csm.sepa-ct.extension-point.jms.failover-timeout

5000

ipf.csm.sepa-ct.extension-point.jms.request.queue

Queue to receive ExtensionPointRequest

"SEPA_EXTENSION_POINT_RESPONSE"

ipf.csm.sepa-ct.extension-point.jms.response.queue

Queue to send ExtensionPointResponse

"SEPA_EXTENSION_POINT_REQUEST"

How To Use

Add either Kafka or Jms sepact-csm-extension-point-client dependency and ipf-component-store-mongo to your IPF Application.

<dependency>
    <groupId>com.iconsolutions.ipf.componentstore</groupId>
    <artifactId>ipf-component-store-mongo</artifactId>
</dependency>

Validating Messages

The Extension Point Client will construct java object representation of ISO message from ExtensionPointRequest and child components which are stored in ipf-component-store and forward it to MessageHandler implementation. In case MessageHandler is not defined for specific ISO message, client will always respond with ACCEPT outcome.

In case you want to validate a pacs.008 message, you need create a class which implements MessageHandler interface and define it as spring bean.

public interface MessageHandler<T> {

    CompletionStage<Outcome> handleMessage(ProcessingContext processingContext, T message);
    Class<T> forType();
    Direction forDirection();

    @Getter
    @RequiredArgsConstructor(access = AccessLevel.PRIVATE)
    class Outcome {
        private final ExtensionPointOutcome outcome;
        private final String rejectionReason;

        public static Outcome accept() {
            return new Outcome(ExtensionPointOutcome.ACCEPT, null);
        }

        public static Outcome reject(String rejectionReason) {
            return new Outcome(ExtensionPointOutcome.REJECT, rejectionReason);
        }

    }
}

Example class which will validate NbOfTxs and TtlIntrBkSttlmAmt in Pacs.008 GroupHeader:

@Component
public class Pacs008FromSchemeMessageHandler implements MessageHandler<SCTFIToFICustomerCreditTransferV08> {
    @Override
    public CompletionStage<Outcome> handleMessage(ProcessingContext processingContext, SCTFIToFICustomerCreditTransferV08 message) {
        BigDecimal ttlAmount = message.getGrpHdr().getTtlIntrBkSttlmAmt().getValue();
        BigDecimal transactionAmountsSum = message.getCdtTrfTxInves().stream()
                .map(transaction -> transaction.getIntrBkSttlmAmt().getValue())
                .reduce(BigDecimal.ZERO, BigDecimal::add);

        if (Integer.getInteger(message.getGrpHdr().getNbOfTxs()).equals(message.getCdtTrfTxInves().size())
                && ttlAmount.compareTo(transactionAmountsSum) == 0) {
            return CompletableFuture.completedStage(Outcome.accept());
        } else {
            return CompletableFuture.completedStage(Outcome.reject("IntrBkSttlmAmt doesn't match"));
        }
    }

    @Override
    public Class<SCTFIToFICustomerCreditTransferV08> forType() {
        return SCTFIToFICustomerCreditTransferV08.class;
    }

    @Override
    public Direction forDirection() {
        Direction.FROM_SCHEME;
    }
}

ISO Message types for which handlers can be defined:

ISO Message

Java Class

Supported Direction

Pacs.002

sepa.ct.iso.std.iso._20022.tech.xsd.pacs_002_001_10S2.SCTFIToFIPaymentStatusReportV10

FROM_SCHEME

Pacs.004

sepa.ct.iso.std.iso._20022.tech.xsd.pacs_004_001_009.SCTPaymentReturnV09

TO_SCHEME/FROM_SCHEME

Pacs.008

sepa.ct.iso.std.iso._20022.tech.xsd.pacs_008_001_008.SCTFIToFICustomerCreditTransferV08

TO_SCHEME/FROM_SCHEME

Pacs.028

sepa.ct.iso.std.iso._20022.tech.xsd.pacs_028_001_003.SCTFIToFIPaymentStatusRequestV03

FROM_SCHEME

Camt.027

sepa.ct.iso.std.iso._20022.tech.xsd.camt_027_001_007.SCTClaimNonReceiptV07

FROM_SCHEME

Camt.029

sepa.ct.iso.std.iso._20022.tech.xsd.camt_029_001_009.SCTResolutionOfInvestigationV09

TO_SCHEME/FROM_SCHEME

Camt.056

sepa.ct.iso.std.iso._20022.tech.xsd.camt_056_001_008.SCTFIToFIPaymentCancellationRequestV08

TO_SCHEME/FROM_SCHEME

Camt.087

sepa.ct.iso.std.iso._20022.tech.xsd.camt_087_001_006.SCTRequestToModifyPaymentV06

FROM_SCHEME