{"id":24464521,"url":"https://github.com/dongri/emv-qrcode","last_synced_at":"2025-09-09T11:17:49.731Z","repository":{"id":34897175,"uuid":"152840216","full_name":"dongri/emv-qrcode","owner":"dongri","description":"Golang Based EMV QR Code Generator and Parser (MPM, CPM)","archived":false,"fork":false,"pushed_at":"2023-07-17T04:00:19.000Z","size":5695,"stargazers_count":56,"open_issues_count":0,"forks_count":29,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T07:14:35.223Z","etag":null,"topics":["emv","golang","qr","qrcode"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dongri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"dongri","patreon":"dongri","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"custom":null}},"created_at":"2018-10-13T05:55:02.000Z","updated_at":"2024-12-09T16:56:49.000Z","dependencies_parsed_at":"2024-06-18T20:12:21.099Z","dependency_job_id":"fa42273c-02df-4c6f-a020-7d86f4166d1b","html_url":"https://github.com/dongri/emv-qrcode","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dongri/emv-qrcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Femv-qrcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Femv-qrcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Femv-qrcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Femv-qrcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dongri","download_url":"https://codeload.github.com/dongri/emv-qrcode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Femv-qrcode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270294670,"owners_count":24560334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emv","golang","qr","qrcode"],"created_at":"2025-01-21T05:15:54.825Z","updated_at":"2025-08-13T18:52:00.799Z","avatar_url":"https://github.com/dongri.png","language":"Go","funding_links":["https://github.com/sponsors/dongri","https://patreon.com/dongri"],"categories":[],"sub_categories":[],"readme":"# EMVco QR code\n\n[![CircleCI](https://circleci.com/gh/dongri/emv-qrcode.svg?style=svg)](https://circleci.com/gh/dongri/emv-qrcode)\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/dongri/emv-qrcode)](https://goreportcard.com/report/github.com/dongri/emv-qrcode)\n\n### Documents\nhttps://github.com/dongri/emv-qrcode-doc\n\n### MPM (Merchant Presented Mode)\n```go\npackage main\n\nimport(\n\t\"log\"\n\n\t\"github.com/dongri/emv-qrcode/emv/mpm\"\n)\nfunc main() {\n\n\t// MPM Encode\n\temvqr := new(mpm.EMVQR)\n\temvqr.SetPayloadFormatIndicator(\"01\")\n\temvqr.SetPointOfInitiationMethod(\"12\") // 11 is static qrcode\n\tmerchantAccountInformationJCB := new(mpm.MerchantAccountInformation)\n\tmerchantAccountInformationJCB.SetGloballyUniqueIdentifier(\"D123456\")\n\tmerchantAccountInformationJCB.AddPaymentNetworkSpecific(\"13\", \"JCB1234567890\")\n\temvqr.AddMerchantAccountInformation(mpm.ID(\"29\"), merchantAccountInformationJCB)\n\n\tmerchantAccountInformationMaster := new(mpm.MerchantAccountInformation)\n\tmerchantAccountInformationMaster.SetGloballyUniqueIdentifier(\"M123456\")\n\tmerchantAccountInformationMaster.AddPaymentNetworkSpecific(\"04\", \"MASTER1234567890\")\n\temvqr.AddMerchantAccountInformation(mpm.ID(\"31\"), merchantAccountInformationMaster)\n\n\temvqr.SetMerchantCategoryCode(\"5311\")\n\temvqr.SetTransactionCurrency(\"392\")\n\temvqr.SetTransactionAmount(\"999.123\")\n\temvqr.SetCountryCode(\"JP\")\n\temvqr.SetMerchantName(\"DONGRI\")\n\temvqr.SetMerchantCity(\"TOKYO\")\n\tadditionalTemplate := new(mpm.AdditionalDataFieldTemplate)\n\tadditionalTemplate.SetBillNumber(\"hoge\")\n\tadditionalTemplate.SetReferenceLabel(\"fuga\")\n\tadditionalTemplate.SetTerminalLabel(\"piyo\")\n\temvqr.SetAdditionalDataFieldTemplate(additionalTemplate)\n\tcode, err := mpm.Encode(emvqr)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn\n\t}\n\tlog.Println(code) // 0002010102121313JCB12345678900416MASTER12345678905204531153033925407999.1235802JP5906DONGRI6005TOKYO62240104hoge0504fuga0704piyo6304C343\n\n\t// MPM Decode\n\temvqr, err = mpm.Decode(\"00020101021229300012D156000000000510A93FO3230Q31280012D15600000001030812345678520441115802CN5914BEST TRANSPORT6007BEIJING64200002ZH0104最佳运输0202北京540523.7253031565502016233030412340603***0708A60086670902ME91320016A0112233449988770708123456786304A13A\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tlog.Println(emvqr)\n\n\t// Print Raw Data\n\traw := emvqr.RawData()\n\tlog.Println(\"\\n\" + raw)\n\n\t// Print Binary Data\n\tbinary := emvqr.BinaryData()\n\tlog.Println(\"\\n\" + binary)\n\n\t// Print JSON\n\tjson := emvqr.JSON()\n\tlog.Println(json)\n\n}\n```\n\n### CPM (Consumer Presented Mode)\n```go\npackage main\n\nimport(\n\t\"log\"\n\n\t\"github.com/dongri/emv-qrcode/emv/cpm\"\n)\nfunc main() {\n\tqr := new(cpm.EMVQR)\n\tqr.DataPayloadFormatIndicator = \"CPV01\"\n\n\tappTemplate1 := new(cpm.ApplicationTemplate)\n\tappTemplate1.DataApplicationDefinitionFileName = \"A0000000555555\"\n\tappTemplate1.DataApplicationLabel = \"Product1\"\n\tqr.ApplicationTemplates = append(qr.ApplicationTemplates, *appTemplate1)\n\n\tappTemplate2 := new(cpm.ApplicationTemplate)\n\tappTemplate2.DataApplicationDefinitionFileName = \"A0000000666666\"\n\tappTemplate2.DataApplicationLabel = \"Product2\"\n\tqr.ApplicationTemplates = append(qr.ApplicationTemplates, *appTemplate2)\n\n\tcdt := new(cpm.CommonDataTemplate)\n\tcdt.DataApplicationPAN = \"1234567890123458\"\n\tcdt.DataCardholderName = \"CARDHOLDER/EMV\"\n\tcdt.DataLanguagePreference = \"ruesdeen\"\n\n\tcdtt := new(cpm.CommonDataTransparentTemplate)\n\tcdtt.DataIssuerApplicationData = \"06010A03000000\"\n\tcdtt.DataApplicationCryptogram = \"584FD385FA234BCC\"\n\tcdtt.DataApplicationTransactionCounter = \"0001\"\n\tcdtt.DataUnpredictableNumber = \"6D58EF13\"\n\tcdt.CommonDataTransparentTemplates = append(cdt.CommonDataTransparentTemplates, *cdtt)\n\n\tqr.CommonDataTemplates = append(qr.CommonDataTemplates, *cdt)\n\n\tcomQRCode, err := qr.GeneratePayload()\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tlog.Println(comQRCode)\n\t// hQVDUFYwMWETTwegAAAAVVVVUAhQcm9kdWN0MWETTwegAAAAZmZmUAhQcm9kdWN0MmJJWggSNFZ4kBI0WF8gDkNBUkRIT0xERVIvRU1WXy0IcnVlc2RlZW5kIZ8QBwYBCgMAAACfJghYT9OF+iNLzJ82AgABnzcEbVjvEw==\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongri%2Femv-qrcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdongri%2Femv-qrcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongri%2Femv-qrcode/lists"}