A java library to create valid PAIN.008.001.11 SEPA direct debit and PAIN.001.001.12 SEPA transfer XML documents.
Strings are sanitized according to SEPA rules.
To create a direct debit initialisation XML document you simple start at the DSL.directDebit() point and the DSL will
guide you through the steps:
public String generateXml() { DSL.directDebit("MessageId") .creditor( DSL.account() .name("Creditor Name") .identification("Creditor Identification") .bic("BYLADEM1001") .iban("DE02120300000000202051")) .receive(550) .from( DSL.account() .name("Debitor Name") .identification("Debitor Identification") .bic("BYLADEM1001") .iban("DE02120300000000203051")) .on(LocalDate.now().plusWeeks(1)) .withPaymentIdentification("PaymentIdentification") .overMandate(DSL.oneTimeMandate("Mandate Identifier").issuedAt(LocalDate.now())) .toXml(); }
Creating bank transfer XML document works as simple as the direct debit ones. This time start at the DSL.transfer()
entry point and the DSL will guide you through the steps:
public String generateXml() { DSL.transfer("MessageId") .from( DSL.account() .name("Payer Name") .identification("Payer Identification") .bic("BYLADEM1001") .iban("DE02120300000000202051")) .on(LocalDateTime.now().plusWeeks(1)) .to( DSL.account() .name("Payee Name") .identification("Payee Identification") .bic("BYLADEM1001") .iban("DE02120300000000203051")) .amount(125) .withEndToEndIdentifier("End to end identification") .toXml(); }
Just checkout the repository and run mvn clean install. A .jar file will be created in the target/ directory.
This library was originally written by Robert Becker and is now maintained by Jelmen Guhlke .