Skip to content

Generates SEPA QR-Codes for money transfer

Notifications You must be signed in to change notification settings

thompol/bezahlcode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bezahlcode

Generates SEPA QR-Codes for money transfer

Prerequisite

php GD2 extension must be installed

Get started

Copy "bezahlcode.class.php" and "phpqrcode.php" to your desired location. "phpqrcode.php" is only needed if you want to generate the QRCodes local, it is possible to use the Google QRcode API.

require "bezahlcode.class.php";

$bezahlcode = new Bezahlcode("IBAN", "BIC", "bankaccount owner");
$bezahlcode->generatePayload("usage", "amount");

You can get the code as base 64:

$base64 = $bezahlcode->generateBase64(); // Specified filetypes can be: jpg, png, gif; defaults to jpg
echo "<img src='$base64' alt='Bezahlcode' />";

or save the code as image file

$bezahlcode->saveImage("output.jpg");
$bezahlcode->saveImage("output.png", "png"); // Specified filetypes can be: jpg, png, gif; defaults to jpg

or output the Bezahlcode to the webbrowser

$bezahlcode->outputImage();
$bezahlcode->outputImage("jpg"); // Specified filetypes can be: jpg, png, gif; defaults to jpg

There are two optional arguments for the constructor.

/**
 * @param string $iban
 *
 * @param string $bic
 *
 * @param string $name Name of the bank account owner.
 *
 * @param string $qrprovider (optional)
 * 		Defaults to 'phpqrcode'.
 * 		options are 'phpqrcode' or 'google'
 *
 * @param boolean $use_frame (optional) Use Bezahlcode-Frame around the QRcode. Defined by the public variable $base64_frame
 */
$bezahlcode = new Bezahlcode("IBAN", "BIC", "bankaccount owner", "phpqrcode", true);

API

If you don't want to install the class, you can also use our api: https://dev.matthiasschaffer.com/bezahlcode/api.php?iban=[IBAN]&bic=[BIC]&name=[bankaccountowner]&usage=[usage]&amount=[amount]

About

Generates SEPA QR-Codes for money transfer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%