Giter Club home page Giter Club logo

sepa-qr-data-php's Issues

add test with different encoding

The data I'm passing contains only ASCII characters. And my PHP file is UTF-8.

However, when I do ->setCharacterSet(SepaQrData::UTF_8) it doesn't work (at least with the banking app I'm trying), but when I do ->setCharacterSet(SepaQrData::ISO8859_1), it does. Why?
And why is the QR code changing at all? And does this setting have to be the same as the setting you pass to endroid/qr-code, or does one (which?) override the other or doesn't it matter?

Wrong QR payment code image

<?php

require_once('vendor/autoload.php');

use SepaQr\Data;
use chillerlan\QRCode\QRCode;
use chillerlan\QRCode\QROptions;

$paymentData = Data::create()
  ->setName('Name of the beneficiary')
  ->setIban('BE123456789123456789')
  ->setAmount(100); // The amount in Euro

$qrOptions = new QROptions([
    'eccLevel' => QRCode::ECC_H // required by EPC standard
]);

(new QRCode($qrOptions))->render($paymentData, 'payment.png');
?>

When I generate the QR with your the above code and let my smartphone bank app scan it it says wrong QR code, not payment QR code! I am in Slovakia (EU), using MBank mobile app and its internal QR payment function (it can scan real QR payment codes on regular basis with no problem).

Multiple currencies

Very informative. I have not dealt with sepa before.
But I noticed one small problem.
My bank app (Revolut: bank with multiple currencies and my account in Euro) did not accept the qr-code without amount. I found out that the missing currency is responsible for this.

Changing the line:

  • $values['amount'] > 0 ? formatMoney($values['amount']) : '',
    to
  • $values['amount'] > 0 ? formatMoney($values['amount']) : 'EUR',

to specify the currency without amount solved it. But I was still not satisfied.
After creating the function "setCurrency" and other additions, you can now choose between several currencies.
Some other changes (preg_replace...) are only for demonstration and/or are alternatives to aborts. Checks could also be done before commit.

Have a look at it on:
Multiple currencies

Add rounded border to the QR code

There's a "standard" in Austria to add a rounded border with some text in it, around the QR code - see https://www.stuzza.at/de/zahlungsverkehr/qr-code.html
It looks like in Germany they have this too: https://www.girocode.de/girocodetools/pages/girosolution/ and on https://en.wikipedia.org/wiki/EPC_QR_code some other countries are mentioned as well.

I already suggested this at endroid/qr-code#313 - just mentioning this here in case somebody is interested... ;-)

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.