mattnicee7 / PixQRCodeGenerator

Generate PIX QRCode/Copy Paste with this framework.
12 stars 1 forks source link
bacen framework java pix pix-copia-e-cola pix-qrcode

PixQRCodeGenerator

Welcome to the repository. Here you will find how this framework was made, example usages, and more Issues & Pull-Requests are welcome in this repository, thanks.

Import the framework to the your project:

Maven:

<repositories>
    <repository>
        <id>jitpack</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.mattnicee7</groupId>
        <artifactId>PixQRCodeGenerator</artifactId>
        <version>1.1.3</version>
    </dependency>
</dependencies>

Gradle:

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.mattnicee7:PixQRCodeGenerator:1.1.3'
}

Example Usages:

Example 1 (A PIX without assigned value):

final PixQRCode myPixWithoutValue = new PixQRCodeBuilder()
        .receiverFullName("Fantasy Name")
        .transactionIdentifier("SalaryPayment")
        .receiverCity("Sao Paulo")
        .pixKey("mypix@tests.com")
        .withValue(false)
        .build();

System.out.println(myPixWithoutValue.getAsText());

Example 2 (A PIX with assigned value):

final PixQRCode myPixWithValue = new PixQRCodeBuilder()
        .receiverFullName("Other Fantasy Name")
        .transactionIdentifier("13thSalaryPayment")
        .receiverCity("Brasilia")
        .pixKey("mypix@tests.com")
        .withValue(true)
        .value(123.45)
        .build();

System.out.println(myPixWithValue.getAsText());

Frameworks used:

Documentation and tools used:

See too: