2017 © Pedro PelĂĄez
 

library swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

image

z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  • Monday, July 16, 2018
  • by z38
  • Repository
  • 5 Watchers
  • 16 Stars
  • 3,800 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 14 Versions
  • 34 % Grown

The README.md

SwissPayment

Build Status Scrutinizer Code Quality, (*1)

SwissPayment is a PHP library to generate Swiss pain.001 XML messages (complies with ISO-20022)., (*2)

Installation

Just install Composer and run composer require z38/swiss-payment in your project directory., (*3)

Usage

To get a basic understanding on how the messages are structured, take a look the resources mentioned below. The following example shows how to create a message containing two transactions:, (*4)

<?php

require_once __DIR__.'/vendor/autoload.php';

use Z38\SwissPayment\BIC;
use Z38\SwissPayment\IBAN;
use Z38\SwissPayment\Message\CustomerCreditTransfer;
use Z38\SwissPayment\Money;
use Z38\SwissPayment\PaymentInformation\PaymentInformation;
use Z38\SwissPayment\PostalAccount;
use Z38\SwissPayment\StructuredPostalAddress;
use Z38\SwissPayment\TransactionInformation\BankCreditTransfer;
use Z38\SwissPayment\TransactionInformation\IS1CreditTransfer;
use Z38\SwissPayment\UnstructuredPostalAddress;

$transaction1 = new BankCreditTransfer(
    'instr-001',
    'e2e-001',
    new Money\CHF(130000), // CHF 1300.00
    'Muster Transport AG',
    new StructuredPostalAddress('Wiesenweg', '14b', '8058', 'ZĂŒrich-Flughafen'),
    new IBAN('CH51 0022 5225 9529 1301 C'),
    new BIC('UBSWCHZH80A')
);

$transaction2 = new IS1CreditTransfer(
    'instr-002',
    'e2e-002',
    new Money\CHF(30000), // CHF 300.00
    'Finanzverwaltung Stadt Musterhausen',
    UnstructuredPostalAddress::sanitize('Altstadt 1a', '4998 Musterhausen'),
    new PostalAccount('80-151-4')
);

$payment = new PaymentInformation(
    'payment-001',
    'InnoMuster AG',
    new BIC('ZKBKCHZZ80A'),
    new IBAN('CH6600700110000204481')
);
$payment->addTransaction($transaction1);
$payment->addTransaction($transaction2);

$message = new CustomerCreditTransfer('message-001', 'InnoMuster AG');
$message->addPayment($payment);

echo $message->asXml();

Tip: Take a look at Z38\SwissPayment\Tests\Message\CustomerCreditTransferTest to see all payment types in action., (*5)

Caveats

  • Not all business rules and recommendations are enforced, consult the documentation and validate the resulting transaction file in cooperation with your bank.
  • At the moment cheque transfers are not supported (for details consult chapter 2.2 of the Implementation Guidelines)
  • The whole project is still under development and therefore BC breaks can occur. Please contact me if you need a stable code base.

Contributing

If you want to get your hands dirty, great! Here's a couple of steps/guidelines:, (*6)

  • Fork this repository
  • Add your changes & tests for those changes (in tests/).
  • Remember to stick to the existing code style as best as possible. When in doubt, follow PSR-2.
  • Send me a pull request!

If you don't want to go through all this, but still found something wrong or missing, please let me know, and/or open a new issue report so that I or others may take care of it., (*7)

Further Resources

The Versions

16/07 2018

dev-master

9999999-dev https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

16/07 2018

dev-next

dev-next https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

16/07 2018

dev-tmp

dev-tmp https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

25/03 2018

v0.6.0

0.6.0.0 https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

25/03 2018

dev-escaping

dev-escaping https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

22/02 2018

dev-wip

dev-wip https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

22/02 2018

dev-qr-bill

dev-qr-bill https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

07/03 2017

v0.5.0

0.5.0.0 https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

31/08 2016

v0.4.1

0.4.1.0 https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

28/08 2016

v0.4.0

0.4.0.0 https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

01/01 2016

v0.3.0

0.3.0.0 https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

09/03 2015

v0.2.0

0.2.0.0 https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

xml sepa banking switzerland six iso-20022 credit-transfer

06/09 2014

v0.1.0

0.1.0.0 https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

library switzerland six iso-20022 credit-transfer

21/01 2014

dev-use-mathiasverraes-money

dev-use-mathiasverraes-money https://github.com/z38/swiss-payment

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

  Sources   Download

MIT

The Requires

 

The Development Requires

library switzerland six iso-20022 credit-transfer