PHPackages                             ardfar/parse-qris - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. ardfar/parse-qris

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

ardfar/parse-qris
=================

A Laravel library for parsing QRIS information from QR code images

00PHP

Since Sep 22Pushed 7mo agoCompare

[ Source](https://github.com/ardfar/parse-qris)[ Packagist](https://packagist.org/packages/ardfar/parse-qris)[ RSS](/packages/ardfar-parse-qris/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Parse QRIS
==========

[](#parse-qris)

A Laravel library for parsing QRIS (Quick Response Code Indonesian Standard) information from QR code images and strings.

Features
--------

[](#features)

- ✅ Parse QRIS information from decoded strings
- ✅ Parse QRIS information directly from QR code images
- 📊 Extract comprehensive merchant information
- 💰 Transaction and payment details parsing
- 🏷️ Support for all standard QRIS tags
- 📱 Laravel integration with service provider and facade
- 🔍 Type-safe data structures

Installation
------------

[](#installation)

Install via Composer:

```
composer require ardfar/parse-qris
```

For Laravel auto-discovery, the service provider will be automatically registered. For manual registration, add to `config/app.php`:

```
'providers' => [
    // ...
    Ardfar\ParseQris\QrisServiceProvider::class,
],

'aliases' => [
    // ...
    'QrisParser' => Ardfar\ParseQris\Facades\QrisParser::class,
],
```

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

```
use QrisParser;

$qrisString = "00020101021126680016ID.CO.TELKOM.WWW...";
$qrisData = QrisParser::parseFromString($qrisString);

echo "Merchant: " . $qrisData->merchant_name;
echo "City: " . $qrisData->merchant_city;
echo "Currency: " . $qrisData->transaction_currency;
```

### Using the Parser Class Directly

[](#using-the-parser-class-directly)

```
use Ardfar\ParseQris\QrisParser;

$parser = new QrisParser();
$qrisData = $parser->parseFromString($qrisString);

// Access parsed data
echo "Payload Format: " . $qrisData->payload_format_indicator;
echo "Point of Initiation: " . $qrisData->point_of_initiation_method;
echo "Merchant Name: " . $qrisData->merchant_name;
echo "Merchant City: " . $qrisData->merchant_city;
echo "Currency: " . $qrisData->transaction_currency;
echo "Country Code: " . $qrisData->country_code;
echo "MCC: " . $qrisData->mcc;

// Access merchant information
if ($qrisData->merchant_information_26) {
    echo "Global ID: " . $qrisData->merchant_information_26['global_unique_identifier'];
    echo "Merchant PAN: " . $qrisData->merchant_information_26['merchant_pan'];
    echo "Merchant ID: " . $qrisData->merchant_information_26['merchant_id'];
    echo "Criteria: " . $qrisData->merchant_information_26['merchant_criteria'];
}

// Access additional data
if ($qrisData->additional_data) {
    echo "Reference Label: " . $qrisData->additional_data['reference_label'];
    echo "Terminal Label: " . $qrisData->additional_data['terminal_label'];
}
```

### Converting to Array or JSON

[](#converting-to-array-or-json)

```
$qrisData = QrisParser::parseFromString($qrisString);

// Convert to array
$array = $qrisData->toArray();

// Convert to JSON
$json = $qrisData->toJson();
```

### Parsing from Images

[](#parsing-from-images)

```
try {
    $qrisData = QrisParser::parseFromImage('/path/to/qr-code-image.jpg');

    echo "Merchant: " . $qrisData->merchant_name . "\n";
    echo "City: " . $qrisData->merchant_city . "\n";

} catch (QrisParseException $e) {
    echo "Error: " . $e->getMessage();
}
```

Example Output
--------------

[](#example-output)

Given this QRIS string:

```
00020101021126680016ID.CO.TELKOM.WWW011893600898026635207502150001952663520750303UMI51440014ID.CO.QRIS.WWW0215ID10211254059720303UMI5204549953033605502015802ID5906BIOLBE6011KAB. MALANG610565168622005091147938120703A03630404CB

```

The parser will return:

```
{
    "payload_format_indicator": "01",
    "point_of_initiation_method": "STATIC",
    "merchant_information_26": {
        "global_unique_identifier": "ID.CO.TELKOM.WWW",
        "merchant_pan": "936008980266352075",
        "merchant_id": "000195266352075",
        "merchant_criteria": "UMI"
    },
    "merchant_information_51": {
        "global_unique_identifier": "ID.CO.QRIS.WWW",
        "merchant_id": "ID1021125405972",
        "merchant_criteria": "UMI"
    },
    "mcc": "5499",
    "transaction_currency": "RUPIAH",
    "tip_indicator": "INPUT_TIP",
    "country_code": "ID",
    "merchant_name": "BIOLBE",
    "merchant_city": "KAB. MALANG",
    "merchant_postal_code": "65168",
    "additional_data": {
        "reference_label": "114793812",
        "terminal_label": "A03"
    },
    "crc": "04CB"
}
```

QRIS Information Glossary
-------------------------

[](#qris-information-glossary)

The library extracts the following information from QRIS codes:

- **Merchant Name &amp; Location**: Business name, city, and postal code
- **National Merchant ID (NMID)**: Official merchant registration number
- **Merchant PAN**: Acquirer identification number
- **Merchant ID**: Internal merchant identifier within PJSP system
- **MCC (Merchant Category Code)**: Business type classification
- **Transaction Details**: Currency, amount, tip information
- **Additional Data**: Reference labels, terminal information, etc.

Error Handling
--------------

[](#error-handling)

The library throws `QrisParseException` for various error conditions:

- Invalid or empty QRIS data
- Image file not found
- Invalid image format
- QR code not found in image
- QR code reading errors

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- Laravel 8.0 or higher
- GD extension (for image processing)

Image QR Code Reading
---------------------

[](#image-qr-code-reading)

The library now includes built-in QR code reading functionality using the `khanamiryan/qrcode-detector-decoder` library. The `parseFromImage()` method can automatically detect and decode QR codes from image files in the following formats:

- JPEG (.jpg, .jpeg)
- PNG (.png)
- GIF (.gif)
- BMP (.bmp)

### Usage Example

[](#usage-example)

```
use Ardfar\ParseQris\QrisParser;
use Ardfar\ParseQris\Exceptions\QrisParseException;

try {
    $parser = new QrisParser();
    $qrisData = $parser->parseFromImage('/path/to/qr-image.jpg');

    echo "Merchant: " . $qrisData->merchant_name . "\n";
    echo "Amount: " . $qrisData->transaction_amount . "\n";

} catch (QrisParseException $e) {
    echo "Error reading QR code: " . $e->getMessage() . "\n";
}
```

Testing
-------

[](#testing)

The library includes comprehensive tests. Run them with:

```
vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

Credits
-------

[](#credits)

- Inspired by [terryds/qris-decoder](https://github.com/terryds/qris-decoder)
- Built for the Laravel ecosystem
- Follows Indonesian QRIS standards

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance43

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/26f79c32931229297467f5ba7684ceda0318fb349ce29c4319fcf844d63011ed?d=identicon)[ardfar](/maintainers/ardfar)

---

Top Contributors

[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (6 commits)")[![ardfar](https://avatars.githubusercontent.com/u/82040109?v=4)](https://github.com/ardfar "ardfar (3 commits)")

### Embed Badge

![Health badge](/badges/ardfar-parse-qris/health.svg)

```
[![Health](https://phpackages.com/badges/ardfar-parse-qris/health.svg)](https://phpackages.com/packages/ardfar-parse-qris)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[meyfa/php-svg

Read, edit, write, and render SVG files with PHP

54613.9M42](/packages/meyfa-php-svg)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
