Go to file
dankito 5d9c22ddc5 Bumped version to 0.5.1-SNAPSHOT 2024-10-16 01:45:12 +02:00
EpcQrCode Deactivated targets tvOS and watchOS as korim 3.4.0 does not support them 2024-10-16 01:42:45 +02:00
EpcQrCodeAndroidApp Fixed that Android 12+ now requires "exported" to be set to true 2023-04-11 02:28:19 +02:00
EpcQrCodeJavaFxApp Implemented generating QR code 2022-03-13 23:23:24 +01:00
EpcQrCodeNativeApp Fixed setting height and width in native app 2023-04-11 01:08:26 +02:00
EpcQrCodeRest Updated Quarkus version 2024-10-01 18:29:28 +02:00
EpcQrCodeiOSApp Renamed EpcQrCodeCreator to EpcQrCodeGenerator 2022-03-13 22:23:22 +01:00
docs/Specifications Added specification 2024-10-03 18:24:32 +02:00
gradle Configured publishing 2024-10-16 00:41:05 +02:00
kotlin-js-store Updated Kotlin version 1.9.x 2024-10-01 20:49:16 +02:00
.gitignore Initial commit 2020-11-10 01:45:08 +01:00
.gitmodules Configured publishing 2024-10-16 00:41:05 +02:00
README.md Added README 2024-10-16 01:21:14 +02:00
build.gradle.kts Bumped version to 0.5.1-SNAPSHOT 2024-10-16 01:45:12 +02:00
gradle.properties Updated Kotlin version 1.9.x 2024-10-01 20:49:16 +02:00
gradlew Initial commit 2020-11-10 01:45:08 +01:00
gradlew.bat Initial commit 2020-11-10 01:45:08 +01:00
settings.gradle.kts Set rootProject name to 'EpcQrCodeProject' so that it doesn't conflict with 'EpcQrCode' project 2024-10-16 00:40:02 +02:00

README.md

EPC QR Code

Vermarktet als GiroCode, scan2Code, Zahlen mit Code, ... ist der EPC QR Code ein Standard des European Payments Council zum Übermitteln von Überweisungsdaten mittels eines QR Codes.

Der EPC QR Code enthält Überweisungsdaten wie IBAN, Empfängername, Betrag, ...
Eine Clientanwendung scannt dieses QR Code und kann sofort alle Überweisungsdaten anzeigen und, sofern vom Kunden gewünscht, diese Überweisung direkt ausführen.

Setup

Gradle:

repositories {
    // ... mavenCentral() etc.
    maven {
        setUrl("https://maven.dankito.net/api/packages/codinux/maven")
    }
}


dependencies {
    implementation("net.codinux.banking.epcqrcode:epc-qr-code:0.5.0")
}

Maven:

<repositories>
    <repository>
        <id>codinux</id>
        <url>https://git.dankito.net/api/packages/codinux/maven</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>net.codinux.banking.epcqrcode</groupId>
        <artifactId>epc-qr-code-jvm</artifactId>
        <version>0.5.0</version>
    </dependency>
</dependencies>

EPC QR Code erstellen

val generator = net.codinux.banking.epcqrcode.EpcQrCodeGenerator()

// these are the only two mandatory fields:
val receiverName = "Belgian Red Cross"
val iban = "BE72000000001616"

// optional but recommended fields:
val bic: String? = null
val amount: String? = "1"
val reference: String? = "Donation"
val informationForUser: String? = "Was für ein schönes EPC QR Code Beispiel" // not used / displayed by most applications

val qrCodeHeightAndWidth = 400
val imageFormat = ImageFormat.PNG


// generate EPC QR code and QR code image
val result = generator.generateEpcQrCode(EpcQrCodeConfig(receiverName, iban, bic, amount, reference, informationForUser,
    qrCodeHeightAndWidth = qrCodeHeightAndWidth, imageFormat = imageFormat))

val imageBytes = result.bytes // now show these in UI

EPC QR Code dekodieren

Dekodieren Sie zuerst den QR Code mittels einer QR Code Library. Den im QR Code Text übergeben Sie dann an EpcQrCodeParser zum dekodieren der Überweisungsdaten:

val decodedQrCodeText: String = "..." // the text that is contained / read from QR code

val parser = net.codinux.banking.epcqrcode.parser.EpcQrCodeParser()

val result = parser.parseEpcQrCode(decodedQrCodeText)

val epcQrCode = result.epcQrCode
if (epcQrCode != null) {
    println("Receiver = ${epcQrCode.receiverName}, IBAN = ${epcQrCode.iban}, amount = ${epcQrCode.amount}, ...")
} else {
    println("Code not decode EPC QR code: ${result.error}")
}