GithubHelp home page GithubHelp logo

emv-qrcode's Introduction

a flutter plugin for decode and genrate emv-mpm qrcode


Usage

Decode func

    final emvdecode = EMVMPM.decode(emvqr);
    debugPrint("emv decode ------> ${emvdecode.toJson()}");

Generate func

    final emv = EMVQR();

    emv.setPayloadFormatIndicator("00");
    emv.setPointOfInitiationMethod("12");

    /// merchant account information
    final mcAccountInfo = MerchantAccountInformation();
    mcAccountInfo.setGloballyUniqueIdentifier("IT");
    mcAccountInfo.addPaymentNetworkSpecific(id: "01", value: "abc");
    mcAccountInfo.addPaymentNetworkSpecific(id: "02", value: "def");
    emv.addMerchantAccountInformation(id: "03", value: mcAccountInfo);

    final additionalData = AdditionalDataFieldTemplate();
    additionalData.setBillNumber("aaaa");
    additionalData.setMerchantTaxID("111");
    additionalData.setMerchantChannel("cha");
    additionalData.addRfuForEMVCo(id: "12", value: "00");
    additionalData.addPaymentSystemSpecific(id: "50", value: "123");
    additionalData.addPaymentSystemSpecific(id: "51", value: "123");
    emv.setAdditionalDataFieldTemplate(additionalData);

   
    final mcInfoLang = MerchantInformationLanguageTemplate();
    mcInfoLang.setLanguagePreferencer("LA");
    mcInfoLang.setMerchantCity("Vientaine");
    mcInfoLang.setMerchantName("MW");
    mcInfoLang.addRfuForEMVCo(id: "03", value: "asfg");
    mcInfoLang.addRfuForEMVCo(id: "04", value: "asfg");
    emv.setMerchantInformationLanguageTemplate(mcInfoLang);

    emv.addRfuForEMVCo(id: "66", value: "bbb");

    final unreserved = UnreservedTemplate();
    unreserved.setGloballyUniqueIdentifier("abs");
    unreserved.addContextSpecificData(id: "01", value: "qw12");
    emv.addUnreservedTemplate(id: "89", value: unreserved);

    debugPrint("emv body ----------> ${emv.value.toJson()}");

    final emvEncode = EMVMPM.encode(emv);
    debugPrint("emv encode -------> ${emvEncode.toJson()}");

add Merchant Account Information function

    final mcAccountInfo = MerchantAccountInformation();

add Additional Data Field Template function

    final additionalData = AdditionalDataFieldTemplate();

add Merchant Information Language Template function

    final mcInfoLang = MerchantInformationLanguageTemplate();

add Unreserved Template function

    final unreserved = UnreservedTemplate();

Credits

  • https://github.com/dongri/emv-qrcode
  • emv-qrcode's People

    Contributors

    boutsakolaiy avatar

    Watchers

    James Cloos avatar

    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.