Giter Site home page Giter Site logo

php-sepa-xml's Introduction

php-sepa-xml

Master: Build Status

SEPA file generator for PHP.

Creates an XML file for a Single Euro Payments Area (SEPA) Credit Transfer and Direct Debit.

License: GNU Lesser General Public License v3.0

The versions of the standard followed are:

  • pain.001.002.03 (or pain.001.001.03) for credits
  • and pain.008.002.02 (or pain.008.001.02) for debits

Institutions and associations that should accept this format:

  • Deutsche Kreditwirtschaft
  • Fédération bancaire française

However, always verify generated files with your bank before using!

##Installation ###Composer This library is available in packagist.org, you can add it to your project via Composer.

In the "require" section of your composer.json file:

Always up to date (bleeding edge, API not guaranteed stable)

"digitick/sepa-xml" : "dev-master"

No namespaces, only bugfixes

"digitick/sepa-xml" : "dev-no_namespace"

Specific minor version, API stability

"digitick/sepa-xml" : "0.10.*"

##Sample Usage DirectDebit with Factory

//Set the initial information
$directDebit = TransferFileFacadeFactory::createDirectDebit('test123', 'Me');

// create a payment, it's possible to create multiple payments,
// "firstPayment" is the identifier for the transactions
$directDebit->addPaymentInfo('firstPayment', array(
	'id' 					=> 'firstPayment',
	'creditorName' 			=> 'My Company',
	'creditorAccountIBAN'	=> 'FI1350001540000056',
	'creditorAgentBIC' 		=> 'PSSTFRPPMON',
	'seqType'				=> PaymentInformation::S_ONEOFF,
	'creditorId'			=> 'DE21WVM1234567890'
));
// Add a Single Transaction to the named payment
$directDebit->addTransfer('firstPayment', array(
	'amount'				=> '500',
	'debtorIban'			=> 'FI1350001540000056',
	'debtorBic'				=> 'OKOYFIHH',
	'debtorName'			=> 'Their Company',
	'debtorMandate'			=>  'AB12345',
	'debtorMandateSignDate'	=> '13.10.2012',
	'remittanceInformation'	=> 'Purpose of this direct debit'
));
// Retrieve the resulting XML
$directDebit->asXML();

##Extended Usage Credit Transfer

// Create the initiating information
$groupHeader = new GroupHeader('SEPA File Identifier', 'Your Company Name');
$sepaFile = new CustomerCreditTransferFile($groupHeader);

$transfer = new CustomerCreditTransferInformation(
    '0.02', // Amount
    'FI1350001540000056', //IBAN of creditor
    'Their Corp' //Name of Creditor
);
$transfer->setBic('OKOYFIHH'); // Set the BIC explicitly
$transfer->setRemittanceInformation('Transaction Description');

// Create a PaymentInformation the Transfer belongs to
$payment = new PaymentInformation(
    'Payment Info ID',
    'FR1420041010050500013M02606', // IBAN the money is transferred from
    'PSSTFRPPMON',  // BIC
    'My Corp' // Debitor Name
);
// It's possible to add multiple Transfers in one Payment
$payment->addTransfer($transfer);

// It's possible to add multiple payments to one SEPA File
$sepaFile->addPaymentInformation($payment);

// Attach a dombuilder to the sepaFile to create the XML output
$domBuilder = DomBuilderFactory::createDomBuilder($sepaFile);

// Or if you want to use the format 'pain.001.001.03' instead
// $domBuilder = DomBuilderFactory::createDomBuilder($sepaFile, 'pain.001.001.03');

$domBuilder->asXml();

php-sepa-xml's People

Contributors

beinbm avatar bobbxy avatar ch3ric avatar denis-sokolov avatar ianare avatar leonex-cs1 avatar mclois avatar momobulle avatar monofone avatar nannehuiges avatar remyvv avatar ruudk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.