Git Product home page Git Product logo

qris's Introduction

qris Pub

QR Code Indonesian Standard Interpreter.

Features

This package enables to break down a valid read QRIS (QR Indonesian Standard) Code into pieces of useful information, such as the QRIS type, merchant name, transaction amount, and various merchant information.

Usage

For example, given a String read by any QR Reading utilities, stored as variable qrisData

00020101021126550016ID.CO.SHOPEE.WWW0118936009180000000018020218
0303UBE51440014ID.CO.QRIS.WWW0215ID20190022915550303UBE520483985
3033605802ID5906Baznas6013Jakarta Pusat61051034062070703A016304A
402
final qris = QRIS(qrisData,);
debugPrint(
  qris.merchantName,
);
// Baznas
      
qris.merchants.forEach(
  (merchant) {
    debugPrint(
      "${merchant.globallyUniqueIdentifier} | ${merchant.merchantCriteria.toString()}",
    );
  },
);
// ID.CO.SHOPEE.WWW | QRISMerchantCriteria.large
      
debugPrint(
qris.pointOfInitiation?.toString(),
);
// QRISInitiationPoint.staticCode

Additional information

Reading from Image File/Gallery

I recommend to try out barcode_finder. Here's the modified sample usage of that plugin. (The example implements file_picker to pick a file, you may replace it with image_picker)

Future<QRIS?> scanFile() async {
  // Used to pick a file from device storage
  final pickedFile = await FilePicker.platform.pickFiles();
  if (pickedFile != null) {
    final filePath = pickedFile.files.single.path;
    if (filePath != null) {
      final scannedData = await BarcodeFinder.scanFile(
        path: path,
        formats: [BarcodeFormat.QR_CODE],
      );
      if (scannedData != null) {
        return QRIS(scannedData,);
      }
    }
  }
  return null;
}

Personal Notes

I documented most of the fields available, but if I miss something, will add in the future. I am also welcome for suggestion regarding documenting the fields.

TO-DOs

  • Adding more factory constructors/object copy utilities
  • Add a QR Code generator from data
  • Usage guide localized in Bahasa

qris's People

Contributors

nsneruno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

qris's Issues

Decode Algorithm Source

Hello, just wondering
the decode process that you made in this package is coming from official documentation (Bank Indonesia) or not yah ?

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.