larsemil/swishcoder

Swish QR Code generator

v1.0 2022-12-06 13:58 UTC

This package is auto-updated.

Last update: 2024-05-06 17:09:23 UTC


README

Small library to generate qr codes

Installation

Install the package using composer.

composer require larsemil/swishcoder

Using it

use larsemil\SwishCoder\SwishCoder;

$q = new SwishCoder();
        $q->payee('+46762216234')
        ->message([
            'value' => 'Order 3'
        ]) //message is optional
        ->amount(['value'=> 100]); //amount is optional

        $data = $q->get(); //gets the qrcode as image/png

API

Method Parameter Description
payee() string with phonenumber The number to send money to
amount() array with parameters See Api reference
message() array with parameters See Api reference
size() integer The height and width of the returned image, measured in pixels. Must be between 1 and 2000. Defaults to 1000.
border() integer A number representing the size of the white border around the QR code. Measured approximately in the width of a single module (dot). Must be between 0 and 10. Defaults to 4.
get() null Get the actual data from swish