Menu

Home

Anonymous

LIBSEPA Wiki

This Visual Basic module lets you create SEPA XML files containing payment instructions from your VB or VBA project.

The module provides two simple functions:
- AddPayment
- OutputXML

On top, the module provides several public constants. Their Values are derived from the SEPA XML specifications:
- SEPA_LEN_CDTRNM (max. length of the creditor name = 70)
- SEPA_LEN_PMNTID (max. length of the payment identifier, e.g. invoice number = 35)
- SEPA_LEN_RMTINF (max. length of the payment information text = 140)
- SEPA_LEN_NM (max. length of the sender's or creditor's name = 140)
- SEPA_LEN_BIC (max. length of the BIC = 11)

Using LIBSEPA

First, you call AddPayment for each single transaction you want to be contained in the output file. At last you call OutputXML to create the output file.


Function AddPayment


Return Value: Boolean
- True, if successful
- False, if an error occurred (error information will be printed to debug console only)

Arguments:
- strPaymentIdentifier As String: EndToEndID for this transaction. If this value is an empty string, it will be replaced by "NOTPROVIDED".
- dblAmount As Double: the amount to be paid.
- strCreditorName As String: name of the transaction's recipient
- strCreditorBIC As String: BIC of the transaction's recipient
- strCreditorIBAN As String: IBAN of the transactions recipient
- Optional strRemittanceInformation As String: detailed information on the payment's purpose
- Optional strAmountCurrency As String = "EUR": currency of the transaction


Function OutputXML


Return Value: String
- empty string on error
- path as filename of sepa.xml on success

Arguments:
- strDebitorName As String: the sender's name
- strDebitorIBAN As String: the sender's IBAN
- strDebitorBIC As String: the sender's BIC
- Optional ByVal strSenderName As String: name of the initiating party. In theory, this could differ from the debitor's name. Since it won't usually, you can omit this. LIBSEPA will use strDebitorName as well.
- Optional ByVal strMessageID As String: an unique identifier on this transaction set for your own use. If left blank, LIBSEPA will create an ID like "Payment-LIBSEPA-[timestamp]".
- Optional datExecutionDate As Date = #1/1/1999#: the date on which the transaction should be executed. The default is the only accepted value, if you want immediate execution.
- Optional ByVal strFilename As String: provide a full name for the xml output file. If omitted, or if the given file name is not writeable, LIBSEPA will use system's TEMP directory and use a timestamp & ".xml" as file name. In both cases, the used file name will be returned. Nota bene: It is your own responsibility to erase the output file safely after use, if it contains confidential information.
- Optional bBatchBooking As Boolean = True: tells the software processing sepa.xml whether to create single transactions or one batch transaction. If single transactions are possible may depend on special agreements between debtor and bank.

Limitations

Only Payments Implemented
SEPA XML specifications cover a variety of transactions, but only payments (from a debtor to a creditor) are implemented in LIBSEPA.

No IBAN checking
LIBSEPA does not perform any checks on provided IBANs. In order to do this, please check http://www.aswinvanwoudenberg.com/2013/07/18/vba-iban-validator/

No Conversion Of Disallowed Character
The SEPA specification restricts the character set to a set of [A-Za-z0-9+?/:().,'-]. LIBSEPA will not convert other characters to something appropriate, but simply replace them by spaces. So replacement of disallowed characters is most likely to be done by the calling procedures.

Project Members: