pix-br

Crates.iopix-br
lib.rspix-br
version0.1.0
sourcesrc
created_at2021-04-13 18:40:11.865046
updated_at2021-04-13 18:40:11.865046
descriptionCrate to parse and emit BR Codes
homepage
repositoryhttps://github.com/iguilhermeluis/pix-br
max_upload_size
id383055
size53,411
Guilherme Luis (iguilhermeluis)

documentation

https://docs.rs/pix-br/

README

PIX-BR

QR Code generator for the Brazilian payment system PIX Tools for test PIX QR Decoder.

Usage

[dependencies]
pix-br = "0.1.0"

Example

Parse String

mod pix_br;
pub use crate::pix_br::pix;

fn main() {
    let brcode = pix::brcode(
        "460ef235-e006-492f-8686-eb5b8cfc5c82", //key (required)
        "Guilherme Luis Faustino",              //name (required)
        Some(82.82),                            //amount (optional)
        None,                                   //city (required)
        Some("Havaina e caipirinha"),           //description (optional)
        None,                                   //zip_code (optional)
        None,                                   //is_unique_transaction (optional)
    );

    pix::save_qrcode_png(brcode.clone(), "/path/file_name.png");

    pix::save_qrcode_svg(brcode.clone(), "/path/file_name.svg");

    pix::get_qrcode_data_uri(brcode.clone()); // return "data:image/png;base64, ... "

	pix::get_qrcode_svg(brcode); // return svg code
}

Params 🎛️

brcode()

brcode(params):

object key type required
merchantKey string
merchantName string
amount number
merchantCity string
merchantCep string
description string
isUnique boolean

Specification

Latest revision version: 3.0.2 (2021-04-11)

Specification by Bacen (DOC)

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Guilherme L. Faustino

💻 📖 ⚠️
Commit count: 3

cargo fmt