Crates.io | pix-br |
lib.rs | pix-br |
version | 0.1.0 |
source | src |
created_at | 2021-04-13 18:40:11.865046 |
updated_at | 2021-04-13 18:40:11.865046 |
description | Crate to parse and emit BR Codes |
homepage | |
repository | https://github.com/iguilhermeluis/pix-br |
max_upload_size | |
id | 383055 |
size | 53,411 |
QR Code generator for the Brazilian payment system PIX Tools for test PIX QR Decoder.
[dependencies]
pix-br = "0.1.0"
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
}
brcode(params)
:
object key | type | required |
---|---|---|
merchantKey | string | ✅ |
merchantName | string | ✅ |
amount | number | ❌ |
merchantCity | string | ✅ |
merchantCep | string | ❌ |
description | string | ❌ |
isUnique | boolean | ❌ |
Thanks goes to these wonderful people (emoji key):
Guilherme L. Faustino 💻 📖 ⚠️ |