Download the PHP package qrid/codec without Composer

On this page you can find all versions of the php package qrid/codec. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package codec

qrid/codec — PHP

PHP library for encoding and decoding MergeID electronic invoice QR codes.

MergeID QR codes embed invoice identity information (company, tax ID, contact, address) as a base64-encoded JSON payload. This library handles the encode/decode round-trip and, optionally, SVG QR image generation.

Typical usage flow

Installation

Usage

Decode

Pass the raw string value scanned from a QR code:

decodeQRId trims surrounding whitespace from the input before decoding, so strings copied with accidental padding are handled transparently.

Exceptions thrown:

Exception Cause
InvalidArgumentException Input is not valid base64
JsonException Decoded bytes are not valid JSON

Encode (requires chillerlan/php-qrcode)

Produce an SVG QR code from invoice identity fields:

activityCode is optional and defaults to '' (blank). A blank activity code signals a consuming system to generate an electronic ticket instead of using an activity code.

Exceptions thrown:

Exception Cause
RuntimeException chillerlan/php-qrcode is not installed
JsonException JSON encoding of the payload failed (should not occur in practice)

Payload format

The QR code data is a UTF-8 JSON object encoded as standard base64 (no line-breaks):

Field Type Description
v int Payload schema version. Currently always 1.
id string Tax / company registration ID.
company string Legal company name (UTF-8, including accented characters).
email string Primary billing or contact e-mail address.
address string Physical address of the company.
activity_code string Installation or activity code that links the QR to an internal record. May be blank (""), which signals a consuming system to generate an electronic ticket instead.

Requirements

Dependency Version Required for
PHP >= 8.1 Always
chillerlan/php-qrcode ^5.0 encodeQRId() only

Running tests

Tests cover field decoding, UTF-8 handling, whitespace trimming, error paths, and (when chillerlan/php-qrcode is available) the full encode-decode round-trip.

Publishing

New versions reach Packagist automatically — there is no build/upload step:

  1. Bump the version in the VERSION file (repo root) and merge to main.
  2. release.yml runs on every push to main. It reads VERSION; if no vX.Y.Z tag already exists for it, it runs PHPUnit across PHP 8.2–8.4 (PHPUnit 11's minimum, even though the library itself supports PHP >= 8.1) and creates that tag plus a GitHub Release.
  3. Packagist's webhook on this repository picks up the new tag and republishes it within moments. Composer installs straight from the tagged GitHub source (via dist/zipball), so — unlike PyPI or npm — there's no artifact to build/upload and no OIDC/trusted-publisher concept to configure.

composer.json intentionally has no version field: Composer/Packagist derive the version purely from git tags, and a hardcoded field risks drifting out of sync with the actual tag. VERSION exists only so the release workflow has something to read.

Pushes to main that don't change VERSION are a no-op (the tag already exists), so unrelated commits (docs, CI tweaks) don't trigger a release.

License

MIT


All versions of codec with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package qrid/codec contains the following files

Loading the files please wait ...