PHP SEPA XML Generator: Generate SEPA XML to define a payment instructions

Recommend this page to a friend!
  Info   View files Example   View files View files (21)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-05-24 (4 months ago) RSS 2.0 feedNot enough user ratingsTotal: 74 This week: 1All time: 9,653 This week: 259Up
Version License PHP version Categories
sepa 1.1.0Freely Distributable7XML, PHP 5, E-Commerce, Finances
Description Author

This package can be used to Generate SEPA XML to define a payment instructions.

It can compose and validate XML documents that follow the SEPA standard to define payment instructions between to bank account holders.

Currently it allows to define payment instructions for a Direct Debit Transaction or Credit Transfer Transaction.

The resulting payment instruction can be outputted to a given SEPA XML file.

Picture of Stefan Kientzler
  Performance   Level  
Name: Stefan Kientzler is available for providing paid consulting. Contact Stefan Kientzler .
Classes: 11 packages by
Country: Germany Germany
Age: 53
All time rank: 2052129 in Germany Germany
Week rank: 20 Up2 in Germany Germany Up
Innovation award
Innovation award
Nominee: 6x

Winner: 4x

Details

PHP SEPA XML Generator: Generate SEPA XML to define a payment instructions

Latest Stable Version License Minimum PHP Version

History

  • 2020-05-21 * new static method init() have to be called first before any use of the package! * added multi country validation for IBAN, BIC and CI * added language support for error messages * renamed namespace to fit PSR-4 recommendations for autoloading
  • 2020-02-18 * initial Version

Overview

The SEPA (Single Euro Payment Area) is a system of transactions created by the EU (European Union) to harmonize the cashless payments within the EU countries. This package supplies the two main transactions provided by the SEPA-System:

Direct Debit Transaction

Get Payments from partners/customers/members issued an 'SEPA mandate'. The SEPA-mandate contains complete Bank Account Details: - Name of financial institute - IBAN (International Bank Account Number) - BIC (Business Identifier Code) - Mandate-ID (internal generated unique ID ? have to be re assigned to a customer (?) in case he has changed bank account!) - Date, the owner of the account has authorized and signed the Mandate.

Credit Transfer Transaction

Dispose payments to any partner. To initiate a credit transfer transaction, no SEPA-Mandate is needed. Complete bank account information to the recipient is sufficient.

Preconditions to participate on the SEPA-System

To invoke some SEPA transaction the participants needs: - Valid bank account (Name of financial institute, IBAN, BIC) - CI (Creditor Scheme Identification)

Participating countries

> A total of 32 European countries participate in SEPA. In addition to the 27 EU countries, the three countries of the rest of the European Economic Area (EEA) as well as Switzerland and Monaco also participate in SEPA. SEPA payments can only be processed in euros. The SEPA procedure cannot be used for payments in other currencies. A foreign transfer is still required here. This makes it very clear that SEPA is only made in EURO to the 32 countries. In the 32 countries, the seat of the house bank of the debtors / creditors is decisive.

Installation

You can download the Latest release version from PHPClasses.org

Usage

SepaTest shows simple code to generate a valid SEPA XML-File.

Specify additional country validation(s)

If the validation for a required country is not yet included in the package, it can be added as described below. (It would be nice to send new validations to me. So I can integrate them into the package in order that other users can also benefit from - S.Kien@online.de)

To define country specific validation for IBAN, BIC and CI create a class extending *SepaCntryValidationBase* and call *Sepa::addValidation('CC', 'MyValidationClassName');*

For most of the participating countries, it is sufficient to specify in the constructor the respective length, the formatting rule (RegEx) and the information whether alphanumeric characters are allowed.

If more complicated rules apply in a country, the respective method for validation can be redefined in the extended class in order to map this rule. (as an example, look at implementation of SepaCntryValidationBE class)

class MyValidationClassName extends SepaCntryValidationBase
{
    /
     * create instance of validation.
     * @param string $strCntry  2 sign country code
     */
    public function __construct($strCntry)
    {
        $this->strCntry = 'CC';	// MUST contain the desired country code
        $this->iLenIBAN = 20;
        $this->strRegExIBAN = '/^([A-Z]){2}([0-9]){18}?$/';
        $this->iLenCI = 18;
        $this->strRegExCI = '/^([A-Z]){2}([0-9]){2}([0-9A-Z]){3}([0-9]){11}?$/';
        
        parent::__construct(strtoupper($strCntry));
    }
}

Information on country specific formats can be found on IBAN: ECBS - European Banking Resources| CI: European Payments Council - Creditor Identifier Overview|

Translate error messages

In order to receive the error messages of the various validation functions in the desired language, one of the files sepa_errormsg_de.json or sepa_errormsg_en.json can be used as a template and translated accordingly. The translated messages must then be loaded using the method *Sepa :: loadErrorMsg ('sepa_errormsg_XX.json')*

  Files folder image Files  
File Role Description
Files folder imageSKien (1 directory)
Accessible without login Plain text file autoloader.php Aux. Auxiliary script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file readme.md Doc. Documentation
Accessible without login Plain text file sepatest.php Example Test/Example code
Accessible without login Plain text file sepa_errormsg_de.json Data Auxiliary data
Accessible without login Plain text file sepa_errormsg_en.json Data Auxiliary data

  Files folder image Files  /  SKien  
File Role Description
Files folder imageSepa (5 files, 1 directory)

  Files folder image Files  /  SKien  /  Sepa  
File Role Description
Files folder imageCntryValidation (10 files)
  Plain text file Sepa.php Class Class source
  Plain text file SepaDoc.php Class Class source
  Plain text file SepaHelper.php Class Class source
  Plain text file SepaPmtInf.php Class Class source
  Plain text file SepaTxInf.php Class Class source

  Files folder image Files  /  SKien  /  Sepa  /  CntryValidation  
File Role Description
  Plain text file SepaCntryValidation.php Class Class source
  Plain text file SepaCntryValidationAT.php Class Class source
  Plain text file SepaCntryValidationBase.php Class Class source
  Plain text file SepaCntryValidationBE.php Class Class source
  Plain text file SepaCntryValidationCH.php Class Class source
  Plain text file SepaCntryValidationDE.php Class Class source
  Plain text file SepaCntryValidationEE.php Class Class source
  Plain text file SepaCntryValidationFR.php Class Class source
  Plain text file SepaCntryValidationGB.php Class Class source
  Plain text file SepaCntryValidationLU.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:74
This week:1
All time:9,653
This week:259Up

For more information send a message to info at phpclasses dot org.