Giter VIP home page Giter VIP logo

epc's Introduction

go-epc

A very simple implementation of the EPC069-12 Standard, also known as Girocode.

Girocodes are basically SEPA Bank Transfers encoded in a standardized message format that is machine readable and can be encoded into QR-Codes. This is very handy for users of mobile banking apps, who can just scan the QR-Code and directly have all transaction details without typing all the details.

download lib

go get github.com/scusi/epc

build lib

cd $GOSRC/github.com/scusi/epc
go build ./

Examples

The lib contains 3 example programs that show how to use the lib in a program. The following sections describe how to build and use these example programs.

build example program

cd $GOSRC/github.com/scusi/epc
go build ./cmd/epc-simple
go build ./cmd/epc-parse

Usage of epc-simple

epc-simple can output the EPC message as Text or as QR-Code as a PNG file.

Text Format

With the following command you can create a new EPC message.

$ ./epc-simple -i "DE53200400600200400600" -n "Bündnis Entwicklung Hilft" \
	-a 5 -s "ARD/ Nothilfe Ukraine" -b "COBADEFFXXX" -format text 
BCD
002
1
SCT
COBADEFFXXX
Bündnis Entwicklung Hilft
DE53200400600200400600
EUR5


ARD/ Nothilfe Ukraine

Basically you can pipe the above command to qrencode to manually create a EPC-QR-Code from the message.

$ ./epc-simple -i "DE53200400600200400600" -n "Bündnis Entwicklung Hilft" \
	-a 5 -s "ARD/ Nothilfe Ukraine" -b "COBADEFFXXX" -format text\
	| qrencode -l H -t PNG -o images/test-qr.png 

The above command would write a new QR-Code into the file images/test-qr.png.

test-qr.png

PNG Format

In order to create a new EPC-QR-Code you can do the follwoing:

$ ./epc-simple -i "DE53200400600200400600" -n "Bündnis Entwicklung Hilft" \
	-a 5 -s "ARD/ Nothilfe Ukraine" -b "COBADEFFXXX" -format png > images/test-qr2.png 

The above command would write a new QR-Code into the file images/test-qr2.png.

test-qr2.png

Parsing EPC Messages

You can also do the reverse and parse a text format EPC message into a EPC datastructure.

$ ./epc-simple -i "DE53200400600200400600" -n "Bündnis Entwicklung Hilft" \
        -a 5 -s "ARD/ Nothilfe Ukraine" -b "COBADEFFXXX" -format text > test.epc
$ ./epc-parse -f test.epc
BCD
002
1
SCT
COBADEFFXXX
Bündnis Entwicklung Hilft
DE53200400600200400600
EUR5


ARD/ Nothilfe Ukraine

The first command from the above example does create a new EPC Message, in Text format and pipes that to a file called test.epc The second command reads test.epc and parses the content into a EPC datastruct (epc.EPC), before writeing it to STDOUT.

Links

epc's People

Watchers

 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.