Skip to content

Commit

Permalink
Imrpove docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Mar 4, 2018
1 parent 7c33a62 commit 958a9e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
[![Build Status](https://travis-ci.org/sprain/php-swiss-qr-bill.svg?branch=master)](https://travis-ci.org/sprain/php-swiss-qr-bill)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/sprain/php-swiss-qr-bill/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/sprain/php-swiss-qr-bill/?branch=master)

A PHP library to create Swiss QR bills, a new standard which will replace the existing inpayment slips in 2019.
A PHP library to create Swiss QR Bill payment parts, a new standard which will replace the existing inpayment slips in 2019.

For official information see
https://www.paymentstandards.ch/en/home/softwarepartner/qr-bill.html

**This is work in progress and not yet ready for production. [You are welcome to contribute.](https://github.com/sprain/php-swiss-qr-bill/issues)**
**This is work in progress. [You are welcome to contribute.](https://github.com/sprain/php-swiss-qr-bill/issues)**

![Image of Swiss QR Bill example](https://www.paymentstandards.ch/dam/images/en/qr-bill-payment-part.png)

## Documentation

Currently the only documentation is the example code in [doc/example.php](doc/example.php).
## Installation

```
composer require sprain/swiss-qr-bill
```


## Usage
See [doc/example.php](doc/example.php).

7 changes: 4 additions & 3 deletions doc/example.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
->setCity('Lausanne')
->setCountry('CH');

$qrBill->setUltimateDebtor($debtor);

// Add payment amount information
// What amount is to be paid? When is it due?
$paymentAmountInformation = (new QrBill\DataGroups\PaymentAmountInformation())
Expand All @@ -56,10 +58,9 @@

$qrBill->setPaymentReference($paymentReference);

// Make sure all data is valid
// Optionally, make sure all data is valid
if (false === $qrBill->isValid()) {
$violations = $qrBill->getViolations();
die(sprintf('There have been %s violations in your qr bill.', $violations->count()));
die(sprintf('There have been %s violations in your qr bill.', $qrBill->getViolations()->count()));
}

// Get QR code image
Expand Down

0 comments on commit 958a9e1

Please sign in to comment.