Giter VIP home page Giter VIP logo

sepa-qr-php's Introduction

This project is deprecated. Use smhg/sepa-qr-data instead.

A migration guide is available.

sepa-qr-php CI

Generates SEPA QR codes based on the European Payments Council's standard. These QR codes are scannable by many mobile banking apps. Because app support is at a decent level, it is a good idea to print such a code on an invoice.

Extends endroid/qr-code preserving all its functionality in case lower level QR code manipulation is needed.

PHP 8 support: use smhg/sepa-qr-data.

PHP 5.6 and <7.1 support: use version 2.x of this library.

Installation

composer require smhg/sepa-qr

Example

use SepaQr\SepaQr;

$sepaQr = new SepaQr();

$sepaQr
  ->setName('Name of the beneficiary')
  ->setIban('BE123456789123456789')
  ->setAmount(100) // The amount in Euro
  ->setRemittanceText('Invoice 123456789')
  ->setSize(300);

// Output to browser:
header('Content-Type: ' . $sepaQr->getContentType());
echo $sepaQr->writeString();

// Or embed as image:
echo '<img src="' . $sepaQr->writeDataUri() . '">';

// Or generate a temporary file:
$tmpFileName = tempnam('/tmp', 'prefix');
$tmpFile = fopen($tmpFileName, 'w');
fwrite($tmpFile, $sepaQr->writeString());
// ... add file to your PDF
fclose($tmpFile);
unlink($tmpFileName);

Methods

setServiceTag($serviceTag = 'BCD')

Set the service tag. Currently (?) only one value is allowed: BCD.

setVersion($version = 2)

Set the SEPA QR standard version. In version 1 a BIC is mandatory. In version 2 a BIC is only mandatory outside EEA countries.

setCharacterSet($characterSet = SepaQr::UTF_8)

Set the character set. Available constants are UTF_8, ISO8859_5, ISO8859_1, ISO8859_7, ISO8859_2, ISO8859_10, ISO8859_4 or ISO8859_15.

setIdentification($identification = 'SCT')

Set the identification code. Currently (?) only one value is allowed: SCT.

setBic($bic)

Set the AT-23 BIC of the beneficiary bank.

setName($name)

Set the AT-21 name of the beneficiary

setIban($iban)

Set the AT-20 account number of the beneficiary. Only IBAN is allowed.

setAmount($amount)

Set the AT-04 amount of the credit transfer. Currently (?) only amounts in Euro are allowed.

setPurpose($purpose)

Set the AT-44 purpose of the credit transfer.

setRemittanceReference($remittanceReference)

Set the AT-05 remittance information (structured). Creditor reference (ISO 11649) RF creditor reference may be used.

setRemittanceText($remittanceText)

Set the AT-05 remittance information (unstructured).

setInformation($information)

Set the beneficiary to originator information.

sepa-qr-php's People

Contributors

smhg avatar thomaslandauer avatar makuser avatar romainnorberg 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.